Ejemplo n.º 1
0
        private void tabFullReport_Enter(object sender, EventArgs e)
        {
            dtTotralForSeria = new DataTable("OperationApplyTable");
            DataColumn ProfCode                = new DataColumn("ProfCode", typeof(int));
            DataColumn NameKindWork            = new DataColumn("NameKindWork", typeof(string));
            DataColumn KindPayColumn           = new DataColumn("KindPay", typeof(string));
            DataColumn WorkerRateColumn        = new DataColumn("WorkerRate", typeof(double));
            DataColumn ItemCTNColumn           = new DataColumn("ItemCTN", typeof(decimal));
            DataColumn PreparTimeCTNColumn     = new DataColumn("PreparTimeCTN", typeof(decimal));
            DataColumn ItemPayNormColumn       = new DataColumn("ItemPayNorm", typeof(decimal));
            DataColumn PreparTimePayNormColumn = new DataColumn("PreparTimePayNorm", typeof(decimal));
            DataColumn ValuationColumn         = new DataColumn("Valuation", typeof(double));
            DataColumn ValPreparTimeColumn     = new DataColumn("ValPreparTime", typeof(double));

            dtTotralForSeria.Columns.AddRange(new DataColumn[] {
                ProfCode, NameKindWork, KindPayColumn, WorkerRateColumn, ItemCTNColumn,
                PreparTimeCTNColumn, ItemPayNormColumn, PreparTimePayNormColumn, ValuationColumn, ValPreparTimeColumn
            });

            LinqQueryForTrudoyomkost.GetTotalCalculNormReport(_seriaFrom, _selectProdCipher, ref dtTotralForSeria);
            dgTotalNormCalc.DataSource = dtTotralForSeria;
            UserDataTables.SetDgColumns(dgTotalNormCalc);
            label31.Text = lbProduct.Text;
            label30.Text = vtbSeriaFrom.ValueTxt;
        }
Ejemplo n.º 2
0
        private void InitializeFormElemets()
        {
            UserDataTables.CreatetbWhereUse(ref _dtWhereUse);

            dgWhereUse.DataSource            = _dtWhereUse;
            dgWhereUse.Columns[0].HeaderText = "Серия С -КТС";
            dgWhereUse.Columns[1].HeaderText = "Серия По -КТС";
            dgWhereUse.Columns[2].HeaderText = "Изделие";
            dgWhereUse.Columns[3].HeaderText = "Кол-во";
            dgWhereUse.Columns[4].Visible    = false;
            dgWhereUse.Columns[5].Visible    = false;
            dgWhereUse.Columns[6].Visible    = false;

            tbRoundNum.Text        = TrudoyomkostSettings.RoundNum.ToString();
            tbDepNum.Text          = TrudoyomkostSettings.DepNum.ToString();
            dgProfesion.DataSource = _dtInfProf;
            AutoCompaleTextBox();
            vtbSeriaFrom.StringAutoCorrectionMethod = VtboxMethods.correctForInt;
            vtbSeriaFrom.ValidateValue            = VtboxMethods.CheckSeria;
            vtbSeriaTo.StringAutoCorrectionMethod = VtboxMethods.correctForInt;
            vtbSeriaTo.ValidateValue = VtboxMethods.CheckSeria;
            vtbProfCode.StringAutoCorrectionMethod = VtboxMethods.correctForInt;
            vtbProfCode.ValidateValue = VtboxMethods.checkForInt;

            dgProfesion.Columns[0].Width   = 50;
            dgProfesion.Columns[1].Width   = 160;
            dgProfesion.Columns[2].Width   = 160;
            dgProfesion.Columns[3].Visible = false;
        }
Ejemplo n.º 3
0
        private void tabNormView_Enter(object sender, EventArgs e)
        {
            _allLabourNormForSeries = LinqQueryForTrudoyomkost.GetAllLabourNormForSeria(_seriaFrom, _seriaTo, _selectProdCipher);


            dgLabourViewer.DataSource = _allLabourNormForSeries;
            if (dgLabourViewer.Columns.Count != 0)
            {
                UserDataTables.SetDgColumns(dgLabourViewer);
            }
        }
