public int InsertT_Anphammau(T_AnPhamMau _Obj) { try { return(HPCDataProvider.Instance().InsertObjectReturn(_Obj, "Sp_Insert_UpdateT_AnPhamMau")); } catch (Exception ex) { throw ex; } }
protected void GVAnphamMau_OnRowCommand1(object sender, GridViewCommandEventArgs e) { #region GhiLog Lichsu_Thaotac_HethongDAL actionDAL = new Lichsu_Thaotac_HethongDAL(); T_Lichsu_Thaotac_Hethong action = new T_Lichsu_Thaotac_Hethong(); action.Ma_Nguoidung = _user.UserID; action.TenDaydu = _user.UserFullName; action.HostIP = IpAddress(); action.NgayThaotac = DateTime.Now; #endregion if (e.CommandName.Equals("Mangxec")) { GridViewRow row = (GridViewRow)((Control)e.CommandSource).Parent.Parent; EID = (int)GVAnphamMau.DataKeys[row.RowIndex].Values[0]; if (EID != 0) { LoadDataApprovied(); PopupMangXec.Show(); } } if (e.CommandName.Equals("AddNew")) { TextBox _mota = (TextBox)GVAnphamMau.FooterRow.FindControl("txt_mota"); DropDownList _ddlAnpham = (DropDownList)GVAnphamMau.FooterRow.FindControl("ddl_AnPham"); int _return; AnPhamMauDAL _apDAL = new AnPhamMauDAL(); _ap = new T_AnPhamMau(); _ap.MA_Mau = 0; _ap.Mota = _mota.Text.Trim(); if (Convert.ToInt32(_ddlAnpham.SelectedValue.ToString()) > 0) { _ap.Ma_Anpham = Convert.ToInt32(_ddlAnpham.SelectedValue.ToString()); } else { _ap.Ma_Anpham = 0; } _return = _apDAL.InsertT_Anphammau(_ap); action.Thaotac = "[Thêm mới ấn phẩm mẫu]-->[Mã ấn phẩm mẫu:" + _return.ToString() + " ]"; actionDAL.InserT_Lichsu_Thaotac_Hethong(action); BindList_AnphamMau(); } }
protected void GVAnphamMau_RowUpdating(object sender, GridViewUpdateEventArgs e) { #region GhiLog Lichsu_Thaotac_HethongDAL actionDAL = new Lichsu_Thaotac_HethongDAL(); T_Lichsu_Thaotac_Hethong action = new T_Lichsu_Thaotac_Hethong(); action.Ma_Nguoidung = _user.UserID; action.TenDaydu = _user.UserFullName; action.HostIP = IpAddress(); action.NgayThaotac = DateTime.Now; #endregion int _return; int _id = Convert.ToInt32(GVAnphamMau.DataKeys[e.RowIndex].Value.ToString()); TextBox _mota = (TextBox)GVAnphamMau.Rows[e.RowIndex].FindControl("txt_mota"); DropDownList _ddlAnpham = (DropDownList)GVAnphamMau.Rows[e.RowIndex].FindControl("ddl_AnPham"); AnPhamMauDAL _apDAL = new AnPhamMauDAL(); _ap = new T_AnPhamMau(); _ap.MA_Mau = _id; _ap.Mota = _mota.Text.Trim(); if (Convert.ToInt32(_ddlAnpham.SelectedValue.ToString()) > 0) { _ap.Ma_Anpham = Convert.ToInt32(_ddlAnpham.SelectedValue.ToString()); } else { _ap.Ma_Anpham = 0; } _return = _apDAL.InsertT_Anphammau(_ap); action.Thaotac = "[Sửa ấn phẩm mẫu]-->[Mã mẫu:" + _return.ToString() + " ]"; actionDAL.InserT_Lichsu_Thaotac_Hethong(action); GVAnphamMau.EditIndex = -1; BindList_AnphamMau(); }