示例#1
0
 public void loadInput()
 {
     product               = new Data.ProductOutput();
     product.ID            = GetIDMSHD();
     product.MSKH          = SplitMSKH(txtMSKH.Text);
     product.MSXE          = txtLicencePlate.Text;
     product.Date          = txtDate.Value.Date;
     product.ProductName   = txtProductName.Text;
     product.ProductPrice  = int.Parse(txtPrice.Text);
     product.TruckWeight   = int.Parse(txtTruckofWeight.Text);
     product.ProductWeight = int.Parse(txtProductWeight.Text);
     product.TotalWeight   = int.Parse(txtTruckofWeight.Text) + int.Parse(txtProductWeight.Text);
     product.TotalAmount   = Int32.Parse(txtProductWeight.Text) * Int32.Parse(txtPrice.Text);
     product.ProductPrice  = Int32.Parse(txtPrice.Text);
 }
示例#2
0
 private void btnRemove_Click(object sender, EventArgs e)
 {
     if (currentlyRows < dataDS.Rows.Count - 1)
     {
         product = new Data.ProductOutput();
         int ID = int.Parse(dataDS.Rows[currentlyRows].Cells[0].Value.ToString().Split('H')[1]);
         product = list.Find(u => u.ID == ID);
         string       masseage = "Bạn có muốn xóa hóa đơn " + "HK" + product.ID.ToString("D6").Trim() + " không?";
         string       Title    = "Chú ý";
         DialogResult result   = MessageBox.Show(masseage, Title, MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2);
         if (result == DialogResult.Yes)
         {
             productOutputBO.isDelete(ID);
             loadDG();
         }
     }
 }
示例#3
0
 private void btnEdit_Click(object sender, EventArgs e)
 {
     product = new Data.ProductOutput();
     if (Validation())
     {
         int maxMount = int.Parse(txtProductWeight.Text) * int.Parse(txtPrice.Text);
         if (maxMount < 0)
         {
             MessageBox.Show("Trọng lượng không hợp lệ hoặc quá tải!");
         }
         else
         {
             product.ID            = fladID;
             product.MSKH          = SplitMSKH(txtMSKH.Text);
             product.MSXE          = txtLicencePlate.Text;
             product.Date          = txtDate.Value.Date;
             product.ProductName   = txtProductName.Text;
             product.sack          = int.Parse(txtWeight.Text);
             product.TypeSack      = int.Parse(txtTypeWeight.Text);
             product.ProductPrice  = double.Parse(txtPrice.Text);
             product.TruckWeight   = double.Parse(txtTruckofWeight.Text);
             product.ProductWeight = double.Parse(txtProductWeight.Text);
             product.TotalWeight   = double.Parse(txtTruckofWeight.Text) + double.Parse(txtProductWeight.Text);
             product.TotalAmount   = double.Parse(txtProductWeight.Text) * double.Parse(txtPrice.Text);
             product.ProductPrice  = double.Parse(txtPrice.Text);
             productOutputBO.Update(product);
             loadDG();
             RefreshAdd();
             txtHoten.Focus();
             btnEdit.Visible   = false;
             btnThem.Visible   = true;
             btnRemove.Enabled = true;
         }
     }
     else
     {
         txtLicencePlate.Focus();
         MessageBox.Show("Vui lòng điền đúng thông tin");
     }
 }
示例#4
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            product = new Data.ProductOutput();
            var obj = list.Find(u => u.ID == fladID);

            if (Validation())
            {
                int maxMount = int.Parse(txtProductWeight.Text) * int.Parse(txtPrice.Text);
                if (maxMount <= 0)
                {
                    MessageBox.Show("Trọng lượng không hợp lệ hoặc quá tải!");
                }
                else
                {
                    obj.MSKH          = SplitMSKH(txtMSKH.Text);
                    obj.MSXE          = txtLicencePlate.Text;
                    obj.Date          = txtDate.Value.Date;
                    obj.ProductName   = txtProductName.Text;
                    obj.ProductPrice  = int.Parse(txtPrice.Text);
                    obj.TruckWeight   = int.Parse(txtTruckofWeight.Text);
                    obj.ProductWeight = int.Parse(txtProductWeight.Text);
                    obj.TotalWeight   = int.Parse(txtTruckofWeight.Text) + int.Parse(txtProductWeight.Text);
                    obj.TotalAmount   = int.Parse(txtProductWeight.Text) * int.Parse(txtPrice.Text);
                    obj.ProductPrice  = int.Parse(txtPrice.Text);
                    loadDG();
                    RefreshAdd();
                    txtHoten.Focus();
                    btnEdit.Visible   = false;
                    btnThem.Visible   = true;
                    btnSave.Enabled   = true;
                    btnRemove.Enabled = true;
                }
            }
            else
            {
                txtLicencePlate.Focus();
                MessageBox.Show("Vui lòng điền đúng thông tin");
            }
        }