Beispiel #1
0
        private void Button4_Click(System.Object sender, System.EventArgs e)
        {
            if (dgMaterial.VisibleRowCount > 0)
            {
                frmInputMaterialQty frmimqty = new frmInputMaterialQty();
                frmimqty.Label1.Text = dgMaterial[dgMaterial.CurrentRowIndex, 1].ToString();
                frmimqty.Label5.Text = dgMaterial[dgMaterial.CurrentRowIndex, 3].ToString();

                switch (BillTypeCode)
                {
                case "A":
                case "B":
                case "F":
                case "G":
                case "H":
                case "M":
                    frmimqty.NumericUpDown2.Enabled = false;
                    frmimqty.NumericUpDown3.Enabled = false;

                    frmimqty.NumericUpDown2.Text = rms_var.GetCurrMonthMtrlPrice(dgMaterial[dgMaterial.CurrentRowIndex, 0].ToString());
                    frmimqty.ShowDialog();
                    if (frmimqty.DialogResult == DialogResult.OK)
                    {
                        AddMaterials(dgMaterial[dgMaterial.CurrentRowIndex, 0].ToString(), dgMaterial[dgMaterial.CurrentRowIndex, 1].ToString(), dgMaterial[dgMaterial.CurrentRowIndex, 3].ToString(), frmimqty.NumericUpDown1.Text, frmimqty.NumericUpDown2.Text, System.Convert.ToString(frmimqty.NumericUpDown2.Value * frmimqty.NumericUpDown1.Value));
                        RefreshTotalPrice();
                    }
                    break;

                case "I":
                case "D":
                    if (rms_var.GetSysSetup("showlastprice") == "1")
                    {
                        frmimqty.NumericUpDown2.Text = rms_var.GetCurrMonthMtrlPrice(dgMaterial[dgMaterial.CurrentRowIndex, 0].ToString());
                    }
                    frmimqty.ShowDialog();
                    if (frmimqty.DialogResult == DialogResult.OK)
                    {
                        AddMaterials(dgMaterial[dgMaterial.CurrentRowIndex, 0].ToString(), dgMaterial[dgMaterial.CurrentRowIndex, 1].ToString(), dgMaterial[dgMaterial.CurrentRowIndex, 3].ToString(), frmimqty.NumericUpDown1.Text, frmimqty.NumericUpDown2.Text, System.Convert.ToString(frmimqty.NumericUpDown2.Value * frmimqty.NumericUpDown1.Value));
                        RefreshTotalPrice();
                    }
                    break;
                }
            }
        }
Beispiel #2
0
        private void Button4_Click(System.Object sender, System.EventArgs e)
        {
            if (dgMaterial.VisibleRowCount > 0)
            {
                frmInputMaterialQty frmimqty = new frmInputMaterialQty();
                frmimqty.Label1.Text = dgMaterial[dgMaterial.CurrentRowIndex, 1].ToString();
                frmimqty.Label5.Text = dgMaterial[dgMaterial.CurrentRowIndex, 3].ToString();

                switch (BillTypeCode)
                {
                    case "A":
                    case "B":
                    case "F":
                    case "G":
                    case "H":
                    case "M":
                        frmimqty.NumericUpDown2.Enabled = false;
                        frmimqty.NumericUpDown3.Enabled = false;

                        frmimqty.NumericUpDown2.Text = rms_var.GetCurrMonthMtrlPrice(dgMaterial[dgMaterial.CurrentRowIndex, 0].ToString());
                        frmimqty.ShowDialog();
                        if (frmimqty.DialogResult == DialogResult.OK)
                        {
                            AddMaterials(dgMaterial[dgMaterial.CurrentRowIndex, 0].ToString(), dgMaterial[dgMaterial.CurrentRowIndex, 1].ToString(), dgMaterial[dgMaterial.CurrentRowIndex, 3].ToString(), frmimqty.NumericUpDown1.Text, frmimqty.NumericUpDown2.Text, System.Convert.ToString(frmimqty.NumericUpDown2.Value * frmimqty.NumericUpDown1.Value));
                            RefreshTotalPrice();
                        }
                        break;
                    case "I":
                    case "D":
                        if (rms_var.GetSysSetup("showlastprice") == "1")
                        {
                            frmimqty.NumericUpDown2.Text = rms_var.GetCurrMonthMtrlPrice(dgMaterial[dgMaterial.CurrentRowIndex, 0].ToString());
                        }
                        frmimqty.ShowDialog();
                        if (frmimqty.DialogResult == DialogResult.OK)
                        {
                            AddMaterials(dgMaterial[dgMaterial.CurrentRowIndex, 0].ToString(), dgMaterial[dgMaterial.CurrentRowIndex, 1].ToString(), dgMaterial[dgMaterial.CurrentRowIndex, 3].ToString(), frmimqty.NumericUpDown1.Text, frmimqty.NumericUpDown2.Text, System.Convert.ToString(frmimqty.NumericUpDown2.Value * frmimqty.NumericUpDown1.Value));
                            RefreshTotalPrice();
                        }
                        break;
                }

            }
        }