Exemple #1
0
        protected void GVDoituong_RowDeleting(object sender, GridViewDeleteEventArgs 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(GVDoituong.DataKeys[e.RowIndex].Values["ID"].ToString());
            DoituongDAL _dtDAL = new DoituongDAL();
            if (_dtDAL.CheckExists_Madoituong(_id, 1) == 1)
            {
                return;
            }
            else
            {
                _dtDAL.DeleteOneFromT_Doituong(_id);
                lblMessError.Text = "";
                action.Thaotac    = "[Xóa đối tượng]-->[Mã đối tượng:" + _id.ToString() + " ]";
                actionDAL.InserT_Lichsu_Thaotac_Hethong(action);
            }
            BindList_Doituong();
            BinQuytrinhtheoAnPham();

            UltilFunc.RunJavaScriptCode("$.fx.speeds._default = 10; var dlg = jQuery('#dialog').dialog({draggable: true,  resizable: true, hide: 'scale', modal: true, width: 500 }); dlg.parent().appendTo(jQuery('form:first'));");
        }
Exemple #2
0
 protected void ThemDT_Click(object sender, EventArgs e)
 {
     foreach (GridViewRow item in GVDoituong.Rows)
     {
         CheckBox chk_Select = (CheckBox)item.FindControl("optSelect");
         if (chk_Select != null && chk_Select.Checked)
         {
             #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
             Label  txtMaDT = (Label)item.FindControl("lblMaDT");
             string MaDT    = txtMaDT.Text;
             _DTDAL.InsertT_Doituong_AnPham(MaDT, maanpham);
             action.Thaotac = "[Thêm đối tượng vào ấn phẩm]-->[Mã đối tượng:" + MaDT + " ]";
             actionDAL.InserT_Lichsu_Thaotac_Hethong(action);
         }
     }
     BindList_Doituong();
     BinQuytrinhtheoAnPham();
 }
Exemple #3
0
        private void InsertQuytrinh()
        {
            HPCBusinessLogic.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.UserName;
            action.HostIP       = IpAddress();
            action.NgayThaotac  = DateTime.Now;
            action.Ma_Chucnang  = int.Parse(Request["Menu_ID"].ToString());
            ArrayList ar   = new ArrayList();
            string    MAQT = "";
            int       i    = 0;

            foreach (DataGridItem m_Item in gdListQuytrinh.Items)
            {
                CheckBox chk_Select = (CheckBox)m_Item.FindControl("optSelect");
                if (chk_Select != null && chk_Select.Checked)
                {
                    if (i == 0)
                    {
                        MAQT = "'" + gdListQuytrinh.DataKeys[int.Parse(m_Item.ItemIndex.ToString())].ToString() + "'";
                    }
                    else
                    {
                        MAQT += ",'" + gdListQuytrinh.DataKeys[int.Parse(m_Item.ItemIndex.ToString())].ToString() + "'";
                    }
                    i++;
                }
            }
            _QTDAL.InsertT_Quytrinh(lst_Quytrinh.SelectedValue.ToString(), MAQT, maanpham, _user.UserID, DateTime.Now, _user.UserID, DateTime.Now);
            BinQuytrinhtheoAnPham();
            actionDAL.InserT_Lichsu_Thaotac_Hethong(action);
        }
Exemple #4
0
 public void grdList_EditCommand(object source, DataGridCommandEventArgs 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
     AnPhamDAL obj_AnPham = new AnPhamDAL();
     if (e.CommandArgument.ToString().ToLower() == "edit")
     {
         int catID = Convert.ToInt32(this.grdList.DataKeys[e.Item.ItemIndex].ToString());
         Response.Redirect("~/Danhmuc/EditAnPham.aspx?Menu_ID=" + Page.Request["Menu_ID"].ToString() + "&ID=" + catID);
     }
     if (e.CommandArgument.ToString().ToLower() == "delete")
     {
         int catID = Convert.ToInt32(this.grdList.DataKeys[e.Item.ItemIndex].ToString());
         if (obj_AnPham.CheckExists_AnPham(catID) == 0)
         {
             obj_AnPham.DeleteFromT_AnPhamByID(catID);
             action.Thaotac = "[Xóa T_AnPham]-->[Thao tác Xóa Trong Bảng T_AnPham][ID:" + this.grdList.DataKeys[e.Item.ItemIndex].ToString() + " ]";
         }
         else
         {
             return;
         }
         this.Danhsach_AnPham();
     }
 }
