本文整理汇总了C#中bycar.DataAccess.getProfileCurrent方法的典型用法代码示例。如果您正苦于以下问题:C# DataAccess.getProfileCurrent方法的具体用法?C# DataAccess.getProfileCurrent怎么用?C# DataAccess.getProfileCurrent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bycar.DataAccess
的用法示例。
在下文中一共展示了DataAccess.getProfileCurrent方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TryLogin
private void TryLogin()
{
int UserID = (int)edtUser.SelectedValue;
admin_unit user = items.FirstOrDefault(x => x.id == UserID);
if (edtPassword.Password == user.password)
{
Res = true;
Marvin.Instance.CurrentUser = user;
if (edtRememberUser.IsChecked == true)
{
DataAccess db = new DataAccess();
settings_profile settings = db.getProfileCurrent();
settings.DefaultUserID = user.id;
db.ProfileEdit(settings);
}
this.Close();
}
else
{
MessageBox.Show("Неправильная комбинация логина и пароля!");
edtPassword.Password = "";
edtPassword.Focus();
}
}
示例2: Window_Loaded
private void Window_Loaded(object sender, RoutedEventArgs e)
{
LoadSpares();
DataAccess db = new DataAccess();
settings_profile sp = db.getProfileCurrent();
cbSimpleIncome.IsChecked = sp.SimpleInput.HasValue ? (sp.SimpleInput.Value == 1 ? true : false) : false;
cbSctrictSearch.IsChecked = sp.StrictSearch.HasValue ? (sp.StrictSearch.Value == 1 ? true : false) : false;
}
示例3: Window_Closing
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
DataAccess db = new DataAccess();
settings_profile sp = db.getProfileCurrent();
//cbSimpleIncome.IsChecked = sp.SimpleInput.HasValue ? (sp.SimpleInput.Value == 1 ? true : false) : false;
sp.SimpleInput = cbSimpleIncome.IsChecked.HasValue ? (cbSimpleIncome.IsChecked.Value ? 1 : 0) : 0;
sp.StrictSearch = cbSctrictSearch.IsChecked.HasValue ? (cbSctrictSearch.IsChecked.Value ? 1 : 0) : 0;
db.ProfileEdit(sp);
}
示例4: Window_Activated
private void Window_Activated(object sender, EventArgs e)
{
if (Outgo == null)
return;
try
{
ReportDocument reportDocument = new ReportDocument();
StreamReader reader = new StreamReader(new FileStream(@"Templates\InvoiceReport.xaml", FileMode.Open, FileAccess.Read));
reportDocument.XamlData = reader.ReadToEnd();
reportDocument.XamlImagePath = System.IO.Path.Combine(Environment.CurrentDirectory, @"Templates\");
reader.Close();
ReportData data = new ReportData();
decimal asum = 0;
DataAccess da = new DataAccess();
string BCC = da.getBasicCurrencyCode();
//Income.currencyReference.Load();
//string CCC = Income.currency.code;
// Таблица ТОВАРЫ В НАКЛАДНОЙ
DataTable dt = new DataTable("mtable");
// описываем столбцы таблицы
dt.Columns.Add("Num", typeof(int));
dt.Columns.Add("SpareName", typeof(string));
dt.Columns.Add("UnitName", typeof(string));
dt.Columns.Add("Q", typeof(int));
dt.Columns.Add("P", typeof(double));
dt.Columns.Add("VR", typeof(string));
dt.Columns.Add("TS", typeof(double));
// забиваем таблицу данными
List<SpareInInvoiceView> LIST2 = da.GetSparesByInvoiceID(InvoiceId);
try
{
string CompanyName = da.getProfileCurrent().CompanyName;
for (int i = 0; i < LIST2.Count; i++)
{
asum += LIST2[i].TotalWithVat.Value;
dt.Rows.Add(new object[] {
i+1,
(LIST2[i].SpareName +" (" + LIST2[i].SpareCodeShatem+ ")"),
"шт.",
LIST2[i].quantity,
LIST2[i].price.Value,
LIST2[i].VatRateName,
LIST2[i].TotalWithVat
});
}
}
catch (Exception exc)
{
Marvin.Instance.Log(exc.Message);
throw exc;
}
string str_ts = RSDN.RusCurrency.Str(asum, "BYR");
//string str_vs = RSDN.RusCurrency.Str(vs, "BYR");
// set constant document values
//string strDate = Outgo.created_on.Value.GetDateTimeFormats('d')[3];
string strDate = Outgo.InvoiceDate.Value.Day.ToString();
string mnth = "";
switch (Outgo.InvoiceDate.Value.Month)
{
case 1:
mnth = "января";
break;
case 2:
mnth = "февраля";
break;
case 3:
mnth = "марта";
break;
case 4:
mnth = "апреля";
break;
case 5:
mnth = "мая";
break;
case 6:
mnth = "июня";
break;
case 7:
mnth = "июля";
break;
case 8:
mnth = "августа";
break;
case 9:
mnth = "сентября";
//.........这里部分代码省略.........
示例5: RefreshWindow
// обновить данные в окошке
public void RefreshWindow()
{
// загрузить список запчастей в таблицу
//LoadSpares();
da = new DataAccess();
if (!da.getProfileCurrent().BasicCurrencyCode.Contains("BYR"))
tabItemOverpricing.Visibility = System.Windows.Visibility.Collapsed;
else
tabItemOverpricing.Visibility = System.Windows.Visibility.Visible;
}
示例6: BuildReportByOutgo
private void BuildReportByOutgo()
{
if (Outgo == null)
return;
try
{
ReportDocument reportDocument = new ReportDocument();
StreamReader reader = new StreamReader(new FileStream(@"Templates\SalesCheckReport.xaml", FileMode.Open, FileAccess.Read));
reportDocument.XamlData = reader.ReadToEnd();
reportDocument.XamlImagePath = System.IO.Path.Combine(Environment.CurrentDirectory, @"Templates\");
reader.Close();
ReportData data = new ReportData();
decimal ts = 0;
decimal vs = 0;
decimal asum = 0;
DataAccess da = new DataAccess();
string BCC = da.getBasicCurrencyCode();
//Income.currencyReference.Load();
//string CCC = Income.currency.code;
// Таблица ТОВАРЫ В НАКЛАДНОЙ
DataTable dt = new DataTable("mtable");
// описываем столбцы таблицы
dt.Columns.Add("SpareName", typeof(string));
dt.Columns.Add("UnitName", typeof(string));
dt.Columns.Add("Quantity", typeof(string));
dt.Columns.Add("Price", typeof(string));
dt.Columns.Add("Amount", typeof(string));
dt.Columns.Add("VAT", typeof(string));
dt.Columns.Add("VATAmount", typeof(string));
dt.Columns.Add("Total", typeof(string));
decimal TotalAmount = 0;
// забиваем таблицу данными
List<ReportOutgo> list = new List<ReportOutgo>();
list = da.GetReportOutgoes(SpareOutgoId);
List<SpareInSpareOutgoView> LIST2 = da.SpareInSpareOutgoViewGet(SpareOutgoId);
try
{
string CompanyName = da.getProfileCurrent().CompanyName;
for (int i = 0; i < LIST2.Count; i++)
{
//decimal Total = list[i].total_sum;
//decimal VatSum = Total * list[i].VatRate.Value / 100;
//decimal Sum = Total - VatSum;
//decimal Price = Sum / list[i].quantity;
TotalAmount += list[i].quantity * list[i].PriceOut.Value;
//ts += Total;
//vs += VatSum;
//asum += Sum;
dt.Rows.Add(new object[] {
list[i].SpareName,
list[i].UnitName,
list[i].quantity.ToString("0.##"),
list[i].PriceOut.Value.ToString("0.##"),
(list[i].PriceOut.Value*list[i].quantity).ToString("0.##"),
list[i].VatName,
0,
0
});
}
}
catch (Exception exc)
{
throw exc;
}
string str_ts = RSDN.RusCurrency.Str(ts, "BYR");
string str_vs = RSDN.RusCurrency.Str(vs, "BYR");
// set constant document values
//string strDate = Outgo.created_on.Value.GetDateTimeFormats('d')[3];
string strDate = Outgo.created_on.Value.Day.ToString();
string mnth = "";
switch (Outgo.created_on.Value.Month)
{
case 1:
mnth = "января";
break;
case 2:
mnth = "февраля";
break;
case 3:
mnth = "марта";
break;
case 4:
mnth = "апреля";
break;
case 5:
mnth = "мая";
//.........这里部分代码省略.........
示例7: BuildReportBySale
private void BuildReportBySale()
{
ReportDocument reportDocument = new ReportDocument();
StreamReader reader = new StreamReader(new FileStream(@"Templates\SalesCheckReport.xaml", FileMode.Open, FileAccess.Read));
reportDocument.XamlData = reader.ReadToEnd();
reportDocument.XamlImagePath = System.IO.Path.Combine(Environment.CurrentDirectory, @"Templates\");
reader.Close();
ReportData data = new ReportData();
decimal ts = 0;
decimal vs = 0;
decimal asum = 0;
DataAccess da = new DataAccess();
string BCC = da.getBasicCurrencyCode();
// Таблица ТОВАРЫ В НАКЛАДНОЙ
DataTable dt = new DataTable("mtable");
// описываем столбцы таблицы
dt.Columns.Add("SpareName", typeof(string));
dt.Columns.Add("UnitName", typeof(string));
dt.Columns.Add("Quantity", typeof(string));
dt.Columns.Add("Price", typeof(string));
dt.Columns.Add("Amount", typeof(string));
dt.Columns.Add("VAT", typeof(string));
dt.Columns.Add("VATAmount", typeof(string));
dt.Columns.Add("Total", typeof(string));
// забиваем таблицу данными
List<ReportOutgo> listx = new List<ReportOutgo>();
listx = da.GetReportOutgoes(sale);
List<ReportItem> list = new List<ReportItem>();
foreach (ReportOutgo s in listx)
{
if (list.FirstOrDefault(x => x.SpareID == s.SpareID) == null)
{
ReportItem ri = new ReportItem();
ri.SpareName = s.SpareName;
ri.UnitName = s.UnitName;
ri.Quantity = s.quantity;
ri.total_sum = s.total_sum;
ri.VatRate = s.VatRate.Value;
ri.VAT = s.VatName;
ri.SpareID = s.SpareID;
ri.Price = CurrencyHelper.GetPrice("BYR", s.PriceOutBasic.Value);
list.Add(ri);
}
else
{
list.FirstOrDefault(x => x.SpareID == s.SpareID).Quantity += s.quantity;
}
}
if (list.Count == 0)
return;
//SpareOutgoId = list[0].OutgoID;
//Outgo = da.SpareOutgoGet(SpareOutgoId);
decimal TotalAmount = 0;
string CompanyName = da.getProfileCurrent().CompanyName;
for (int i = 0; i < list.Count; i++)
{
//decimal Total = list[i].total_sum;
//decimal VatSum = Total * list[i].VatRate / 100;
//decimal Sum = Total - VatSum;
//decimal Price = Sum / list[i].Quantity;
TotalAmount += list[i].Quantity * list[i].Price;
//ts += Total;
//vs += VatSum;
//asum += Sum;
dt.Rows.Add(new object[] {
list[i].SpareName,
list[i].UnitName,
list[i].Quantity.ToString("0.##"),
list[i].Price.ToString("0.##"),
(list[i].Quantity*list[i].Price).ToString("0.##"),
list[i].VAT,
0,
0
});
}
string str_ts = RSDN.RusCurrency.Str(ts, "BYR");
string str_vs = RSDN.RusCurrency.Str(vs, "BYR");
// set constant document values
//string strDate = Outgo.created_on.Value.GetDateTimeFormats('d')[3];
DateTime date = sale.SaleDate;
string strDate = date.Day.ToString();
string mnth = "";
switch (date.Month)
{
case 1:
mnth = "января";
break;
case 2:
//.........这里部分代码省略.........
示例8: Window_Activated
private void Window_Activated(object sender, EventArgs e)
{
if (Outgo == null)
return;
try
{
ReportDocument reportDocument = new ReportDocument();
StreamReader reader = new StreamReader(new FileStream(@"Templates\OverpricingReport.xaml", FileMode.Open, FileAccess.Read));
reportDocument.XamlData = reader.ReadToEnd();
reportDocument.XamlImagePath = System.IO.Path.Combine(Environment.CurrentDirectory, @"Templates\");
reader.Close();
ReportData data = new ReportData();
DataAccess da = new DataAccess();
// Таблица ТОВАРЫ В НАКЛАДНОЙ
DataTable dt = new DataTable("mtable");
// описываем столбцы таблицы
dt.Columns.Add("t1", typeof(string));
dt.Columns.Add("t2", typeof(string));
dt.Columns.Add("t3", typeof(string));
dt.Columns.Add("t4", typeof(string));
dt.Columns.Add("t5", typeof(string));
dt.Columns.Add("t6", typeof(string));
dt.Columns.Add("t7", typeof(string));
dt.Columns.Add("t8", typeof(string));
dt.Columns.Add("t9", typeof(string));
dt.Columns.Add("t10", typeof(string));
decimal sum1 = 0;
decimal sum2 = 0;
decimal sum3 = 0;
// забиваем таблицу данными
List<SpareInOverpricingView> LIST2 = da.OverpricingOfferingGet(ItemID);
try
{
string CompanyName = da.getProfileCurrent().CompanyName;
for (int i = 0; i < LIST2.Count; i++)
{
sum1 += LIST2[i].quantity.Value;
sum2 += LIST2[i].sumOld.Value;
sum3 += LIST2[i].sumNew.Value;
dt.Rows.Add(new object[] {
LIST2[i].SpareName,
LIST2[i].UnitName,
LIST2[i].quantity,
LIST2[i].purchasePrice,
LIST2[i].percentOld,
LIST2[i].priceOld,
LIST2[i].sumOld,
LIST2[i].percentNew,
LIST2[i].priceNew,
LIST2[i].sumNew
});
}
}
catch (Exception exc)
{
Marvin.Instance.Log(exc.Message);
throw exc;
}
string strDate = Outgo.createdOn.Value.Day.ToString();
string mnth = "";
switch (Outgo.createdOn.Value.Month)
{
case 1:
mnth = "января";
break;
case 2:
mnth = "февраля";
break;
case 3:
mnth = "марта";
break;
case 4:
mnth = "апреля";
break;
case 5:
mnth = "мая";
break;
case 6:
mnth = "июня";
break;
case 7:
mnth = "июля";
break;
case 8:
mnth = "августа";
break;
//.........这里部分代码省略.........
示例9: Window_Activated
private void Window_Activated(object sender, EventArgs e)
{
if (Income == null)
return;
try
{
ReportDocument reportDocument = new ReportDocument();
StreamReader reader = new StreamReader(new FileStream(@"Templates\OfferingMovementReport.xaml", FileMode.Open, FileAccess.Read));
reportDocument.XamlData = reader.ReadToEnd();
reportDocument.XamlImagePath = System.IO.Path.Combine(Environment.CurrentDirectory, @"Templates\");
reader.Close();
ReportData data = new ReportData();
// set constant document values
data.ReportDocumentValues.Add("IncomeDate", Income.si_date.GetDateTimeFormats('d')[3]); // print date is now
data.ReportDocumentValues.Add("IncomeNumber", Income.num);
decimal ts = 0;
decimal _S = 0;
decimal _MS = 0;
decimal _VS = 0;
DataAccess da = new DataAccess();
string BCC = da.getBasicCurrencyCode();
Income.currencyReference.Load();
string CCC = Income.currency.code;
// Таблица ТОВАРЫ В НАКЛАДНОЙ
DataTable dt = new DataTable("OfferingsInMovement");
// описываем столбцы таблицы
dt.Columns.Add("Number", typeof(int));
dt.Columns.Add("SpareName", typeof(string));
dt.Columns.Add("SpareCodeShatem", typeof(string));
dt.Columns.Add("SpareCode", typeof(string));
dt.Columns.Add("UnitName", typeof(string));
dt.Columns.Add("Quantity", typeof(string));
dt.Columns.Add("Price", typeof(string));
dt.Columns.Add("Markup", typeof(string));
dt.Columns.Add("VAT", typeof(string));
dt.Columns.Add("Sum", typeof(string));
dt.Columns.Add("MarkupBasic", typeof(string));
dt.Columns.Add("VATBasic", typeof(string));
dt.Columns.Add("PriceOut", typeof(string));
dt.Columns.Add("Amount", typeof(string));
// забиваем таблицу данными
List<ReportIncome> list = new List<ReportIncome>();
list = da.GetReportIncomes(SpareIncomeID);
try
{
string CompanyName = da.getProfileCurrent().CompanyName;
for (int i = 0; i < list.Count; i++)
{
decimal Q = list[i].QIn;
decimal P = list[i].PIn.Value;
decimal S = P * Q;
decimal M = list[i].Markup;
decimal V = list[i].VatRate;
decimal T = list[i].S.Value;
decimal MS = S * M / 100;
decimal VS = S * V / 100;
decimal PriceOut = T / Q;
_MS += MS;
_VS += VS;
_S += S;
ts += T;
dt.Rows.Add(
new object[] {
i+1,
list[i].SpareName,
list[i].codeShatem,
list[i].code,
list[i].UnitName,
Q.ToString ("0.##"),
P.ToString ("0.##"),
M.ToString ("0.##"),
V.ToString ("0.##"),
S.ToString ("0.##"),
MS.ToString ("0.##"),
VS.ToString ("0.##"),
PriceOut.ToString ("0.##"),
T.ToString ("0.##")
});
}
}
catch (Exception exc)
{
throw exc;
}
string sts = RSDN.RusCurrency.Str(ts, CCC);
data.ReportDocumentValues.Add("StringSum", sts);
settings_profile profile = da.getProfileCurrent();
data.ReportDocumentValues.Add("TS", _S.ToString("0.##"));
data.ReportDocumentValues.Add("TMS", _MS.ToString("0.##"));
data.ReportDocumentValues.Add("TVS", _VS.ToString("0.##"));
data.ReportDocumentValues.Add("TTS", ts.ToString("0.##"));
//.........这里部分代码省略.........