本文整理汇总了C#中bycar.DataAccess.InOfferingCreate方法的典型用法代码示例。如果您正苦于以下问题:C# DataAccess.InOfferingCreate方法的具体用法?C# DataAccess.InOfferingCreate怎么用?C# DataAccess.InOfferingCreate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bycar.DataAccess
的用法示例。
在下文中一共展示了DataAccess.InOfferingCreate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnNext_Click
private void btnNext_Click(object sender, RoutedEventArgs e)
{
Stage++;
if (Stage == 1)
{
dgSpares.IsEnabled = true;
btnNext.Content = "Сохранить";
}
else
if (Stage == 2)
{
foreach (SpareInSpareIncomeView sisi in offerings)
{
//sisi.SpareName
//sisi.BrandName
//sisi.SpareCode
//sisi.SpareCodeShatem
DataAccess db = new DataAccess();
int SpareID = sisi.SpareID.Value;
db.InOfferingCreate(sisi.SpareID.Value, sisi.QIn, sisi.PIn.Value, sisi.Markup, sisi.POut.Value, sisi.S.Value, sisi.SpareIncomeID.Value);
SpareContainer.Instance.Update(SpareID);
}
Close();
}
}
示例2: getRemains
//.........这里部分代码省略.........
{
decimal P = 0;
if (decimal.TryParse(list[i].ChildNodes[4].InnerText, out P))
{
P = decimal.Parse(list[i].ChildNodes[4].InnerText, ni);
da = new DataAccess();
spare_in_spare_income offering = new spare_in_spare_income();
//[id] - генериурется автоматически
//[num]
offering.num = 0;
//[description]
offering.description = "";
//[QIn]
decimal Q = 0;
Q = decimal.Parse(list[i].ChildNodes[3].InnerText, ni);
offering.QIn = Q;
//[PIn]
offering.PIn = P;
//[PInBasic]
offering.PInBasic = P;
//[VatRateID]
offering.vat_rate = da.getZeroVatRate();
//[Markup]
offering.Markup = 0;
//[SpareIncomeID] - в зависимости от поля #5
string WarehouseMarker = list[i].ChildNodes[5].InnerText;
int SpareIncomeID = 61;
if (WarehouseMarker.Contains("истина"))
SpareIncomeID = 61;
else
SpareIncomeID = 62;
offering.spare_income = da.SpareIncomeGet(SpareIncomeID);
//[CurrencyID]
offering.CurrencyID = 1;
//[S]
offering.S = Q * P;
//[SBasic]
offering.SBasic = Q * P;
//[POut]
offering.POut = P;
//[POutBasic]
offering.POutBasic = P;
//[QRest]
offering.QRest = Q;
string mess = "";
//===================================================== [SpareID]
string SpareCode1C = list[i].ChildNodes[0].InnerText;
mess += "1C:[" + SpareCode1C + "] - ";
// search by code1C
spare sp = null;
sp = da.GetSpare(SpareCode1C);
string code = "X";
if (sp == null)
{
mess += "not found! ";
// search by spare code
code = list[i].ChildNodes[1].InnerText;
mess += "CODE:[" + code + "] - ";
sp = da.GetSpareByCode(code);
}
string name = "X";
if (sp == null)
{
mess += "not found! ";
// search by spare name
name = list[i].ChildNodes[2].InnerText;
mess += "NAME:[" + name + "] - ";
sp = da.GetSpare(name);
}
if (sp == null)
m1 += SpareCode1C + ", " + code + ", " + name + "\n";
else
da.InOfferingCreate(offering, sp.id);
}
}
}
MessageBox.Show(m1);
// Закрываем поток
fs.Close();
return Message;
}