Exemple #5
0
        protected void GVDoituong_RowDeleting(object sender, GridViewDeleteEventArgs 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(GVDoituong.DataKeys[e.RowIndex].Values["ID"].ToString());
            DoituongDAL _dtDAL = new DoituongDAL();
            if (_dtDAL.CheckExists_Madoituong(_id, 1) == 1)
            {
                return;
            }
            else
            {
                _dtDAL.DeleteOneFromT_Doituong(_id);
                action.Thaotac = "[Xóa đối tượng]-->[Mã đối tượng:" + _id.ToString() + " ]";
                actionDAL.InserT_Lichsu_Thaotac_Hethong(action);
            }
            BindList_Doituong();
        }
Exemple #6
0
        protected void GridViewPhongBan_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 _tenphongban = (TextBox)GridViewPhongBan.FooterRow.FindControl("txt_Tenphong");

                _PB.Ma_Phongban  = 0;
                _PB.Ten_Phongban = _tenphongban.Text.Trim();
                if (!isExist(_tenphongban.Text.Trim()))
                {
                    _DAL.InsertT_Phongban(_PB);
                }
                else
                {
                    FuncAlert.AlertJS(this, "Tên phòng ban đã tồn tại!");
                }
                action.Thaotac = "[Thêm mới phòng ban]";
                actionDAL.InserT_Lichsu_Thaotac_Hethong(action);
                BindList_Phongban();
            }
        }
Exemple #7
0
        protected void GridViewPhongBan_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(GridViewPhongBan.DataKeys[e.RowIndex].Value.ToString());

            TextBox _tenphongban = (TextBox)GridViewPhongBan.Rows[e.RowIndex].FindControl("txt_Tenphong");

            _PB.Ma_Phongban  = _id;
            _PB.Ten_Phongban = _tenphongban.Text.Trim();
            if (!isExist(_tenphongban.Text.Trim(), _id))
            {
                _return = _DAL.InsertT_Phongban(_PB);
            }
            else
            {
                FuncAlert.AlertJS(this, "Tên phòng ban đã tồn tại!");
            }
            action.Thaotac = "[Sửa phòng ban]";
            actionDAL.InserT_Lichsu_Thaotac_Hethong(action);
            GridViewPhongBan.EditIndex = -1;
            BindList_Phongban();
        }
Exemple #8
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();
     }
 }
Exemple #9
0
        public void grdListUser_EditCommand(object source, DataGridCommandEventArgs 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.CommandArgument.ToString().ToLower() == "editusers")
            {
                Response.Redirect("~/Hethong/Edit_CTV.aspx?Menu_ID=" + Page.Request["Menu_ID"].ToString() + "&ID=" + this.DataGridCTV.DataKeys[e.Item.ItemIndex].ToString());
            }
            if (e.CommandArgument.ToString().ToLower() == "delete")
            {
                userID = Convert.ToInt32(DataGridCTV.DataKeys[e.Item.ItemIndex]);
                if (_NguoidungDAL.CheckDelete_users(userID))
                {
                    System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('Bạn không được xóa CTV đã được chọn tác giả cho tin bài xuất bản.!');", true);
                    return;
                }
                else
                {
                    _NguoidungDAL.DeleteFromT_Nguoidung(userID);
                    action.Thaotac = "[Xóa UserID]-->[Thao tác Xóa Trong Bảng T_USERS][UserID:" + userID.ToString() + " ]";

                    this.LoadData();
                }
            }

            action.Ma_Chucnang = int.Parse(Page.Request["Menu_ID"].ToString());
            actionDAL.InserT_Lichsu_Thaotac_Hethong(action);
        }
