public void HuyNl()
        {
            HuyNguyenLieuDTO huynl = new HuyNguyenLieuDTO();

            huynl.TenDn = TenDn ?? "admin";
            bool t = huynl_bus.HuyNl_Insert(huynl);

            for (int i = 0; i < datanguyenlieuhuy.Rows.Count - 1; i++)
            {
                CtHuyNguyenLieuDTO cthuynl = new CtHuyNguyenLieuDTO();
                cthuynl.MaNl    = datanguyenlieuhuy.Rows[i].Cells[0].Value.ToString();
                cthuynl.DVt     = datanguyenlieuhuy.Rows[i].Cells[1].Value.ToString();
                cthuynl.SoLuong = datanguyenlieuhuy.Rows[i].Cells[2].Value.ToString();
                cthuynl.HSd     = datanguyenlieuhuy.Rows[i].Cells[3].Value.ToString();
                cthuynl.LyDoHuy = datanguyenlieuhuy.Rows[i].Cells[4].Value.ToString();
                cthuynl_bus.CtHuyNl_Insert(cthuynl);
            }
            CtHuyNl_DeleteNl();
            HoaDonHuy  hdh  = new HoaDonHuy(TenDn);
            HoaDonHuyy hdhy = new HoaDonHuyy();

            hdh.crvhoadonhuy.ReportSource = hdhy;
            this.Hide();
            hdh.ShowDialog();
        }
Ejemplo n.º 2
0
 public bool HuyNguyenLieu_Insert(HuyNguyenLieuDTO huynl)
 {
     try
     {
         openConnect();
         SqlCommand cmd = new SqlCommand("HUYNL_INSERT", con);
         cmd.CommandType = CommandType.StoredProcedure;
         cmd.Parameters.Add(new SqlParameter("@TENDN", huynl.TenDn));
         cmd.ExecuteNonQuery();
         closeConnect();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
 public bool HuyNl_Insert(HuyNguyenLieuDTO huynl)
 {
     return(huynl_dal.HuyNguyenLieu_Insert(huynl));
 }