本文整理汇总了C#中bycar.DataAccess类的典型用法代码示例。如果您正苦于以下问题:C# DataAccess类的具体用法?C# DataAccess怎么用?C# DataAccess使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataAccess类属于bycar命名空间,在下文中一共展示了DataAccess类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadOfferings
public decimal LoadOfferings()
{
decimal sum = 0;
try
{
int n = 1;
da = new DataAccess();
List<SpareInSpareIncomeView> items = da.GetIncomesByIncomeID(this._id);
foreach (SpareInSpareIncomeView i in items)
{
i.num = n;
sum += i.S.Value;
n++;
}
dgSpares.DataContext = items;
edtSum.Content = "Сумма: " + sum.ToString();
edtCount.Content = "Позиций в накладной: " + items.Count.ToString();
if (items.Count > 0)
edtCurrency.IsEnabled = false;
//OnAnyChangeCheck();
}
catch (Exception ex1)
{
MessageBox.Show(ex1.Message);
}
return sum;
}
示例2: AddRates
private void AddRates()
{
DataAccess da = new DataAccess();
List<currency_rate> rates = new List<currency_rate>();
// USD
currency c1 = da.GetCurrency("USD");
currency_rate r1 = new currency_rate();
r1.currency = c1;
r1.rate = decimal.Parse(edtUSD.Text);
r1.rate_date = DateTime.Now;
// EURO
currency c2 = da.GetCurrency("EUR");
currency_rate r2 = new currency_rate();
r2.currency = c2;
r2.rate = decimal.Parse(edtEURO.Text);
r2.rate_date = DateTime.Now;
// RUR
currency c3 = da.GetCurrency("RUR");
currency_rate r3 = new currency_rate();
r3.currency = c3;
r3.rate = decimal.Parse(edtRUR.Text)/100;
r3.rate_date = DateTime.Now;
rates.Add(r1);
rates.Add(r2);
rates.Add(r3);
da.CurrencyRatesCreate(rates);
}
示例3: getAnalogues
public static int getAnalogues(string FilePath)
{
List<spare_analogue> items = new List<spare_analogue>();
// Объявляем и забиваем файл в документ
XmlDocument xd = new XmlDocument();
FileStream fs = new FileStream(FilePath, FileMode.Open);
xd.Load(fs);
DataAccess da = new DataAccess();
XmlNodeList list = xd.GetElementsByTagName("Row"); // Создаем и заполняем лист по тегу "user"
for (int i = 0; i < list.Count; i++)
{
if (list[i].HasChildNodes)
{
string Spare1Code1C = list[i].ChildNodes[0].InnerText;
string Spare2Code1C = list[i].ChildNodes[1].InnerText;
int is_equal = list[i].ChildNodes[2].InnerText.Contains("стина") ? 1 : 0;
da.SpareAnalogueCreate(is_equal, Spare1Code1C, Spare2Code1C);
}
}
// Закрываем поток
fs.Close();
return items.Count;
}
示例4: ReportViewRevision
public ReportViewRevision(List<SpareView> itms, DateTime dt)
{
InitializeComponent();
DataAccess da = new DataAccess();
items = itms;
d = dt;
}
示例5: btnOK_Click
private void btnOK_Click(object sender, RoutedEventArgs e)
{
// check pass confirm
if (string.IsNullOrWhiteSpace(edtPassword.Password))
{
MessageBox.Show("Пароль не может быть пустым!");
return;
}
if (edtPassword.Password != edtPasswordConfirm.Password)
{
MessageBox.Show("Пароли не совпадают!");
return;
}
DataAccess db = new DataAccess();
if (user == null)
{
// create
// check username
if (db.UserNameExist(edtName.Text))
{
MessageBox.Show("Пользователь с таким именем уже существует!");
return;
}
db.AdminUnitCreate(SaveItem());
}
else
{
// edit
db.AdminUnitEdit(SaveItem());
}
Close();
}
示例6: ReportViewInvoice
public ReportViewInvoice(int id)
{
InitializeComponent();
DataAccess da = new DataAccess();
InvoiceId = id;
Outgo = da.InvoiceGet(id);
}
示例7: LoadUsers
private void LoadUsers()
{
DataAccess db = new DataAccess();
items = db.GetAdminUnits();
edtUser.DataContext = items;
edtUser.SelectedIndex = 0;
}
示例8: SpareOutgoEditView
public SpareOutgoEditView(invoice _inv)
{
da = new DataAccess();
InitializeComponent();
edtNumber.Text = da.SpareOutgoGetMaxId().ToString();
Invoice = da.InvoiceGet(_inv.id);
}
示例9: EditRates
private void EditRates()
{
DataAccess da = new DataAccess();
List<currency_rate> rates = new List<currency_rate>();
// USD
currency c1 = da.GetCurrency("USD");
currency_rate r1 = new currency_rate();
r1.currency = c1;
r1.rate = decimal.Parse(edtUSD.Text);
r1.rate_date = edtDate.SelectedDate.Value;
// EURO
currency c2 = da.GetCurrency("EUR");
currency_rate r2 = new currency_rate();
r2.currency = c2;
r2.rate = decimal.Parse(edtEURO.Text);
r2.rate_date = edtDate.SelectedDate.Value;
// RUR
currency c3 = da.GetCurrency("RUR");
currency_rate r3 = new currency_rate();
r3.currency = c3;
r3.rate = decimal.Parse(edtRUR.Text)/100;
r3.rate_date = edtDate.SelectedDate.Value;
rates.Add(r1);
rates.Add(r2);
rates.Add(r3);
da.CurrencyRatesEdit(rates);
}
示例10: Button_Click
private void Button_Click(object sender, RoutedEventArgs e)
{
try
{
if (Item == null)
{
DataAccess da = new DataAccess();
bank_account ba = new bank_account();
ba.account = da.GetAccount(AccountID);
int BankID = (edtBank.SelectedItem as bank).id;
ba.bank = da.BankGet(BankID);
ba.BankAccount = edtAccountNumber.Text;
ba.Description = edtDescription.Text;
AccountID = da.BankAccountCreate(ba).id;
}
else
{
DataAccess da = new DataAccess();
bank_account ba = da.bank_account_get(Item.id);
int BankID = (edtBank.SelectedItem as bank).id;
ba.bank = da.BankGet(BankID);
ba.BankAccount = edtAccountNumber.Text;
ba.Description = edtDescription.Text;
da.BankAccountEdit(ba);
}
}
catch (Exception)
{
}
Close();
}
示例11: ReportViewSalesCheck
public ReportViewSalesCheck(int outgoId)
{
InitializeComponent();
DataAccess da = new DataAccess();
SpareOutgoId = outgoId;
Outgo = da.SpareOutgoGet(outgoId);
}
示例12: ReportViewOverpricing
public ReportViewOverpricing(int id)
{
InitializeComponent();
DataAccess da = new DataAccess();
ItemID = id;
Outgo = da.OverpricingGet(id);
}
示例13: ReportViewSpareOutgoTTNAppendix
public ReportViewSpareOutgoTTNAppendix(int outgoId)
{
InitializeComponent();
DataAccess da = new DataAccess();
SpareOutgoId = outgoId;
Outgo = da.SpareOutgoGet(outgoId);
}
示例14: CreateItem
private void CreateItem()
{
DataAccess da = new DataAccess();
client item = new client();
item.name = edtName.Text;
item.description = edtDescr.Text;
da.ClientCreate(item, cbCar.SelectedItem.ToString());
}
示例15: CreateItem
private void CreateItem()
{
DataAccess da = new DataAccess();
account_type item = new account_type();
item.name = edtName.Text;
item.description = edtDescr.Text;
da.AccountTypeCreate(item);
}