Exemple #10
0
 public void grdList_EditCommand(object source, DataGridCommandEventArgs 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
     SobaoDAL objDAL = new SobaoDAL();
     int      _id    = Convert.ToInt32(this.grdList.DataKeys[e.Item.ItemIndex].ToString());
     if (e.CommandArgument.ToString().ToLower() == "edit")
     {
         Response.Redirect("~/Danhmuc/EditSobao.aspx?Menu_ID=" + Page.Request["Menu_ID"].ToString() + "&ID=" + _id);
     }
     if (e.CommandArgument.ToString().ToLower() == "delete")
     {
         if (!checkdelete(_id))
         {
             objDAL.DeleteOneFromT_Sobao(_id);
             action.Thaotac = "[Xóa T_Sobao]-->[Thao tác Xóa Trong Bảng T_Sobao][ID:" + _id + " ]";
             this.Danhsach_Sobao();
         }
         else
         {
             FuncAlert.AlertJS(this, " Số báo đã được biên tập tin bài, nên không thể xóa!");
             return;
         }
     }
 }
 public void grdList_EditCommand(object source, DataGridCommandEventArgs 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
     HPCBusinessLogic.DAL.YeucauDAL objDAL = new HPCBusinessLogic.DAL.YeucauDAL();
     if (e.CommandArgument.ToString().ToLower() == "edit")
     {
         int cusID = Convert.ToInt32(this.grdList.DataKeys[e.Item.ItemIndex].ToString());
         Response.Redirect("~/Phathanh/YeucauPHEdit.aspx?Menu_ID=" + Page.Request["Menu_ID"].ToString() + "&ID=" + cusID);
     }
     if (e.CommandArgument.ToString().ToLower() == "isstatus")
     {
         double _ID    = Convert.ToDouble(this.grdList.DataKeys[e.Item.ItemIndex].ToString());
         Int16  _check = objDAL.GetOneFromT_YeuCauByID(_ID).Trangthai;
         if (_check == 0)
         {
             objDAL.UpdateinfoT_Yeucau(" [Trangthai] = 1 where ID = " + _ID.ToString());
             action.Thaotac = "[Cập nhật trạng thái bảng T_Yeucau][ID:" + _ID.ToString() + " ][Trangthai = 1]";
             Danhsach_Yeucau();
         }
         if (_check == 1)
         {
             bool _bool;
             _bool = IsHopdongExsits(Convert.ToInt32(this.grdList.DataKeys[e.Item.ItemIndex].ToString()));
             if (_bool == false)
             {
                 objDAL.UpdateinfoT_Yeucau(" [Trangthai] = 0 where ID = " + _ID.ToString());
                 action.Thaotac = "[Cập nhật trạng thái bảng T_Yeucau][ID:" + _ID.ToString() + " ][Trangthai = 0]";
             }
             else
             {
                 System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('Yêu cầu này đã làm hợp đồng!');", true);
                 return;
             }
             Danhsach_Yeucau();
         }
     }
     if (e.CommandArgument.ToString().ToLower() == "delete")
     {
         bool _bool;
         _bool = IsHopdongExsits(Convert.ToInt32(this.grdList.DataKeys[e.Item.ItemIndex].ToString()));
         if (_bool == false)
         {
             objDAL.DeleteFromT_YeuCauQCByID(Convert.ToInt32(this.grdList.DataKeys[e.Item.ItemIndex].ToString()));
             action.Thaotac = "[Thao tác Xóa Trong Bảng T_Yeucau][ID:" + this.grdList.DataKeys[e.Item.ItemIndex].ToString() + " ]";
             Danhsach_Yeucau();
         }
         else
         {
             return;
         }
     }
 }
 public void grdList_EditCommand(object source, DataGridCommandEventArgs 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
     ChuyenmucDAL obj_Cate = new ChuyenmucDAL();
     int          catID    = Convert.ToInt32(this.grdListCate.DataKeys[e.Item.ItemIndex].ToString());
     if (e.CommandArgument.ToString().ToLower() == "edit")
     {
         Response.Redirect("~/Danhmuc/EditChuyenMuc.aspx?Menu_ID=" + Page.Request["Menu_ID"].ToString() + "&ID=" + catID);
     }
     if (e.CommandArgument.ToString().ToLower() == "editdisplay")
     {
         bool check = obj_Cate.GetOneFromT_ChuyenmucByID(catID).HoatDong;
         if (check)
         {
             obj_Cate.UpdateFromT_ChuyenMucDynamic(" Hoatdong = 0, Ngaysua = Getdate(), Nguoisua=" + _user.UserID.ToString() + " Where Ma_ChuyenMuc = " + catID);
             action.Thaotac = "[Update T_ChuyenMuc]-->[Hoatdong = 0]";
         }
         else
         {
             obj_Cate.UpdateFromT_ChuyenMucDynamic(" Hoatdong = 1, Ngaysua = Getdate(), Nguoisua=" + _user.UserID.ToString() + " Where Ma_ChuyenMuc = " + catID);
             action.Thaotac = "[Update T_ChuyenMuc]-->[Hoatdong = 1]";
         }
     }
     if (e.CommandArgument.ToString().ToLower() == "active_bdt")
     {
         bool check = obj_Cate.GetOneFromT_ChuyenmucByID(catID).HienThi_BDT;
         if (check)
         {
             obj_Cate.UpdateFromT_ChuyenMucDynamic(" HienThi_BDT = 0, Ngaysua = Getdate(), Nguoisua=" + _user.UserID.ToString() + " Where Ma_ChuyenMuc = " + catID);
             action.Thaotac = "[Update T_ChuyenMuc]-->[HienThi_BDT = 0]";
         }
         else
         {
             obj_Cate.UpdateFromT_ChuyenMucDynamic(" HienThi_BDT = 1, Ngaysua = Getdate(), Nguoisua=" + _user.UserID.ToString() + " Where Ma_ChuyenMuc = " + catID);
             action.Thaotac = "[Update T_ChuyenMuc]-->[HienThi_BDT = 1]";
         }
     }
     if (e.CommandArgument.ToString().ToLower() == "delete")
     {
         if (obj_Cate.CheckExists_ChuyenMuc(catID) == 0)
         {
             obj_Cate.DeleteFromT_ChuyenmucByID(catID);
             action.Thaotac = "[Xóa T_ChuyenMuc]-->[Thao tác Xóa Trong Bảng T_ChuyenMuc][ID:" + this.grdListCate.DataKeys[e.Item.ItemIndex].ToString() + " ]";
         }
         else
         {
             FuncAlert.AlertJS(this, "chuyên mục đã được sử dung biên tập tin bài!");
             return;
         }
     }
     Danhsach_ChuyenMuc();
 }
