Esempio n. 1
0
 private void btnImport_Click_1(object sender, EventArgs e)
 {
     if (Uc_WareHouse.GetData.idBill == "")
     {
         MessageBox.Show("You need to create a bill to import first");
     }
     else
     {
         Uc_WareHouse.GetData.choose = 4;
         GetData.idSP            = lbID.Text;
         Uc_WareHouse.GetData.id = lbID.Text;
         frmAmount amount = new frmAmount();
         amount.ShowDialog();
         if (frmAmount.GetData.sL != 0)
         {
             chiTietHDN cthdnn = db.chiTietHDNs.Where(s => s.maHDN.Equals(Uc_WareHouse.GetData.idBill) && s.maSP.Equals(lbID.Text)).FirstOrDefault();
             if (cthdnn != null)
             {
                 MessageBox.Show("Already have this product in present bill");
             }
             else
             {
                 db.CTHDN_Ins(Uc_WareHouse.GetData.idBill, lbID.Text, frmAmount.GetData.gia, frmAmount.GetData.sL, 0);
                 lbSL.Text = (frmAmount.GetData.sL + Convert.ToInt32(lbSL.Text)).ToString();
             }
         }
     }
 }
Esempio n. 2
0
 private void btnImport_Click(object sender, EventArgs e)
 {
     if (Uc_WareHouse.GetData.id == "")
     {
         MessageBox.Show("Do not have import bill yet");
     }
     else
     {
         Uc_WareHouse.GetData.choose = 3;
         GetData.idSP = lbID.Text;
         //frmProductShow.GetData.idSP = lbID.Text;
         frmAmount amount = new frmAmount();
         amount.ShowDialog();
         if (frmAmount.GetData.sL != 0)
         {
             CTPhieuNhap ctpn = db.CTPhieuNhaps.Where(s => s.maphieu.Equals(Uc_WareHouse.GetData.id) && s.masp.Equals(lbID.Text)).FirstOrDefault();
             if (ctpn != null)
             {
                 MessageBox.Show("Already have this product in present bill");
             }
             else
             {
                 db.CTPN_Add(Uc_WareHouse.GetData.id, lbID.Text, frmAmount.GetData.sL);
             }
         }
     }
 }