private void dgvReceive_DoubleClick(object sender, EventArgs e)
 {
     if (String.IsNullOrEmpty(dgvReceive.CurrentRow.Cells[8].Value.ToString()) || dgvReceive.CurrentRow.Cells[8].Value == null)
     {
         Dialog.frmDialogSelectTypeWeight FrmDialogSelectTypeWeight = new Dialog.frmDialogSelectTypeWeight();
         FrmDialogSelectTypeWeight.ShowDialog();
         if (FrmDialogSelectTypeWeight.DialogResult == DialogResult.Yes)
         {
             checkType(FrmDialogSelectTypeWeight.GetTypeL());
         }
     }
     else
     {
         checkType(dgvReceive.CurrentRow.Cells[8].Value.ToString());
     }
 }
 private void dgvProduct_DoubleClick(object sender, EventArgs e)
 {
     if (String.IsNullOrEmpty(dgvProduct.CurrentRow.Cells["Type"].Value.ToString()) || dgvProduct.CurrentRow.Cells["Type"].Value == null)
     {
         Dialog.frmDialogSelectTypeWeight FrmDialogSelectTypeWeight = new Dialog.frmDialogSelectTypeWeight();//เรียก Dialog เลือกประเภทน้ำหนัก
         FrmDialogSelectTypeWeight.ShowDialog();
         if (FrmDialogSelectTypeWeight.DialogResult == DialogResult.Yes)
         {
             checkType(FrmDialogSelectTypeWeight.GetTypeL());
         }
     }
     else
     {
         checkType(dgvProduct.CurrentRow.Cells["Type"].Value.ToString());
     }
     sumcost();
 }
        private void dataGridView2_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < 0) return;

            Dialog.frmDialogSelectTypeWeight FrmDialogSelectTypeWeight = new Dialog.frmDialogSelectTypeWeight();
            FrmDialogSelectTypeWeight.ShowDialog();
            if (FrmDialogSelectTypeWeight.DialogResult == DialogResult.Yes)
            {
                checkType(FrmDialogSelectTypeWeight.GetTypeL());
            }
        }
Exemple #4
0
 private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     //MessageBox.Show(dataGridView1.CurrentRow.Cells[8].Value.ToString());
     if (String.IsNullOrEmpty(dataGridView1.Rows[e.RowIndex].Cells[17].Value.ToString()) || dataGridView1.Rows[e.RowIndex].Cells[17].Value == null)
     {
         Dialog.frmDialogSelectTypeWeight FrmDialogSelectTypeWeight = new Dialog.frmDialogSelectTypeWeight();
         FrmDialogSelectTypeWeight.ShowDialog();
         if (FrmDialogSelectTypeWeight.DialogResult == DialogResult.Yes)
         {
             checkType(FrmDialogSelectTypeWeight.GetTypeL(), dataGridView1.Rows[e.RowIndex].DefaultCellStyle.BackColor,
                 dataGridView1.Rows[e.RowIndex].Cells[7].Value.ToString(), "", "", "", "", "");
         }
     }
     else
     {
         if (dataGridView1.Rows[e.RowIndex].Cells[19].Value == null) { dataGridView1.Rows[e.RowIndex].Cells[19].Value = ""; return; }
         checkType(dataGridView1.Rows[e.RowIndex].Cells[17].Value.ToString(), dataGridView1.Rows[e.RowIndex].DefaultCellStyle.BackColor,
             dataGridView1.Rows[e.RowIndex].Cells[7].Value.ToString()
             , dataGridView1.Rows[e.RowIndex].Cells[10].Value.ToString(), dataGridView1.Rows[e.RowIndex].Cells[11].Value.ToString(),
             dataGridView1.Rows[e.RowIndex].Cells[2].Value.ToString()
             , dataGridView1.Rows[e.RowIndex].Cells[4].Value.ToString(), dataGridView1.Rows[e.RowIndex].Cells[19].Value.ToString());
     }
 }