Exemple #13
0
        protected void GVDoituong_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 _ma          = (TextBox)GVDoituong.FooterRow.FindControl("txt_MaDoituong");
                TextBox _ten         = (TextBox)GVDoituong.FooterRow.FindControl("txt_Tendoituong");
                TextBox _englishname = (TextBox)GVDoituong.FooterRow.FindControl("txt_EnglishName");
                TextBox _stt         = (TextBox)GVDoituong.FooterRow.FindControl("txt_STT");
                //Label _MaDT = (Label)GVDoituong.FooterRow.FindControl("lblMaDT_Error");
                //Label _STT = (Label)GVDoituong.FooterRow.FindControl("lblSTT_Error");
                int         _return;
                DoituongDAL _doituongDAL = new DoituongDAL();
                if (_doituongDAL.Check_Madoituong(0, _ma.Text.Trim()) > 0)
                {
                    lblMessError.Text     = "Mã đối tượng đã tồn tại";
                    GVDoituong.ShowFooter = true;
                    BindList_Doituong();
                }
                else if (_doituongDAL.Check_STT(0, Convert.ToInt32(_stt.Text.Trim())) > 0)
                {
                    lblMessError.Text     = "Số thứ tự đã tồn tại";
                    GVDoituong.ShowFooter = true;
                    BindList_Doituong();
                }
                else
                {
                    _dt              = new T_Doituong();
                    _dt.ID           = 0;
                    _dt.Ma_Doituong  = _ma.Text.Trim();
                    _dt.Ten_Doituong = _ten.Text.Trim();
                    _dt.EnglishName  = _englishname.Text.Trim();
                    if (!String.IsNullOrEmpty(_stt.Text.Trim()))
                    {
                        _dt.STT = Convert.ToInt32(_stt.Text.Trim());
                    }

                    _dt.Ngaysua    = DateTime.Now;
                    _dt.Nguoitao   = _user.UserID;
                    _dt.Ngaytao    = DateTime.Now;
                    _dt.Nguoisua   = _user.UserID;
                    _return        = _doituongDAL.InsertT_Doituong(_dt);
                    action.Thaotac = "[Thêm mới đối tượng]-->[Mã mã đối tượng:" + _return.ToString() + " ]";
                    actionDAL.InserT_Lichsu_Thaotac_Hethong(action);
                    BindList_Doituong();
                }
            }
        }
        public void grdList_EditCommand(object source, DataGridCommandEventArgs 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
            KhachhangDAL objDAL = new KhachhangDAL();
            if (e.CommandArgument.ToString().ToLower() == "edit")
            {
                int cusID = Convert.ToInt32(this.grdList.DataKeys[e.Item.ItemIndex].ToString());
                Response.Redirect("~/Phathanh/KhachHangEdit.aspx?Menu_ID=" + Page.Request["Menu_ID"].ToString() + "&ID=" + cusID);
            }
            if (e.CommandArgument.ToString().ToLower() == "delete")
            {
                bool _bool;
                _bool = IsCustomerExsits(Convert.ToInt32(this.grdList.DataKeys[e.Item.ItemIndex].ToString()));
                if (_bool == false)
                {
                    objDAL.DeleteOneFromT_KhachHang(Convert.ToInt32(this.grdList.DataKeys[e.Item.ItemIndex].ToString()));
                    action.Thaotac = "[Xóa T_KhachHang]-->[Thao tác Xóa Trong Bảng T_KhachHang][ID:" + this.grdList.DataKeys[e.Item.ItemIndex].ToString() + " ]";
                    this.Danhsach_Khachhang();
                }
                else
                {
                    return;
                }
            }
            //if (e.CommandArgument.ToString().ToLower() == "sort")
            //{
            //    if (this.ViewState["SortExp"] == null)
            //    {
            //        this.ViewState["SortExp"] = e.CommandArgument.ToString();
            //        this.ViewState["SortOrder"] = "ASC";
            //    }
            //    else
            //    {
            //        if (this.ViewState["SortExp"].ToString() == e.CommandArgument.ToString())
            //        {
            //            if (this.ViewState["SortOrder"].ToString() == "ASC")
            //                this.ViewState["SortOrder"] = "DESC";
            //            else
            //                this.ViewState["SortOrder"] = "ASC";
            //        }
            //        else
            //        {
            //            this.ViewState["SortOrder"] = "ASC";
            //            this.ViewState["SortExp"] = e.CommandArgument.ToString();
            //        }
            //    }

            Danhsach_Khachhang();
        }
