本文整理汇总了C#中bycar.DataAccess类的典型用法代码示例。如果您正苦于以下问题:C# DataAccess类的具体用法?C# DataAccess怎么用?C# DataAccess使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataAccess类属于bycar命名空间,在下文中一共展示了DataAccess类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:bashlykevich,项目名称:Bycar,代码行数:28,代码来源:SpareIncomeEditView.xaml.cs
示例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);
}
开发者ID:bashlykevich,项目名称:Bycar,代码行数:31,代码来源:CurrenciesInput.xaml.cs
示例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;
}
开发者ID:bashlykevich,项目名称:Bycar,代码行数:27,代码来源:Office2003XmlTable.cs
示例4: ReportViewRevision
public ReportViewRevision(List<SpareView> itms, DateTime dt)
{
InitializeComponent();
DataAccess da = new DataAccess();
items = itms;
d = dt;
}
开发者ID:bashlykevich,项目名称:Bycar,代码行数:7,代码来源:ReportViewRevision.xaml.cs
示例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();
}
开发者ID:bashlykevich,项目名称:Bycar,代码行数:32,代码来源:UserEditView.xaml.cs
示例6: ReportViewInvoice
public ReportViewInvoice(int id)
{
InitializeComponent();
DataAccess da = new DataAccess();
InvoiceId = id;
Outgo = da.InvoiceGet(id);
}
开发者ID:bashlykevich,项目名称:Bycar,代码行数:7,代码来源:ReportViewInvoice.xaml.cs
示例7: LoadUsers
private void LoadUsers()
{
DataAccess db = new DataAccess();
items = db.GetAdminUnits();
edtUser.DataContext = items;
edtUser.SelectedIndex = 0;
}
开发者ID:bashlykevich,项目名称:Bycar,代码行数:7,代码来源:LoginView.xaml.cs
示例8: SpareOutgoEditView
public SpareOutgoEditView(invoice _inv)
{
da = new DataAccess();
InitializeComponent();
edtNumber.Text = da.SpareOutgoGetMaxId().ToString();
Invoice = da.InvoiceGet(_inv.id);
}
开发者ID:bashlykevich,项目名称:Bycar,代码行数:7,代码来源:SpareOutgoEditView.xaml.cs
示例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);
}
开发者ID:bashlykevich,项目名称:Bycar,代码行数:31,代码来源:CurrenciesInput.xaml.cs
示例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();
}
开发者ID:bashlykevich,项目名称:Bycar,代码行数:31,代码来源:BankAccountEditView.xaml.cs
示例11: ReportViewSalesCheck
public ReportViewSalesCheck(int outgoId)
{
InitializeComponent();
DataAccess da = new DataAccess();
SpareOutgoId = outgoId;
Outgo = da.SpareOutgoGet(outgoId);
}
开发者ID:bashlykevich,项目名称:Bycar,代码行数:7,代码来源:ReportViewSalesCheck.xaml.cs
示例12: ReportViewOverpricing
public ReportViewOverpricing(int id)
{
InitializeComponent();
DataAccess da = new DataAccess();
ItemID = id;
Outgo = da.OverpricingGet(id);
}
开发者ID:bashlykevich,项目名称:Bycar,代码行数:7,代码来源:ReportViewOverpricing.xaml.cs
示例13: ReportViewSpareOutgoTTNAppendix
public ReportViewSpareOutgoTTNAppendix(int outgoId)
{
InitializeComponent();
DataAccess da = new DataAccess();
SpareOutgoId = outgoId;
Outgo = da.SpareOutgoGet(outgoId);
}
开发者ID:bashlykevich,项目名称:Bycar,代码行数:7,代码来源:ReportViewSpareOutgoTTNAppendix.xaml.cs
示例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());
}
开发者ID:bashlykevich,项目名称:Bycar,代码行数:8,代码来源:ClientsEditView.xaml.cs
示例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);
}
开发者ID:bashlykevich,项目名称:Bycar,代码行数:8,代码来源:AdminUnitsEditView.xaml.cs
示例16: LoadItem
public void LoadItem(int id)
{
_id = id;
DataAccess da = new DataAccess();
unit b = da.GetUnit(id);
edtName.Text = b.name;
edtDescr.Text = b.description;
}
开发者ID:bashlykevich,项目名称:Bycar,代码行数:8,代码来源:UnitsEditView.xaml.cs
示例17: LoadItem
public void LoadItem(int id)
{
DataAccess da = new DataAccess();
Item = da.BankAccountView(id);
edtAccountNumber.Text = Item.BankAccount;
edtBank.SelectedValue = Item.BankID;
edtDescription.Text = Item.Description;
}
开发者ID:bashlykevich,项目名称:Bycar,代码行数:8,代码来源:BankAccountEditView.xaml.cs
示例18: CreateItem
private void CreateItem()
{
DataAccess da = new DataAccess();
brand item = new brand();
item.name = edtName.Text;
item.description = edtDescr.Text;
da.BrandCreate(item);
}
开发者ID:bashlykevich,项目名称:Bycar,代码行数:8,代码来源:BrandsEditView.xaml.cs
示例19: LoadItem
public void LoadItem(int id)
{
_id = id;
DataAccess da = new DataAccess();
car_producer b = da.GetCarProducer(id);
edtName.Text = b.name;
edtDescr.Text = b.descripton;
}
开发者ID:bashlykevich,项目名称:Bycar,代码行数:8,代码来源:CarProducersEditView.xaml.cs
示例20: LoadItem
public void LoadItem(int id)
{
_id = id;
DataAccess da = new DataAccess();
warehouse b = da.GetWarehouse(id);
edtName.Text = b.name;
edtDescr.Text = b.description;
}
开发者ID:bashlykevich,项目名称:Bycar,代码行数:8,代码来源:WarehousesEditView.xaml.cs
注:本文中的bycar.DataAccess类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论