コード例 #1
0
ファイル: NET_MainForm.cs プロジェクト: OlehR/UniCS.TM
        void AddWaresReceipt()
        {
            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("parCodeWares", varWares.varCodeWares, DbType.Int32);
            varParameters.Add("parCodeUnit", varWares.varCodeUnit, DbType.Int32);
            varParameters.Add("parSort", varReceipt.varSort, DbType.Int32);
            DataTable varDt = varWDB.GetCountWares(varParameters);

            if (varDt != null && varDt.Rows.Count > 0 && Convert.ToInt32(varDt.Rows[0][1]) != varReceipt.varSort)
            {
                Quantity.Value += Convert.ToDecimal(varDt.Rows[0][0]);
            }
            QuantityValueChanged(null, null);
            varParameters.Add("parTypePrice", 0, DbType.Int32);
            varParameters.Add("parCodeWarehouse", GlobalVar.varCodeWarehouse, DbType.Int32);
            varParameters.Add("parSum", (varWares.varPrice * varWares.varQuantity) * (1 + varWares.varPercentVat) * varWares.varCoefficient, DbType.Decimal);
            varParameters.Add("parSumVat", varWares.varPrice * varWares.varQuantity * varWares.varPercentVat * varWares.varCoefficient, DbType.Decimal);
            varParameters.Add("parQuantity", varWares.varQuantity, DbType.Decimal);
            varParameters.Add("parPrice", (varWares.varPrice) * (1 + varWares.varPercentVat) * varWares.varCoefficient, DbType.Decimal);
            varParameters.Add("parParPrice1", varWares.varCodeDealer, DbType.Int32);
            varParameters.Add("parParPrice2", varWares.varTypePrice, DbType.Int32);
            varParameters.Add("parSumDiscount", varWares.varSumDiscount, DbType.Decimal);
            varParameters.Add("parTypeVat", varWares.varTypeVat, DbType.Int32);
            varParameters.Add("parUserCreate", varUser.varCodeUser, DbType.Int32);
            if (varDt != null && varDt.Rows.Count > 0)
            {
                varWDB.UpdateQuantityWares(varParameters);
            }
            else
            {
                varWDB.AddWares(varParameters);
            }

            if (GlobalVar.varRecalcPriceOnLine)
            {
                varWDB.RecalcPrice(varReceipt.varCodeReceipt);
            }
            ViewWaresReceipt();



            // add columns

            //WaresReceipt.Refresh();
            //bindingSource1.DataSource=varDtViewWaresReceipt;
            Wares.DataSource = varDtViewWaresReceipt;
            Wares.Refresh();
            Input.Focus();
            //grid1.DataBindings.Add(  bindingSource1);

            /* @parIdWorkplace, @parCodePeriod, @parCodeReceipt, @parCodeWares, @parCodeUnit,
             * @parTypePrice, @parCodeWarehouse, @parSum, @parSumVat,@parQuantity,
             * @parCodeDk, @parCodeDiscount, @parSumDiscount, @parTypeVat, @parSort,
             * @parUserCreate*/
        }
コード例 #2
0
        void ViewWaresReceipt()
        {
            DataTable varDtViewWaresReceipt = varWork.ViewWaresReceipt();

            Sum.Text = varWork.varReceipt.varSumReceipt.ToString();

            Wares.DataSource = varDtViewWaresReceipt;
            Wares.Refresh();
        }
コード例 #3
0
ファイル: NET_MainForm.cs プロジェクト: OlehR/UniCS.TM
        void ViewWaresReceipt()
        {
            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);
            varDtViewWaresReceipt = varWDB.ViewWaresReceipt(varParameters);
            object sumObject;

            sumObject = varDtViewWaresReceipt.Compute("Sum(sum)", "");

            this.varReceipt.varSumReceipt = (sumObject.ToString() != "" ?   Math.Round(Convert.ToDecimal(sumObject), 2):0.0m);
            Sum.Text         = this.varReceipt.varSumReceipt.ToString();
            Wares.DataSource = varDtViewWaresReceipt;
            Wares.Refresh();
        }
コード例 #4
0
        /// <summary>
        /// Змінює режим перегляду  в залежності від varModeInterface.
        /// </summary>
        void SetView(ModeInterface parModeInterface = ModeInterface.Default)
        {
            if (parModeInterface != ModeInterface.Default)
            {
                varModeInterface = parModeInterface;
            }
            Input.Enabled             = (varModeInterface == ModeInterface.InputData || varModeInterface == ModeInterface.RetunReceipt);
            Wares.Enabled             = (varModeInterface == ModeInterface.InputData || varModeInterface == ModeInterface.ChoiceWares || varModeInterface == ModeInterface.DeleteWares);
            PanelPrintReceipt.Visible = (varModeInterface == ModeInterface.PrintReceipt);
            if ((varModeInterface == ModeInterface.InputData))
            {
                Input.Focus();
            }
            PanelChoiceFound.Visible = (varModeInterface == ModeInterface.ChoiceWares || varModeInterface == ModeInterface.ChoiceClient);
            if ((varModeInterface == ModeInterface.ChoiceWares || varModeInterface == ModeInterface.ChoiceClient))
            {
                ChoiceFound.Focus();
            }

            PanelInputOutputMoney.Visible = (varModeInterface == ModeInterface.InputOutputMoney);
            if (varModeInterface == ModeInterface.InputOutputMoney)
            {
                InputOutputMoneySum.Focus();
            }
            if (varModeInterface == ModeInterface.DeleteWares)
            {
                Wares.Focus();
            }

            PanelMessage.Visible = (parModeInterface == ModeInterface.Message) || (parModeInterface == ModeInterface.ErrorAccess);
            if (parModeInterface == ModeInterface.Message)
            {
                PanelMessageOk.Focus();
            }

            PanelLogin.Visible = (parModeInterface == ModeInterface.Login);
            if (parModeInterface == ModeInterface.Login)
            {
                PanelLoginTextBoxLogin.Focus();
            }
        }