Exemple #15
0
        protected void GVDoituong_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(GVDoituong.DataKeys[e.RowIndex].Value.ToString());

            TextBox     _ma          = (TextBox)GVDoituong.Rows[e.RowIndex].FindControl("txt_MaDoituong");
            TextBox     _ten         = (TextBox)GVDoituong.Rows[e.RowIndex].FindControl("txt_Tendoituong");
            TextBox     _englishname = (TextBox)GVDoituong.Rows[e.RowIndex].FindControl("txt_EnglishName");
            TextBox     _stt         = (TextBox)GVDoituong.Rows[e.RowIndex].FindControl("txt_STT");
            Label       _MaDT        = (Label)GVDoituong.Rows[e.RowIndex].FindControl("lblMaDT_Error");
            Label       _STT         = (Label)GVDoituong.Rows[e.RowIndex].FindControl("lblSTT_Error");
            DoituongDAL _dtDAL       = new DoituongDAL();
            if (_dtDAL.Check_Madoituong(_id, _ma.Text.Trim()) > 0)
            {
                _MaDT.Text = "Mã đối tượng đã tồn tại";
                return;
            }
            else if (_dtDAL.Check_STT(_id, Convert.ToInt32(_stt.Text.Trim())) > 0)
            {
                _STT.Text = "Số thứ tự đã tồn tại";
                return;
            }
            else
            {
                _dt              = new T_Doituong();
                _dt.ID           = _id;
                _dt.Ma_Doituong  = _ma.Text.Trim();
                _dt.Ten_Doituong = _ten.Text.Trim();
                _dt.EnglishName  = _englishname.Text.Trim();
                if (!String.IsNullOrEmpty(_stt.Text.Trim()))
                {
                    _dt.STT = Convert.ToInt32(_stt.Text.Trim());
                }

                _dt.Ngaysua  = DateTime.Now;
                _dt.Nguoitao = _user.UserID;
                _dt.Ngaytao  = DateTime.Now;
                _dt.Nguoisua = _user.UserID;
                _return      = _dtDAL.InsertT_Doituong(_dt);

                action.Thaotac = "[Sửa đối tượng]-->[Mã đối tượng:" + _return.ToString() + " ]";
                actionDAL.InserT_Lichsu_Thaotac_Hethong(action);

                GVDoituong.EditIndex = -1;
                BindList_Doituong();
            }
        }
 public void UpdateRow_T_ActionHistory(T_Lichsu_Thaotac_Hethong _t_ActionHistory)
 {
     try
     {
         HPCDataProvider.Instance().UpdateObject(_t_ActionHistory);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemple #17
0
        protected void GVDoituong_OnRowCommand(object source, GridViewCommandEventArgs e)
        {
            HPCBusinessLogic.Lichsu_Thaotac_HethongDAL actionDAL = new Lichsu_Thaotac_HethongDAL();
            T_Lichsu_Thaotac_Hethong action = new T_Lichsu_Thaotac_Hethong();

            if (e.CommandName.Equals("AddNew"))
            {
                TextBox     _ma  = (TextBox)GVDoituong.FooterRow.FindControl("txt_MaDoituong");
                TextBox     _ten = (TextBox)GVDoituong.FooterRow.FindControl("txt_Tendoituong");
                TextBox     _stt = (TextBox)GVDoituong.FooterRow.FindControl("txt_STT");
                int         _return;
                DoituongDAL _doituongDAL = new DoituongDAL();
                if (_doituongDAL.Check_Madoituong(0, _ma.Text.Trim()) > 0)
                {
                    lblMessError.Text     = "Mã đối tượng đã tồn tại";
                    GVDoituong.ShowFooter = true;
                    BindList_Doituong();
                }
                else if (_doituongDAL.Check_STT(0, Convert.ToInt32(_stt.Text.Trim())) > 0)
                {
                    lblMessError.Text     = "Số thứ tự đã tồn tại";
                    GVDoituong.ShowFooter = true;
                    BindList_Doituong();
                }
                else
                {
                    _dt              = new T_Doituong();
                    _dt.ID           = 0;
                    _dt.Ma_Doituong  = _ma.Text.Trim();
                    _dt.Ten_Doituong = _ten.Text.Trim();
                    if (!String.IsNullOrEmpty(_stt.Text.Trim()))
                    {
                        _dt.STT = Convert.ToInt32(_stt.Text.Trim());
                    }

                    _dt.Ngaysua    = DateTime.Now;
                    _dt.Nguoitao   = _user.UserID;
                    _dt.Ngaytao    = DateTime.Now;
                    _dt.Nguoisua   = _user.UserID;
                    _return        = _doituongDAL.InsertT_Doituong(_dt);
                    action.Thaotac = "[Thêm mới đối tượng]-->[Mã mã đối tượng:" + _return.ToString() + " ]";
                    actionDAL.InserT_Lichsu_Thaotac_Hethong(action);
                    lblMessError.Text = "";
                    BindList_Doituong();
                    BinQuytrinhtheoAnPham();
                }

                UltilFunc.RunJavaScriptCode("$.fx.speeds._default = 10; var dlg = jQuery('#dialog').dialog({draggable: true,  resizable: true, hide: 'scale', modal: true, width: 500 }); dlg.parent().appendTo(jQuery('form:first'));");
            }
        }
        protected void Save_Click(object sender, EventArgs 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
            this.Page.Validate(vs_Themmoi.ValidationGroup);
            if (!Page.IsValid)
            {
                return;
            }
            HopdongDAL _hopdongDAL = new HopdongDAL();
            T_Hopdong  _hopdong    = SetItem();

            int menuID = 0;
            if (Request["ID"] != null && Request["ID"].ToString() != "" && Request["ID"].ToString() != String.Empty)
            {
                menuID = int.Parse(Request["ID"].ToString());
            }
            int _return = _hopdongDAL.InsertT_Hopdong(_hopdong);
            if (Page.Request.Params["id"] == null)
            {
                #region Update T_Yeucau khi da co hop dong --> Trangthai = 2

                HPCBusinessLogic.DAL.YeucauDAL _yeucauDAL = new HPCBusinessLogic.DAL.YeucauDAL();
                _yeucauDAL.UpdateinfoT_Yeucau(" [Trangthai] = 2 where ID = " + ddl_Yeucau.SelectedValue.ToString());

                #endregion
                action.Thaotac = "[Thêm mới hợp đồng]-->[mã hợp đồng:" + _return.ToString() + " ]";
                System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + Global.RM.GetString("VALIDATE_ADDNEWS") + "');", true);
                actionDAL.InserT_Lichsu_Thaotac_Hethong(action);
                Clear();
                BindCombo();
                return;
            }
            if (Page.Request.Params["id"] != null)
            {
                action.Thaotac = "[Sửa hợp đồng]-->[Mã hợp đồng:" + Page.Request["id"].ToString() + " ]";
                System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + Global.RM.GetString("UpdateSuccessfully") + "');", true);
                actionDAL.InserT_Lichsu_Thaotac_Hethong(action);
                Clear();
                BindCombo();
                return;
            }
        }
