示例#1
0
 void IncrementWares()
 {
     Quantity.Value++;
     QuantityValueChanged(null, null);
     this.AddWaresReceipt();
     Global.Log(CodeEvent.IncrementWares);
 }
示例#2
0
文件: Work.cs 项目: OlehR/UniCS.TM
        /// <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);
        }
示例#3
0
        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);
        }
示例#4
0
 void DecrementWares()
 {
     if (Quantity.Value > 0)
     {
         Quantity.Value--;
     }
     QuantityValueChanged(null, null);
     this.AddWaresReceipt();
     Global.Log(CodeEvent.DecrementWares);
 }
示例#5
0
文件: Work.cs 项目: OlehR/UniCS.TM
        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);
        }
示例#6
0
        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);
        }
示例#7
0
文件: Work.cs 项目: OlehR/UniCS.TM
        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);
            }
        }
示例#8
0
        /// <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 = "";
        }
示例#9
0
文件: Work.cs 项目: OlehR/UniCS.TM
        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);
        }
示例#10
0
        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();             //Відкримаємо новий чек.
        }
示例#11
0
文件: Work.cs 项目: OlehR/UniCS.TM
        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());
        }
示例#12
0
        /// <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 = "";
        }
示例#13
0
文件: Work.cs 项目: OlehR/UniCS.TM
 public void InputOutputMoney(decimal varMoney)
 {
     Global.Log(CodeEvent.InputOutputMoney, 0, 0, varMoney.ToString());
     varWDB.InputOutputMoney(varMoney);
 }
示例#14
0
文件: Work.cs 项目: OlehR/UniCS.TM
 public void PrintPosX()
 {
     varPOS.PrintX();
     Global.Log(CodeEvent.PrintBankPosX);
 }
示例#15
0
文件: Work.cs 项目: OlehR/UniCS.TM
 public void PrintPosZ()
 {
     Global.Log(CodeEvent.PrintBankPosZ);
     varPOS.PrintZ();
 }
示例#16
0
文件: Work.cs 项目: OlehR/UniCS.TM
 public void PrintX()
 {
     varEKKA.PrintX();
     Global.Log(CodeEvent.PrintX);
 }
示例#17
0
文件: Work.cs 项目: OlehR/UniCS.TM
 public void RecalcPrice()
 {
     Global.Log(CodeEvent.RecalcPrice);
 }
示例#18
0
 /// <summary>
 /// Редагуємо кількість в довільному рядку (не зроблено)
 /// </summary>
 void EditQuantityWares()
 {
     Global.Log(CodeLog.EditQuantityWares);
 }
示例#19
0
 void RecalcPrice()
 {
     Global.Log(CodeLog.RecalcPrice);
 }
示例#20
0
 void PrintZ()
 {
     Global.Log(CodeLog.PrintZ);
     varEKKA.PrintZ();
 }
示例#21
0
 void PrintX()
 {
     varEKKA.PrintX();
     Global.Log(CodeLog.PrintX);
 }
示例#22
0
文件: Work.cs 项目: OlehR/UniCS.TM
 public void PrintZ()
 {
     Global.Log(CodeEvent.PrintZ);
     varEKKA.PrintZ();
 }
示例#23
0
 void InputOutputMoney()
 {
     Global.Log(CodeLog.InputOutputMoney);
     varWDB.InputOutputMoney(0);
 }