Пример #1
0
        protected void btnSaveAdjustmentLess_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtQuantityLess.Text) || txtQuantityLess.Text == "0")
            {
                lblErrorText.Text = "Invalid Quantity value!";
                hfCustomerNumber_ModalPopupExtender.Show();
                return;
            }
            MonthlyAdjustment adj;

            foreach (GridViewRow row in this.gvAdjustmentLess.Rows)
            {
                adj = new MonthlyAdjustment
                {
                    Type     = row.Cells[0].Text,
                    Quantity = long.Parse(row.Cells[1].Text)
                };
                ADJUSTMENT_LESS.Add(adj);
            }
            adj = new MonthlyAdjustment
            {
                Type     = DDLParticularsLess.SelectedValue,
                Quantity = long.Parse(txtQuantityLess.Text)
            };
            ADJUSTMENT_LESS.Add(adj);
            gvAdjustmentLess.DataSource = ADJUSTMENT_LESS;
            gvAdjustmentLess.DataBind();

            PreviewLessAdjustments();
            txtAdjustmentLess.Text      = (long.Parse(txtAdjustmentLess.Text) + long.Parse(txtQuantityLess.Text)).ToString();
            txtQuantityLess.Text        = "0";
            txtEndingInventoryAsOf.Text = EndingInventory().ToString();
        }
Пример #2
0
        /// <summary>
        /// Reset Less Adjustment
        /// </summary>
        /// <param name="Type">Type Of Less Adjustment</param>
        private void ResetLessAdjustments(string Type)
        {
            MonthlyAdjustment adj;

            foreach (GridViewRow row in this.gvAdjustmentLess.Rows)
            {
                if (row.Cells[0].Text != Type)
                {
                    adj = new MonthlyAdjustment
                    {
                        Type     = row.Cells[0].Text,
                        Quantity = long.Parse(row.Cells[1].Text)
                    };
                    ADJUSTMENT_LESS.Add(adj);
                }
            }
            gvAdjustmentLess.DataSource = ADJUSTMENT_LESS;
            gvAdjustmentLess.DataBind();
        }