Exemple #5
0
 private void dgvDetail_DoubleClick(object sender, EventArgs e)
 {
     if (dgvDetail.CurrentRow.Cells[13].Value == null)
     {
         Dialog.frmDialogSelectTypeWeight FrmDialogSelectTypeWeight = new Dialog.frmDialogSelectTypeWeight();
         FrmDialogSelectTypeWeight.ShowDialog();
         if (FrmDialogSelectTypeWeight.DialogResult == DialogResult.Yes)
         {
             checkType(FrmDialogSelectTypeWeight.GetTypeL(), dgvDetail.CurrentRow.Cells[8].Value.ToString(), "", "", "", "", "");
         }
     }
     else
     {
         checkType(dgvDetail.CurrentRow.Cells[13].Value.ToString(), dgvDetail.CurrentRow.Cells[8].Value.ToString(), dgvDetail.CurrentRow.Cells[10].Value.ToString(),
             dgvDetail.CurrentRow.Cells[11].Value.ToString(), dgvDetail.CurrentRow.Cells[2].Value.ToString(), dgvDetail.CurrentRow.Cells[4].Value.ToString(),
                   "");
     }
 }
 private void gvProducts_DoubleClick(object sender, EventArgs e)
 {
     if (String.IsNullOrEmpty(gvProducts.CurrentRow.Cells[13].Value.ToString()) || gvProducts.CurrentRow.Cells[13].Value == null)
     {
         Dialog.frmDialogSelectTypeWeight FrmDialogSelectTypeWeight = new Dialog.frmDialogSelectTypeWeight();
         FrmDialogSelectTypeWeight.ShowDialog();
         if (FrmDialogSelectTypeWeight.DialogResult == DialogResult.Yes)
         {
             checkType(FrmDialogSelectTypeWeight.GetTypeL(), gvProducts.CurrentRow.Cells[8].Value.ToString(), "", "", "", "");
         }
     }
     else
     {
         checkType(gvProducts.CurrentRow.Cells[13].Value.ToString(), gvProducts.CurrentRow.Cells[8].Value.ToString(), gvProducts.CurrentRow.Cells[10].Value.ToString(),
             gvProducts.CurrentRow.Cells[11].Value.ToString(), gvProducts.CurrentRow.Cells[2].Value.ToString(), gvProducts.CurrentRow.Cells[4].Value.ToString());
     }
 }
 private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     String strProductId = dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString();
     String strQMax = getQuantityMax(strProductId);
     //MessageBox.Show(dataGridView1.CurrentRow.Cells[8].Value.ToString());
     if (String.IsNullOrEmpty(dataGridView1.Rows[e.RowIndex].Cells[18].Value.ToString()) || dataGridView1.Rows[e.RowIndex].Cells[18].Value == null)
     {
         Dialog.frmDialogSelectTypeWeight FrmDialogSelectTypeWeight = new Dialog.frmDialogSelectTypeWeight();
         FrmDialogSelectTypeWeight.ShowDialog();
         if (FrmDialogSelectTypeWeight.DialogResult == DialogResult.Yes)
         {
             checkType(FrmDialogSelectTypeWeight.GetTypeL(), dataGridView1.Rows[e.RowIndex].DefaultCellStyle.BackColor,
                 dataGridView1.Rows[e.RowIndex].Cells[8].Value.ToString(), dataGridView1.Rows[e.RowIndex].Cells[11].Value.ToString(),
                 "", dataGridView1.Rows[e.RowIndex].Cells[3].Value.ToString(),
                 dataGridView1.Rows[e.RowIndex].Cells[5].Value.ToString(), dataGridView1.Rows[e.RowIndex].Cells[19].Value.ToString(),
                 comboBox5.Text, strQMax);
         }
         //checkType("1", dataGridView1.Rows[e.RowIndex].DefaultCellStyle.BackColor,
         //        dataGridView1.Rows[e.RowIndex].Cells[8].Value.ToString(), "", "", "", "", "", comboBox5.Text,"");
     }
     else
     {
         if (dataGridView1.Rows[e.RowIndex].Cells[21].Value == null) { dataGridView1.Rows[e.RowIndex].Cells[21].Value = ""; return; }
             checkType(dataGridView1.Rows[e.RowIndex].Cells[18].Value.ToString(), dataGridView1.Rows[e.RowIndex].DefaultCellStyle.BackColor,
             dataGridView1.Rows[e.RowIndex].Cells[8].Value.ToString() , dataGridView1.Rows[e.RowIndex].Cells[11].Value.ToString(), 
             dataGridView1.Rows[e.RowIndex].Cells[12].Value.ToString(),dataGridView1.Rows[e.RowIndex].Cells[3].Value.ToString() , 
             dataGridView1.Rows[e.RowIndex].Cells[5].Value.ToString(), dataGridView1.Rows[e.RowIndex].Cells[19].Value.ToString(),
             comboBox5.Text, strQMax);
     }
 }
