bool KeyProcedureMainInput(Keys parKeys, int parOption = 0) { int varKeys = (int)parKeys; if (MainInputKeyMap.ClearInfoWares == varKeys) { ClearInfoWares(); } else if (MainInputKeyMap.IncrementWares == varKeys && parOption != 1 && Global.GetTypeAccess(CodeEvent.IncrementWares) == TypeAccess.Yes) { IncrementWares(); } else if (MainInputKeyMap.DecrementWares == varKeys && parOption != 1 && Global.GetTypeAccess(CodeEvent.DecrementWares) == TypeAccess.Yes) { DecrementWares(); } else if (MainInputKeyMap.PrintReceipt_Cash == varKeys) { PrintReceipt(TypePay.Cash); } else if (MainInputKeyMap.PrintReceipt_Pos == varKeys) { PrintReceipt(TypePay.Pos); } else if (MainInputKeyMap.PrintReceipt_NonCash == varKeys) { PrintReceipt(TypePay.NonCash); } else if (MainInputKeyMap.AddWaresReceipt == varKeys && parOption == 1) { AddWaresReceipt(); } else if (MainInputKeyMap.DeleteWaresReceipt_Current == varKeys) { DeleteWaresReceipt(TypeDeleteWaresReceipt.Current); } else if (MainInputKeyMap.DeleteWaresReceipt_All == varKeys) { DeleteWaresReceipt(TypeDeleteWaresReceipt.All); } else if (MainInputKeyMap.DeleteWaresReceipt_Choice == varKeys) { DeleteWaresReceipt(TypeDeleteWaresReceipt.Choice); } else if (MainInputKeyMap.EditQuantityWares == varKeys) { EditQuantityWares(); } else if (MainInputKeyMap.ChangeCurrentReceipt == varKeys) { ChangeCurrentReceipt(); } else if (MainInputKeyMap.NewReceipt == varKeys) { NewReceipt(); } else if (MainInputKeyMap.RecalcPrice == varKeys) { varWork.RecalcPrice(); } else if (MainInputKeyMap.Help == varKeys) { Help(); } else if (MainInputKeyMap.PrintZ == varKeys) { varWork.PrintZ(); } else if (MainInputKeyMap.PrintX == varKeys) { varWork.PrintX(); } else if (MainInputKeyMap.CountCash == varKeys) { CountCash(); } else if (MainInputKeyMap.UpdateData == varKeys) { varWork.UpdateData(); } else if (MainInputKeyMap.PrintPosX == varKeys) { varWork.PrintPosX(); } else if (MainInputKeyMap.PrintPosZ == varKeys) { varWork.PrintPosZ(); } else if (MainInputKeyMap.InputOutputMoney == varKeys) { InputOutputMoney(); } else if (MainInputKeyMap.ReturnLastReceipt == varKeys) { ReturnLastReceipt(); } else if (MainInputKeyMap.ReturnOtherWorkplace == varKeys) { ReturnOtherWorkplace(); } else if (MainInputKeyMap.ReturnReceipt == varKeys) { ReturnReceipt(); } else if (MainInputKeyMap.ReturnAnyReceipt == varKeys) { ReturnAnyReceipt(); } else { return(false); } return(true); }
void EditQuantity() { NameWares.Text = varWork.varWares.varNameWares; //double varPriceDealer= Convert.ToDouble( varDtWares.Rows[varChoiceRow]["price_dealer"]); if (varWork.varWares.varPrice > 0) { if (varWork.varClient.varDiscount != 0) { varWork.GetPrice(); } else { varWork.varWares.varTypePrice = 1; } varWork.varReceipt.varSort++; if (varWork.varWares.varCodeUnit == 0) { varDtUnit = varWork.varWDB.UnitWares(varWork.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 = varWork.varWDB.UnitWares(123); } varDtUnit.Clear(); varDtUnit.Rows.Add(new Object[] { varWork.varWares.varCodeUnit, varWork.varWares.varAbrUnit, varWork.varWares.varCoefficient, "Y" }); } NameUnit.Enabled = (varDtUnit.Rows.Count > 1); NameUnit.Refresh(); NameUnitSelectedIndexChanged(null, null); if (Global.IsUnitMustInputQuantity(varWork.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(); } }