Esempio n. 1
0
 public int InsertT_Layout(T_Layout _Obj)
 {
     try
     {
         return(HPCDataProvider.Instance().InsertObjectReturn(_Obj, "[Sp_InsertT_Layout]"));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 2
0
 protected void GVLayout_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("AddNew"))
     {
         TextBox _m    = (TextBox)GVLayout.FooterRow.FindControl("txt_Mota");
         TextBox _dai  = (TextBox)GVLayout.FooterRow.FindControl("txt_dai");
         TextBox _rong = (TextBox)GVLayout.FooterRow.FindControl("txt_rong");
         double  _d;
         double  _r;
         int     _return;
         if (!String.IsNullOrEmpty(_dai.Text.Trim()))
         {
             _d = Convert.ToDouble(_dai.Text.Trim());
         }
         else
         {
             _d = 0;
         }
         if (!String.IsNullOrEmpty(_rong.Text.Trim()))
         {
             _r = Convert.ToDouble(_rong.Text.Trim());
         }
         else
         {
             _r = 0;
         }
         LayoutDAL _layoutDAL = new LayoutDAL();
         _layout           = new T_Layout();
         _layout.Ma_Layout = 0;
         _layout.Mota      = _m.Text.Trim();
         _layout.Chieudai  = _d;
         _layout.ChieuRong = _r;
         _return           = _layoutDAL.InsertT_Layout(_layout);
         action.Thaotac    = "[Thêm mới layout]-->[Mã layout:" + _return.ToString() + " ]";
         actionDAL.InserT_Lichsu_Thaotac_Hethong(action);
         BindList_Layout();
     }
 }
Esempio n. 3
0
 protected void GVLayout_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       _id        = Convert.ToInt32(GVLayout.DataKeys[e.RowIndex].Value.ToString());
     LayoutDAL _layoutDAL = new LayoutDAL();
     TextBox   _m         = (TextBox)GVLayout.Rows[e.RowIndex].FindControl("txt_Mota");
     TextBox   _dai       = (TextBox)GVLayout.Rows[e.RowIndex].FindControl("txt_dai");
     TextBox   _rong      = (TextBox)GVLayout.Rows[e.RowIndex].FindControl("txt_rong");
     double    _d;
     double    _r;
     int       _return;
     if (!String.IsNullOrEmpty(_dai.Text.Trim()))
     {
         _d = Convert.ToDouble(_dai.Text.Trim());
     }
     else
     {
         _d = 0;
     }
     if (!String.IsNullOrEmpty(_rong.Text.Trim()))
     {
         _r = Convert.ToDouble(_rong.Text.Trim());
     }
     else
     {
         _r = 0;
     }
     _layout           = new T_Layout();
     _layout.Ma_Layout = _id;
     _layout.Mota      = _m.Text.Trim();
     _layout.Chieudai  = _d;
     _layout.ChieuRong = _r;
     _return           = _layoutDAL.InsertT_Layout(_layout);
     action.Thaotac    = "[Sửa layout]-->[Mã layout:" + _return.ToString() + " ]";
     actionDAL.InserT_Lichsu_Thaotac_Hethong(action);
     GVLayout.EditIndex = -1;
     BindList_Layout();
 }