void IncrementWares() { Quantity.Value++; QuantityValueChanged(null, null); this.AddWaresReceipt(); Global.Log(CodeEvent.IncrementWares); }
/// <summary> /// Видаляємо товар з чека /// </summary> /// <param name="varTypeDelete"></param> public void DeleteWaresReceipt(TypeDeleteWaresReceipt varTypeDelete, int parCodeWares = 0, int parCodeUnit = 0) { ParametersCollection varParameters = new ParametersCollection(); varParameters.Add("parIdWorkplace", GlobalVar.varIdWorkPlace, DbType.Int32); varParameters.Add("parCodePeriod", varReceipt.varCodePeriod, DbType.Int32); varParameters.Add("parCodeReceipt", varReceipt.varCodeReceipt, DbType.Int32); switch (varTypeDelete) { case TypeDeleteWaresReceipt.All: varParameters.Add("parCodeWares", 0, DbType.Int32); varParameters.Add("parCodeUnit", 0, DbType.Int32); break; case TypeDeleteWaresReceipt.Current: varParameters.Add("parCodeWares", varWares.varCodeWares, DbType.Int32); varParameters.Add("parCodeUnit", varWares.varCodeUnit, DbType.Int32); break; case TypeDeleteWaresReceipt.Choice: varParameters.Add("parCodeWares", parCodeWares, DbType.Int32); varParameters.Add("parCodeUnit", parCodeUnit, DbType.Int32); break; } varWDB.DeleteWaresReceipt(varParameters); //ViewWaresReceipt(); Global.Log(CodeEvent.DeleteWaresReceipt, (int)varTypeDelete); }
void Login(string parLogin, string parPassword) { DataRow dr = varWDB.Login(parLogin, parPassword); varUser.SetUser(dr); cashier.Text = varUser.varNameUser; Global.Log(CodeLog.Login, varUser.varCodeUser, 0, parLogin + @"\" + cashier.Text); }
void DecrementWares() { if (Quantity.Value > 0) { Quantity.Value--; } QuantityValueChanged(null, null); this.AddWaresReceipt(); Global.Log(CodeEvent.DecrementWares); }
public void SetClient(DataRow parRw) { varClient.SetClient(parRw); ParametersCollection varParameters = new ParametersCollection(); varParameters.Add("parIdWorkplace", GlobalVar.varIdWorkPlace, DbType.Int32); varParameters.Add("parCodePeriod", varReceipt.varCodePeriod, DbType.Int32); varParameters.Add("parCodeReceipt", varReceipt.varCodeReceipt, DbType.Int32); varParameters.Add("parCodeClient", varClient.varCodeClient, DbType.Int32); varWDB.UpdateClient(varParameters); RecalcPrice(); Global.Log(CodeEvent.SetClient, varClient.varCodeClient, 0, this.varClient.varNameClient); }
void SetClient(DataRow parRw) { varClient.SetClient(parRw); Client.Text = varClient.varNameClient; ParametersCollection varParameters = new ParametersCollection(); varParameters.Add("parIdWorkplace", GlobalVar.varIdWorkPlace, DbType.Int32); varParameters.Add("parCodePeriod", varReceipt.varCodePeriod, DbType.Int32); varParameters.Add("parCodeReceipt", varReceipt.varCodeReceipt, DbType.Int32); varParameters.Add("parCodeClient", varClient.varCodeClient, DbType.Int32); varWDB.UpdateClient(varParameters); Bonus.Text = varClient.varSumMoneyBonus.ToString(); RecalcPrice(); Global.Log(CodeLog.SetClient, varClient.varCodeClient, 0, this.varClient.varNameClient); }
public bool Login(string parLogin, string parPassword) { DataRow dr = varWDB.Login(parLogin, parPassword); varUser.SetUser(dr); Global.Log(CodeEvent.Login, varUser.varCodeUser, 0, parLogin + @"\" + varUser.varNameUser); if (varUser.varCodeUser > 0) { Global.InitPermissions(varUser.varCodeUser); return(true); } else { return(false); } }
/// <summary> /// Власне шукає товар/клієнта. /// </summary> /// <param name="parStr"></param> void FindData(string parStr) { RezultFind varRezult = varWork.varWDB.FindData(parStr); Global.Log(CodeEvent.Find, (int)varRezult.TypeFind, varRezult.Count, parStr); if (varRezult.Count == 0) { Message("Нічого не знайшли!!!"); return; } switch (varRezult.TypeFind) { case TypeFind.Wares: //Товар ParametersCollection varParameters = new ParametersCollection(); varParameters.Add("parDiscount", varWork.varClient.varDiscount, DbType.Int32); varDtWares = varWork.varWDB.FindWares(varParameters); if (varDtWares.Rows.Count == 1) { varWork.varWares.SetWares(varDtWares.Rows[0]); EditQuantity(); } else { ChoiceWares(varDtWares); } break; case TypeFind.Client: //Клієнт if (varRezult.Count > 1) { ChoiceClient(); } else { SetClient(varWork.varWDB.FindClient().Rows[0]); } break; } Input.Text = ""; }
public void WriteReceipt() { ParametersCollection varParameters = new ParametersCollection(); varParameters.Add("parIdWorkplace", GlobalVar.varIdWorkPlace, DbType.Int32); varParameters.Add("parCodePeriod", varReceipt.varCodePeriod, DbType.Int32); varParameters.Add("parCodeReceipt", varReceipt.varCodeReceipt, DbType.Int32); varParameters.Add("parStateReceipt", 1, DbType.Int32); varParameters.Add("parSumReceipt", varReceipt.varSumReceipt, DbType.Decimal); varParameters.Add("parVatReceipt", varReceipt.varVatReceipt, DbType.Decimal); varParameters.Add("parSumCash", varReceipt.varSumCash, DbType.Decimal); varParameters.Add("parSumCreditCard", varReceipt.varSumCreditCard, DbType.Decimal); varParameters.Add("parCodeCreditCard", varReceipt.varCodeCreditCard, DbType.Int64); varParameters.Add("parNumberSlip", varReceipt.varNumberSlip, DbType.Int64); varWDB.CloseReceipt(varParameters); Global.Log(CodeEvent.CloseReceipt); }
void PrintReceipt() { //Друк чека!!! //varEKKA.p //Збереження роздукованого чека ParametersCollection varParameters = new ParametersCollection(); varParameters.Add("parIdWorkplace", GlobalVar.varIdWorkPlace, DbType.Int32); varParameters.Add("parCodePeriod", varReceipt.varCodePeriod, DbType.Int32); varParameters.Add("parCodeReceipt", varReceipt.varCodeReceipt, DbType.Int32); varParameters.Add("parStateReceipt", 1, DbType.Int32); varParameters.Add("parSumReceipt", varReceipt.varSumReceipt, DbType.Decimal); varParameters.Add("parVatReceipt", varReceipt.varVatReceipt, DbType.Decimal); varParameters.Add("parSumCash", varReceipt.varSumCash, DbType.Decimal); varParameters.Add("parSumCreditCard", varReceipt.varSumCreditCard, DbType.Decimal); varParameters.Add("parCodeCreditCard", varReceipt.varCodeCreditCard, DbType.Int64); varParameters.Add("parNumberSlip", varReceipt.varNumberSlip, DbType.Int64); varWDB.CloseReceipt(varParameters); Global.Log(CodeLog.CloseReceipt); NewReceipt(); //Відкримаємо новий чек. }
public void NewReceipt() { varClient.Clear(); SetDefaultClient(); varReceipt.SetReceipt(varWDB.GetCodeReceipt()); ParametersCollection varParameters = new ParametersCollection(); varParameters.Add("parIdWorkplace", GlobalVar.varIdWorkPlace, DbType.Int32); varParameters.Add("parCodePeriod", varReceipt.varCodePeriod, DbType.Int32); varParameters.Add("parCodeReceipt", varReceipt.varCodeReceipt, DbType.Int32); varParameters.Add("parDateReceipt", varReceipt.varDateReceipt, DbType.DateTime); varParameters.Add("parCodeWarehouse", GlobalVar.varCodeWarehouse, DbType.Int32); varParameters.Add("parCodePattern", varReceipt.varCodePattern, DbType.Int32); varParameters.Add("parCodeClient", varClient.varCodeClient, DbType.Int32); varParameters.Add("parNumberCashier", varUser.varCodeUser, DbType.Int32); varParameters.Add("parUserCreate", varUser.varCodeUser, DbType.Int32); varWDB.AddReceipt(varParameters); Global.Log(CodeEvent.NewReceipt, varReceipt.varCodePeriod, varReceipt.varCodeReceipt, varReceipt.varDateReceipt.ToString()); }
/// <summary> /// Власне шукає товар/клієнта. /// </summary> /// <param name="parStr"></param> void FindData(string parStr) { int varTypeFind = varWDB.FindData(parStr); Global.Log(CodeLog.Find, varTypeFind, 0, parStr); switch (varTypeFind) { case 0: //нічого не знайшли Message("Нічого не знайшли!!!"); Clear(); break; case 1: //Товар ParametersCollection varParameters = new ParametersCollection(); varParameters.Add("parDiscount", varClient.varDiscount, DbType.Int32); varDtWares = varWDB.FindWares(varParameters); int varChoiceRow; if (varDtWares.Rows.Count == 1) { varChoiceRow = 0; } else { varChoiceRow = ChoiceWares(varDtWares); } if (varChoiceRow >= 0) { varWares.SetWares(varDtWares.Rows[varChoiceRow]); NameWares.Text = varWares.varNameWares; //double varPriceDealer= Convert.ToDouble( varDtWares.Rows[varChoiceRow]["price_dealer"]); if (varWares.varPrice > 0) { if (varClient.varDiscount != 0) { GetPrice(); } else { varWares.varTypePrice = 1; } varReceipt.varSort++; if (varWares.varCodeUnit == 0) { varDtUnit = varWDB.UnitWares(varWares.varCodeWares); //DataView dv = new DataView(varDtUnit); NameUnit.DataSource = varDtUnit; NameUnit.DisplayMember = "abr_unit"; NameUnit.ValueMember = "code_unit"; NameUnit.SelectedIndex = Global.GetIndexDefaultUnit(varDtUnit); //NameUnit.DataBind(); } else // Одиниця виміру опреділена { if (varDtUnit == null) { varDtUnit = varWDB.UnitWares(123); } varDtUnit.Clear(); varDtUnit.Rows.Add(new Object[] { varWares.varCodeUnit, varWares.varAbrUnit, varWares.varCoefficient, "Y" }); } NameUnit.Enabled = (varDtUnit.Rows.Count > 1); NameUnit.Refresh(); NameUnitSelectedIndexChanged(null, null); if (Global.IsUnitMustInputQuantity(varWares.varCodeUnit)) { Quantity.DecimalPlaces = 3; Quantity.Value = 0; Quantity.Enabled = true; Quantity.Focus(); } else { Quantity.DecimalPlaces = 1; Quantity.Value = 1; Quantity.Enabled = false; //необхідно обробляти налаштування. this.AddWaresReceipt(); } //this.AddWares(); } else //Незадано продажної ціни { Message("Не задана продажна ціна"); // Clear(); } } ; break; case 2: //Клієнт SetClient(varWDB.FindClient().Rows[0]); break; } Input.Text = ""; }
public void InputOutputMoney(decimal varMoney) { Global.Log(CodeEvent.InputOutputMoney, 0, 0, varMoney.ToString()); varWDB.InputOutputMoney(varMoney); }
public void PrintPosX() { varPOS.PrintX(); Global.Log(CodeEvent.PrintBankPosX); }
public void PrintPosZ() { Global.Log(CodeEvent.PrintBankPosZ); varPOS.PrintZ(); }
public void PrintX() { varEKKA.PrintX(); Global.Log(CodeEvent.PrintX); }
public void RecalcPrice() { Global.Log(CodeEvent.RecalcPrice); }
/// <summary> /// Редагуємо кількість в довільному рядку (не зроблено) /// </summary> void EditQuantityWares() { Global.Log(CodeLog.EditQuantityWares); }
void RecalcPrice() { Global.Log(CodeLog.RecalcPrice); }
void PrintZ() { Global.Log(CodeLog.PrintZ); varEKKA.PrintZ(); }
void PrintX() { varEKKA.PrintX(); Global.Log(CodeLog.PrintX); }
public void PrintZ() { Global.Log(CodeEvent.PrintZ); varEKKA.PrintZ(); }
void InputOutputMoney() { Global.Log(CodeLog.InputOutputMoney); varWDB.InputOutputMoney(0); }