Exemple #19
0
        protected void GridViewPhongBan_RowDeleting(object sender, GridViewDeleteEventArgs 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(GridViewPhongBan.DataKeys[e.RowIndex].Value.ToString());
            _DAL.DeleteOneFromT_Phongban(_id);
            BindList_Phongban();
        }
Exemple #20
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();
     }
 }
Exemple #21
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();
 }
Exemple #22
0
        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();
            }
        }
Exemple #23
0
        protected void Save_Click(object sender, EventArgs 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
            this.Page.Validate(vs_Themmoi.ValidationGroup);
            if (!Page.IsValid)
            {
                return;
            }
            SobaoDAL        _sobaoDAL       = new SobaoDAL();
            Layout_SobaoDAL _layoutSobaoDAL = new Layout_SobaoDAL();
            T_Sobao         _sobao          = SetItem();

            int menuID = 0;
            if (Request["ID"] != null && Request["ID"].ToString() != "" && Request["ID"].ToString() != String.Empty)
            {
                menuID = int.Parse(Request["ID"].ToString());
            }
            int _return = _sobaoDAL.InsertT_Sobao(_sobao);
            if (Page.Request.Params["id"] == null)
            {
                _layoutSobaoDAL.AutoInsertT_Layout_Sobao(_return, Convert.ToInt32(ddl_AnPham.SelectedValue.ToString()));
                action.Thaotac = "[Thêm mới số báo]-->[mã số báo:" + _return.ToString() + " ]";
                System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + Global.RM.GetString("VALIDATE_ADDNEWS") + "');", true);
                actionDAL.InserT_Lichsu_Thaotac_Hethong(action);
                Clear();
                BindCombo();
                return;
            }
            if (Page.Request.Params["id"] != null)
            {
                action.Thaotac = "[Sửa số báo]-->[Mã số báo:" + Page.Request["id"].ToString() + " ]";
                System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + Global.RM.GetString("UpdateSuccessfully") + "');", true);
                actionDAL.InserT_Lichsu_Thaotac_Hethong(action);
                Clear();
                BindCombo();
                return;
            }
        }
 public void grdListCVCanLam_EditCommand(object source, DataGridCommandEventArgs 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
     CongviecDAL objDAL = new CongviecDAL();
     if (e.CommandArgument.ToString().ToLower() == "edit")
     {
         int cvID = Convert.ToInt32(this.grdListCVCanLam.DataKeys[e.Item.ItemIndex].ToString());
         Response.Redirect("~/Congviec/EditCongviec.aspx?Menu_ID=" + Page.Request["Menu_ID"].ToString() + "&ID=" + cvID);
     }
     if (e.CommandArgument.ToString().ToLower() == "delete")
     {
         //objDAL.DeleteOneFromT_Congviec(Convert.ToDouble(this.grdList.DataKeys[e.Item.ItemIndex].ToString()));
         //action.Thaotac = "[Xóa T_Congviec]-->[Thao tác Xóa Trong Bảng T_Congviec][ID:" + this.grdList.DataKeys[e.Item.ItemIndex].ToString() + " ]";
         //this.BindList_CongViec();
     }
     if (e.CommandArgument.ToString().ToLower() == "isedit")
     {
         int         cvID      = Convert.ToInt32(this.grdListCVCanLam.DataKeys[e.Item.ItemIndex].ToString());
         Label       lblStatus = (Label)e.Item.FindControl("lblStatus");
         CongviecDAL _dal      = new CongviecDAL();
         if (lblStatus != null)
         {
             if (lblStatus.Text == "1")
             {
                 _dal.UpdateStatusCongViec(cvID, 0);
                 action.Thaotac = "[Update T_Congviec]-->[Status = 0][ID:" + this.grdListCVCanLam.DataKeys[e.Item.ItemIndex].ToString() + " ]";
             }
             else
             {
                 _dal.UpdateStatusCongViec(cvID, 1);
                 action.Thaotac = "[Update T_Congviec]-->[Status = 1][ID:" + this.grdListCVCanLam.DataKeys[e.Item.ItemIndex].ToString() + " ]";
             }
         }
         BindList_CongViec();
     }
 }
        protected void Save_Click(object sender, EventArgs 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
            this.Page.Validate(vs_Themmoi.ValidationGroup);
            if (!Page.IsValid)
            {
                return;
            }
            HPCBusinessLogic.DAL.YeucauDAL _cvDAL = new HPCBusinessLogic.DAL.YeucauDAL();
            T_Yeucau _yc = SetItem();

            int menuID = 0;
            if (Request["ID"] != null && Request["ID"].ToString() != "" && Request["ID"].ToString() != String.Empty)
            {
                menuID = int.Parse(Request["ID"].ToString());
            }
            double _return = _cvDAL.InsertT_YecauQuangCao(_yc);
            if (Page.Request.Params["id"] == null)
            {
                action.Thaotac = "[Thêm mới yêu cầu phát hành]-->[mã yêu cầu:" + _return.ToString() + " ]";
                System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + Global.RM.GetString("VALIDATE_ADDNEWS") + "');", true);
                actionDAL.InserT_Lichsu_Thaotac_Hethong(action);
                Clear();
                BindCombo();
                return;
            }
            if (Page.Request.Params["id"] != null)
            {
                action.Thaotac = "[Sửa nội dung yêu cầu phát hành]-->[Mã yêu cầu:" + Page.Request["id"].ToString() + " ]";
                System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + Global.RM.GetString("UpdateSuccessfully") + "');", true);
                actionDAL.InserT_Lichsu_Thaotac_Hethong(action);
                Clear();
                BindCombo();
                return;
            }
        }