Ejemplo n.º 4
0
 public void InitializeFormFields(DataGridView inputdg)
 {
     _infDetIdList = new List <int>();
     foreach (DataGridViewRow row in inputdg.Rows)
     {
         _infDetIdList.Add((int)row.Cells[0].Value);
     }
     vtbSeriaFrom.StringAutoCorrectionMethod = VtboxMethods.correctForInt;
     vtbSeriaFrom.ValidateValue            = VtboxMethods.CheckSeria;
     vtbSeriaTo.StringAutoCorrectionMethod = VtboxMethods.correctForInt;
     vtbSeriaTo.ValidateValue  = VtboxMethods.CheckSeria;
     vtbProdName.ValidateValue = VtboxMethods.CheckProdNume;
     vtbProdName.StringAutoCorrectionMethod  = VtboxMethods.correctForInt;
     vtbLowerCoff.StringAutoCorrectionMethod = VtboxMethods.correctForDouble;
     vtbLowerCoff.ValidateValue = VtboxMethods.checkForDouble;
     vtbLowerCoff.ValueTxt      = "0";
     _dtOperApply           = UserDataTables.CreateOperAppDt();
     dgOperApply.DataSource = _dtOperApply;
     chBoxWithoutNew_CheckedChanged(chBoxWithoutNew, new EventArgs());
 }
Ejemplo n.º 5
0
 public fmOperationViewer(fmNormsViewer parentForm)
 {
     templabour.TariffNetNum = Properties.Settings.Default.TariffNetNum; //сдесь ставится тариф(наверное)
     _parentForm             = parentForm;
     IsNewItem           = true;
     _timeInHour         = parentForm.TimeInHour;
     templabour.InfDetID = parentForm.InfDetID;
     _countPerProduct    = parentForm.CountPerProduct;
     _dcInfProducts      = parentForm.DcInfProducts;
     InitializeComponent();
     _dtOperApply           = UserDataTables.CreateOperAppDt();
     dgOperApply.DataSource = _dtOperApply;
     InitializeFormElement();
     btUpdateForm.Enabled      = false;
     btSaveAndLimit.Enabled    = false;
     btLimitedOper.Visible     = false;
     btNext.Enabled            = false;
     btPrev.Enabled            = false;
     vtbTaskNum.ValueTxt       = "";
     vtbItemCTN.ValueTxt       = "0";
     vtbPreparTimeCTN.ValueTxt = "0";
     cbKindPay.SelectedIndex   = 0; //Вид оплаты, сдельно или повременно
 }
Ejemplo n.º 6
0
        private void btAddOper_Click(object sender, EventArgs e)
        {
            if (!vtbProdName.IsValid || !vtbSeriaFrom.IsValid || !vtbSeriaTo.IsValid)
            {
                return;
            }
            if (!FillTrudoyomkostDB.DcMaxApply.ContainsKey(vtbProdName.ValueTxt))
            {
                return;
            }

            int   SeriaFrom  = MathFunctionForSeries.GetIntSeriaNumber(vtbSeriaFrom.ValueTxt);
            int   SeriaTo    = MathFunctionForSeries.GetIntSeriaNumber(vtbSeriaTo.ValueTxt);
            short prodCipher = FillTrudoyomkostDB.DcInfProducts[vtbProdName.ValueTxt];

            if (SeriaFrom > SeriaTo)
            {
                return;
            }

            bool IsDublProdName = false;

            foreach (DataGridViewRow itemRow in dgOperApply.Rows)
            {
                if (itemRow.Cells[0].Value.ToString().Equals(vtbProdName.ValueTxt))
                {
                    IsDublProdName = true;
                }
            }

            if (!IsDublProdName)
            {
                UserDataTables.AddRowToApplyDt(vtbProdName.ValueTxt, vtbSeriaFrom.ValueTxt, vtbSeriaTo.ValueTxt, _dtOperApply);
                _applyWhereOper                    = new WhereOperationUse();
                _applyWhereOper.SeriaFrom          = SeriaFrom;
                _applyWhereOper.SeriaTo            = SeriaTo;
                _applyWhereOper.InfProductsChipher = prodCipher;
                if (_isUpdate)
                {
                    currentExecutedComand = new UpdateLabourCard(_infDetIdList, _applyWhereOper);
                }
                else
                {
                    UpdateAndCreateNewLabourCard tempComand;
                    if (currentExecutedComand == null)
                    {
                        currentExecutedComand = new UpdateAndCreateNewLabourCard(_infDetIdList, _applyWhereOper);
                        tempComand            = currentExecutedComand as UpdateAndCreateNewLabourCard;
                        if (vtbLowerCoff.IsValid)
                        {
                            tempComand.ApplyCoeff = double.Parse(vtbLowerCoff.ValueTxt);
                        }
                    }
                    else
                    {
                        tempComand = currentExecutedComand as UpdateAndCreateNewLabourCard;
                        if (tempComand != null)
                        {
                            tempComand.ApplyWhereOpers = _applyWhereOper;
                        }
                    }
                }
                currentExecutedComand.execute();
                _fmParent.UpdateDataGrids();
            }
        }