Exemple #8
0
        private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            /*เลือกใบขาย เพื่อแก้ไขรายการ*/

            if (String.IsNullOrEmpty(dataGridView1.Rows[e.RowIndex].Cells[18].Value.ToString()) || dataGridView1.Rows[e.RowIndex].Cells[18].Value == null)
            {
                Dialog.frmDialogSelectTypeWeight FrmDialogSelectTypeWeight = new Dialog.frmDialogSelectTypeWeight();
                FrmDialogSelectTypeWeight.ShowDialog();
                if (FrmDialogSelectTypeWeight.DialogResult == DialogResult.Yes)
                {
                    checkType(FrmDialogSelectTypeWeight.GetTypeL(), dataGridView1.Rows[e.RowIndex].DefaultCellStyle.BackColor,
                        dataGridView1.Rows[e.RowIndex].Cells[8].Value.ToString(), "", "", "", "");
                }
            }
            else
            {
                if (dataGridView1.Rows[e.RowIndex].Cells[18].Value.ToString() == "0")
                {
                    Dialog.frmDialogSelectTypeWeight FrmDialogSelectTypeWeight = new Dialog.frmDialogSelectTypeWeight();
                    FrmDialogSelectTypeWeight.ShowDialog();
                    if (FrmDialogSelectTypeWeight.DialogResult == DialogResult.Yes)
                    {
                        checkType(FrmDialogSelectTypeWeight.GetTypeL(), dataGridView1.Rows[e.RowIndex].DefaultCellStyle.BackColor,
                            dataGridView1.Rows[e.RowIndex].Cells[8].Value.ToString(), "", "", "", "");
                    }
                }
                checkType(dataGridView1.Rows[e.RowIndex].Cells[18].Value.ToString(), dataGridView1.Rows[e.RowIndex].DefaultCellStyle.BackColor,
                    dataGridView1.Rows[e.RowIndex].Cells[8].Value.ToString()
                    , dataGridView1.Rows[e.RowIndex].Cells[11].Value.ToString(), dataGridView1.Rows[e.RowIndex].Cells[12].Value.ToString(),
                    dataGridView1.Rows[e.RowIndex].Cells[3].Value.ToString()
                    , dataGridView1.Rows[e.RowIndex].Cells[5].Value.ToString());//เรียกใช้ฟังก์ชันตรวจสอบประเภทน้ำหนักสินค้า
            }
            //ProductReverseUpdate(e.RowIndex);
        }
Exemple #9
0
 /*เรียก Dialog เลือกประเภทของน้ำหนัก*/
 private void DgvProduct_CellDoubleClick_1(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex < 0) return;
     if (DgvProduct.Columns[e.ColumnIndex].Name == "Quantity")
     {
         Dialog.frmDialogSelectTypeWeight FrmDialogSelectTypeWeight = new Dialog.frmDialogSelectTypeWeight();
         FrmDialogSelectTypeWeight.ShowDialog();
         if (FrmDialogSelectTypeWeight.DialogResult == System.Windows.Forms.DialogResult.Yes)
         {
             string type = FrmDialogSelectTypeWeight.GetTypeL();
             CheckType(type, e.RowIndex);
         }
     }
 }
 private void dgvMetLost_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     if (String.IsNullOrEmpty(dgvMetLost.CurrentRow.Cells["Type"].Value.IsNullAsEmpty()) || dgvMetLost.CurrentRow.Cells["Type"].Value == null)
     {
         Dialog.frmDialogSelectTypeWeight FrmDialogSelectTypeWeight = new Dialog.frmDialogSelectTypeWeight();//เรียกใช้ Dailog เลือกประเภทน้ำหนัก
         FrmDialogSelectTypeWeight.ShowDialog();
         if (FrmDialogSelectTypeWeight.DialogResult == DialogResult.Yes)
         {
             checkTypeFail(FrmDialogSelectTypeWeight.GetTypeL(), dgvMetLost, "");//ตรวจสอบประเภทรายละเอียดสินค้ากรณีมีข้อมูลน้ำหนักแล้ว
         }
         //checkTypeFail("2", dgvMetLost, "");//ตรวจสอบประเภทรายละเอียดสินค้ากรณีมีข้อมูลน้ำหนักแล้ว
     }
     else
     {
         checkTypeFail(dgvMetLost.CurrentRow.Cells["Type"].Value.IsNullAsEmpty(), dgvMetLost, dgvMetLost.CurrentRow.Cells["NetFId"].Value.IsNullAsEmpty());//ตรวจสอบประเภทรายละเอียดสินค้ากรณีไม่มีข้อมูลน้ำหนัก
     }
     //if (dgvMetLost.CurrentRow.Cells["Quantity"].Value.IsNullAsEmpty() == "") { return; }
     //double reqty = Convert.ToDouble(dgvMetLost.CurrentRow.Cells["Quantity"].Value.IsNullAsEmpty());
     //double qty = Convert.ToDouble(dataGridView1.CurrentRow.Cells["Mquantity"].Value.IsNullAsEmpty());
 }