Exemple #26
0
        protected void Save_Click(object sender, EventArgs 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
            this.Page.Validate(vs_Themmoi.ValidationGroup);
            if (!Page.IsValid)
            {
                return;
            }
            ChucnangDAL _menuDAL = new ChucnangDAL();
            T_Chucnang  _menu    = SetItem();

            int menuID = 0;
            if (Request["ID"] != null && Request["ID"].ToString() != "" && Request["ID"].ToString() != String.Empty)
            {
                menuID = int.Parse(Request["ID"].ToString());
            }
            int _return = _menuDAL.Insert_T_Chucnang(_menu);
            if (Page.Request.Params["id"] == null)
            {
                action.Thaotac = "[Thêm mới Menu]-->[Thao tác Thêm][Menu_ID:" + _return.ToString() + " ]";

                actionDAL.InserT_Lichsu_Thaotac_Hethong(action);
                BindCombo();
                Clear();
                return;
            }
            if (Page.Request.Params["id"] != null)
            {
                action.Thaotac = "[Sửa Menu]-->[Thao tác sửa][Menu_ID:" + Page.Request["id"].ToString() + " ]";

                actionDAL.InserT_Lichsu_Thaotac_Hethong(action);
                BindCombo();
                Clear();
                return;
            }
        }
Exemple #27
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();
        }
