Exemple #1
0
 protected void GVAnPhamLayout_OnRowCommand(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("AddNew"))
     {
         TextBox             _trang      = (TextBox)GVAnPhamLayout.FooterRow.FindControl("txt_Trang");
         DropDownList        _ddl_Layout = (DropDownList)GVAnPhamLayout.FooterRow.FindControl("ddl_Layout");
         int                 _return;
         AnPhamMau_LayoutDAL _apDAL = new AnPhamMau_LayoutDAL();
         T_AnPhamMau_Layout  _obj   = new T_AnPhamMau_Layout();
         _obj.ID     = 0;
         _obj.Ma_Mau = EID;
         if ((!String.IsNullOrEmpty(_trang.Text.Trim())) && (Convert.ToInt32(_ddl_Layout.SelectedValue.ToString()) > 0))
         {
             _obj.Trang     = Convert.ToInt32(_trang.Text.Trim());
             _obj.Ma_layout = Convert.ToInt32(_ddl_Layout.SelectedValue.ToString());
             _return        = _apDAL.InsertT_Anphammau_Layout(_obj);
             action.Thaotac = "[Thêm mới ấn phẩm mẫu - layout]-->[Mã ấn phẩm mẫu - layout:" + _return.ToString() + " ]";
             actionDAL.InserT_Lichsu_Thaotac_Hethong(action);
         }
         Bind_AnphamMau_Layout();
     }
 }
 public int InsertT_Anphammau_Layout(T_AnPhamMau_Layout _Obj)
 {
     try
     {
         return(HPCDataProvider.Instance().InsertObjectReturn(_Obj, "[Sp_InsertT_AnPhamMau_Layout]"));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemple #3
0
        protected void GVAnPhamLayout_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(GVAnPhamLayout.DataKeys[e.RowIndex].Value.ToString());

            //TextBox _trang = (TextBox)GVAnPhamLayout.Rows[e.RowIndex].FindControl("txt_Trang");
            Label        _trang     = (Label)GVAnPhamLayout.Rows[e.RowIndex].FindControl("lblMota");
            DropDownList _ddlLayout = (DropDownList)GVAnPhamLayout.Rows[e.RowIndex].FindControl("ddl_Layout");

            AnPhamMau_LayoutDAL _apDAL = new AnPhamMau_LayoutDAL();
            T_AnPhamMau_Layout  _ap    = new T_AnPhamMau_Layout();
            _ap.ID     = _id;
            _ap.Ma_Mau = EID;

            if (Convert.ToInt32(_ddlLayout.SelectedValue.ToString()) > 0)
            {
                _ap.Ma_layout = Convert.ToInt32(_ddlLayout.SelectedValue.ToString());
            }
            else
            {
                _ap.Ma_layout = 0;
            }
            if (!String.IsNullOrEmpty(_trang.Text.Trim()))
            {
                _ap.Trang = Convert.ToInt32(_trang.Text.Trim());
            }
            _return = _apDAL.InsertT_Anphammau_Layout(_ap);

            action.Thaotac = "[Sửa ấn phẩm mẫu - layout]-->[Mã ấn phẩm mẫu - layout:" + _return.ToString() + " ]";
            actionDAL.InserT_Lichsu_Thaotac_Hethong(action);

            GVAnPhamLayout.EditIndex = -1;
            Bind_AnphamMau_Layout();
        }