public static string UpdateKho(string id, string maKho, string tenKho, string diaChi, string sodienthoai, string nguoiphutrach, string kichHoat, string ghiChu, string thuocTongKho, string loaiKho) { try { int thuoctongkho_temp = 0; Guid currentUserID = Guid.NewGuid(); string currentUser = ""; #region Get current User MembershipUser membershipUser = Membership.GetUser(HttpContext.Current.User.Identity.Name); if (membershipUser != null) { currentUser = membershipUser.UserName; currentUserID = (Guid)membershipUser.ProviderUserKey; } #endregion get current User xRPDataContext dataContext = new xRPDataContext(); Qlvt_KhoVatTu qlvt = new Qlvt_KhoVatTu(); int? idd = int.Parse(id) == 0 || int.Parse(id) == -1 ? (int?)null : int.Parse(id); if (int.Parse(id) == -1) { dataContext.Sp_Qlvt_KhoVatTu_Add_Edit_Deli("ADD", 0, maKho, tenKho, thuoctongkho_temp, bool.Parse(loaiKho), diaChi, sodienthoai, nguoiphutrach, ghiChu, int.Parse(kichHoat), currentUserID, currentUserID, ref idd, Util.GetIP(), Util.GetPCName()); } if (int.Parse(id) > 0) { dataContext.Sp_Qlvt_KhoVatTu_Add_Edit_Deli("EDIT", int.Parse(id), maKho, tenKho, thuoctongkho_temp, bool.Parse(loaiKho), diaChi, sodienthoai, nguoiphutrach, ghiChu, int.Parse(kichHoat), currentUserID, currentUserID, ref idd, Util.GetIP(), Util.GetPCName()); } } catch (Exception) { return("ERROR"); } return("SUCCESS"); }