Exemple #11
0
 private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     if (String.IsNullOrEmpty(dataGridView1.Rows[e.RowIndex].Cells[19].Value.ToString()) || dataGridView1.Rows[e.RowIndex].Cells[19].Value == null)
     {
         Dialog.frmDialogSelectTypeWeight FrmDialogSelectTypeWeight = new Dialog.frmDialogSelectTypeWeight();
         FrmDialogSelectTypeWeight.ShowDialog();
         if (FrmDialogSelectTypeWeight.DialogResult == DialogResult.Yes)
         {
             checkType(FrmDialogSelectTypeWeight.GetTypeL(), dataGridView1.Rows[e.RowIndex].DefaultCellStyle.BackColor,
                 dataGridView1.Rows[e.RowIndex].Cells[9].Value.ToString(), "", "", "", "", "",comboBox5 .Text ,"");
         }
     }
     else
     {
         if (dataGridView1.Rows[e.RowIndex].Cells[19].Value.ToString() == "0")
         {
             Dialog.frmDialogSelectTypeWeight FrmDialogSelectTypeWeight = new Dialog.frmDialogSelectTypeWeight();
             FrmDialogSelectTypeWeight.ShowDialog();
             if (FrmDialogSelectTypeWeight.DialogResult == DialogResult.Yes)
             {
                 checkType(FrmDialogSelectTypeWeight.GetTypeL(), dataGridView1.Rows[e.RowIndex].DefaultCellStyle.BackColor,
                     dataGridView1.Rows[e.RowIndex].Cells[9].Value.ToString(), "", "", "", "", "", comboBox5.Text, "");
             }
         }
         else
         {
             if (dataGridView1.Rows[e.RowIndex].Cells[22].Value == null) { dataGridView1.Rows[e.RowIndex].Cells[22].Value = ""; }
             checkType(dataGridView1.Rows[e.RowIndex].Cells[19].Value.ToString(), dataGridView1.Rows[e.RowIndex].DefaultCellStyle.BackColor,
                 dataGridView1.Rows[e.RowIndex].Cells[9].Value.ToString()
                 , dataGridView1.Rows[e.RowIndex].Cells[12].Value.ToString(), dataGridView1.Rows[e.RowIndex].Cells[13].Value.ToString(),
                 dataGridView1.Rows[e.RowIndex].Cells[4].Value.ToString()
                 , dataGridView1.Rows[e.RowIndex].Cells[6].Value.ToString(),
                 dataGridView1.Rows[e.RowIndex].Cells[20].Value.ToString(), comboBox5.Text, dataGridView1.Rows[e.RowIndex].Cells[22].Value.ToString());
         }
     }
 }
Exemple #12
0
 private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     String strProductId = dataGridView1.Rows[e.RowIndex].Cells["proid"].Value.ToString();
     String strQMax = getQuantityMax(strProductId);
     //qMax = Convert.ToDouble(dataGridView1.Rows[e.RowIndex].Cells[4].Value.ToString());
     if (String.IsNullOrEmpty(dataGridView1.Rows[e.RowIndex].Cells["t"].Value.ToString()) || dataGridView1.Rows[e.RowIndex].Cells["t"].Value == null || dataGridView1.Rows[e.RowIndex].Cells["t"].Value.ToString()=="0")
     {
         Dialog.frmDialogSelectTypeWeight FrmDialogSelectTypeWeight = new Dialog.frmDialogSelectTypeWeight();
         FrmDialogSelectTypeWeight.ShowDialog();
         if (FrmDialogSelectTypeWeight.DialogResult == DialogResult.Yes)
         {
             checkType(FrmDialogSelectTypeWeight.GetTypeL(),
                 dataGridView1.Rows[e.RowIndex].Cells["ppu"].Value.ToString(), dataGridView1.Rows[e.RowIndex].Cells["du"].Value.ToString(), "", "",
                 "", strQMax, dataGridView1.Rows[e.RowIndex].Cells["dp"].Value.ToString());
         }
     }
     else
     {
         checkType(dataGridView1.Rows[e.RowIndex].Cells["dt"].Value.ToString(),
             dataGridView1.Rows[e.RowIndex].Cells["ppu"].Value.ToString(),
             dataGridView1.Rows[e.RowIndex].Cells["du"].Value.ToString(),
             dataGridView1.Rows[e.RowIndex].Cells["d"].Value.ToString(),
             dataGridView1.Rows[e.RowIndex].Cells["receive"].Value.ToString(),
             dataGridView1.Rows[e.RowIndex].Cells["up"].Value.ToString(),
             strQMax, dataGridView1.Rows[e.RowIndex].Cells["du"].Value.ToString());
     }
 }