Exemple #28
0
        protected void linkSave_Click(object sender, EventArgs e)
        {
            #region GhiLog

            HPCBusinessLogic.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.UserName;
            action.HostIP       = IpAddress();
            action.NgayThaotac  = DateTime.Now;
            #endregion
            this.Page.Validate(vs_Themmoi.ValidationGroup);
            if (!Page.IsValid)
            {
                return;
            }
            HPCBusinessLogic.DAL.NhomDAL _nhomnguoidungDAL = new HPCBusinessLogic.DAL.NhomDAL();
            T_Nhom _nhomnguoidung = SetItem();
            T_Nhom _isnhomnguoidung;
            int    groupID = 0;
            if (Request["ID"] != null && Request["ID"].ToString() != "" && Request["ID"].ToString() != String.Empty)
            {
                groupID = int.Parse(Request["ID"].ToString());
            }

            _isnhomnguoidung = _nhomnguoidungDAL.GetGroupName(_nhomnguoidung.Ten_Nhom, groupID);
            if (_isnhomnguoidung != null)
            {
                FuncAlert.AlertJS(this, CommonLib.ReadXML("lblNhomdatontai"));
                return;
            }
            int _return = _nhomnguoidungDAL.Insert_T_Group(_nhomnguoidung);
            if (Page.Request.Params["id"] == null)
            {
                action.Thaotac = "[Thêm mới Group]-->[Thao tác Thêm][ID:" + _return.ToString() + " ]";
            }
            else
            {
                action.Thaotac = "[Sửa Group]-->[Thao tác Sửa][ID:" + Page.Request.Params["id"].ToString() + " ]";
            }
            actionDAL.InserT_Lichsu_Thaotac_Hethong(action);
        }
        protected void GVKichthuoc_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(GVKichthuoc.DataKeys[e.RowIndex].Value.ToString());

            TextBox      _ten       = (TextBox)GVKichthuoc.Rows[e.RowIndex].FindControl("txt_Kichthuoc");
            TextBox      _mota      = (TextBox)GVKichthuoc.Rows[e.RowIndex].FindControl("txt_mota");
            DropDownList _ddlAnpham = (DropDownList)GVKichthuoc.Rows[e.RowIndex].FindControl("ddl_AnPham");

            KichthuocDAL _ktDAL = new KichthuocDAL();
            _kt = new T_Kichthuoc();
            _kt.Ma_Kichthuoc  = _id;
            _kt.Ten_Kichthuoc = _ten.Text.Trim();
            _kt.Mota          = _mota.Text.Trim();
            if (Convert.ToInt32(_ddlAnpham.SelectedValue.ToString()) > 0)
            {
                _kt.Ma_Anpham = Convert.ToInt32(_ddlAnpham.SelectedValue.ToString());
            }
            else
            {
                _kt.Ma_Anpham = 0;
            }
            _kt.Ngaysua  = DateTime.Now;
            _kt.Nguoitao = _user.UserID;
            _kt.Ngaytao  = DateTime.Now;
            _kt.Nguoisua = _user.UserID;
            _return      = _ktDAL.InsertT_Kichthuoc(_kt);

            action.Thaotac = "[Sửa kích thước]-->[Mã kích thước:" + _return.ToString() + " ]";
            actionDAL.InserT_Lichsu_Thaotac_Hethong(action);

            GVKichthuoc.EditIndex = -1;
            BindList_Kichthuoc();
        }
Exemple #30
0
        protected void GVAnphamMau_RowDeleting(object sender, GridViewDeleteEventArgs 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(GVAnphamMau.DataKeys[e.RowIndex].Value);
            AnPhamMauDAL _apDAL = new AnPhamMauDAL();
            _apDAL.DeleteOneFromT_Anphammau(_id);

            action.Thaotac = "[Xóa ấn phẩm mẫu]-->[Mã ấn phẩm mẫu:" + _id.ToString() + " ]";
            actionDAL.InserT_Lichsu_Thaotac_Hethong(action);

            BindList_AnphamMau();
        }