protected void gridNhaCungCap_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { string ID = e.Keys["ID"].ToString(); string tenNhaCungCap = e.NewValues["TenNhaCungCap"].ToString(); string dienThoai = e.NewValues["DienThoai"] == null ? "" : e.NewValues["DienThoai"].ToString(); string fax = e.NewValues["Fax"] == null ? "" : e.NewValues["Fax"].ToString(); string email = e.NewValues["Email"] == null ? "" : e.NewValues["Email"].ToString(); string diaChi = e.NewValues["DiaChi"] == null ? "" : e.NewValues["DiaChi"].ToString(); string nguoiLienHe = e.NewValues["NguoiLienHe"] == null ? "" : e.NewValues["NguoiLienHe"].ToString(); string maSoThue = e.NewValues["MaSoThue"] == null ? "" : e.NewValues["MaSoThue"].ToString(); string linhVucKinhDoanh = e.NewValues["LinhVucKinhDoanh"] == null ? "" : e.NewValues["LinhVucKinhDoanh"].ToString(); string MaNCC = e.NewValues["MaNCC"].ToString(); string ghiChu = e.NewValues["GhiChu"] == null ? "" : e.NewValues["GhiChu"].ToString(); //if (dtSetting.kiemTraChuyenDoiDau() == 1) // tenNhaCungCap = dtSetting.convertDauSangKhongDau(tenNhaCungCap).ToUpper(); if (dtSetting.IsNumber(MaNCC) == true) { if (dtNhaCungCap.KiemTraMaNCC_ID(MaNCC, ID) == true) { data.SuaThongTinNhaCungCap(MaNCC, Int32.Parse(ID), tenNhaCungCap, dienThoai, fax, email, diaChi, nguoiLienHe, maSoThue, linhVucKinhDoanh, ghiChu); e.Cancel = true; gridNhaCungCap.CancelEdit(); LoadGrid(); dtLichSuTruyCap.ThemLichSu(Session["IDNhanVien"].ToString(), Session["IDNhom"].ToString(), "Nhà Cung Cấp: " + tenNhaCungCap, Session["IDKho"].ToString(), "Danh Mục", "Cập Nhật"); } else { if (dtNhaCungCap.KiemTraMaNCC(MaNCC) == false) { data.SuaThongTinNhaCungCap(MaNCC, Int32.Parse(ID), tenNhaCungCap, dienThoai, fax, email, diaChi, nguoiLienHe, maSoThue, linhVucKinhDoanh, ghiChu); e.Cancel = true; gridNhaCungCap.CancelEdit(); LoadGrid(); dtLichSuTruyCap.ThemLichSu(Session["IDNhanVien"].ToString(), Session["IDNhom"].ToString(), "Nhà Cung Cấp: " + tenNhaCungCap, Session["IDKho"].ToString(), "Danh Mục", "Cập Nhật"); } else { throw new Exception("Lỗi: Mã nhà cung cấp đã tồn tại"); } } } else { throw new Exception("Lỗi: Mã nhà cung cấp phải là số"); } }
protected void gridNhaCungCap_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { string ID = e.Keys["ID"].ToString(); string tenNhaCungCap = e.NewValues["TenNhaCungCap"].ToString(); string dienThoai = e.NewValues["DienThoai"] == null ? "" : e.NewValues["DienThoai"].ToString(); string fax = e.NewValues["Fax"] == null ? "" : e.NewValues["Fax"].ToString(); string email = e.NewValues["Email"] == null ? "" : e.NewValues["Email"].ToString(); string diaChi = e.NewValues["DiaChi"] == null ? "" : e.NewValues["DiaChi"].ToString(); string nguoiLienHe = e.NewValues["NguoiLienHe"] == null ? "" : e.NewValues["NguoiLienHe"].ToString(); string maSoThue = e.NewValues["MaSoThue"] == null ? "" : e.NewValues["MaSoThue"].ToString(); string linhVucKinhDoanh = e.NewValues["LinhVucKinhDoanh"] == null ? "" : e.NewValues["LinhVucKinhDoanh"].ToString(); //string loGo = ""; //e.NewValues["TenNganhHang"].ToString(); DateTime NgayCapNhat = DateTime.Today.Date; string ghiChu = e.NewValues["GhiChu"] == null ? "" : e.NewValues["GhiChu"].ToString(); data.SuaThongTinNhaCungCap(Int32.Parse(ID), tenNhaCungCap, dienThoai, fax, email, diaChi, nguoiLienHe, maSoThue, linhVucKinhDoanh, NgayCapNhat, ghiChu); e.Cancel = true; gridNhaCungCap.CancelEdit(); LoadGrid(); }