Example #1
0
        public ArrayList GetAllFrom_T_GroupInUser(string pane, int id)
        {
            UltilFunc _untilDAL = new UltilFunc();
            ArrayList _arr      = new ArrayList();
            DataTable _dt;

            try
            {
                _dt = _untilDAL.GetStoreDataSet("GetAllFrom_T_GroupInUser", new string[] { "@User_ID" }, new object[] { id }).Tables[0];

                if (_dt.Rows.Count > 0)
                {
                    for (int i = 0; i < _dt.Rows.Count; i++)
                    {
                        T_Nhom g = new T_Nhom();
                        if (_dt.Rows[i]["Ma_Nhom"] != DBNull.Value)
                        {
                            g.Ma_Nhom = Convert.ToInt32(_dt.Rows[i]["Ma_Nhom"]);
                        }
                        if (_dt.Rows[i]["Ten_Nhom"] != DBNull.Value)
                        {
                            g.Ten_Nhom = Convert.ToString(_dt.Rows[i]["Ten_Nhom"]);
                        }
                        _arr.Add(g);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(_arr);
        }
Example #2
0
        private void PopulateItem(int _id)
        {
            T_Nhom _objSet = new T_Nhom();

            HPCBusinessLogic.DAL.NhomDAL _groupDAL = new HPCBusinessLogic.DAL.NhomDAL();
            _objSet           = _groupDAL.GetOneFromT_NhomByID(_id);
            this.txtName.Text = _objSet.Ten_Nhom;
            this.txtDesc.Text = _objSet.MoTa;
        }
Example #3
0
 public void UpdateRow_T_Nhom(T_Nhom _T_Nhom)
 {
     try
     {
         HPCDataProvider.Instance().UpdateObject(_T_Nhom);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #4
0
 public void InsertT_Nhom(T_Nhom _T_Nhom)
 {
     try
     {
         HPCDataProvider.Instance().InsertObject(_T_Nhom);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #5
0
        private T_Nhom SetItem()
        {
            T_Nhom _obj = new T_Nhom();

            if (Page.Request.Params["id"] != null)
            {
                _obj.Ma_Nhom = int.Parse(Page.Request["id"].ToString());
            }
            else
            {
                _obj.Ma_Nhom = 0;
            }
            _obj.Ten_Nhom = this.txtName.Text.Trim();
            _obj.MoTa     = this.txtDesc.Text.Trim();
            _obj.NgayTao  = DateTime.Now;

            return(_obj);
        }
Example #6
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);
        }
Example #7
0
 public int Insert_T_Group(T_Nhom obj)
 {
     return(HPCDataProvider.Instance().InsertObjectReturn(obj, "Sp_InsertT_Nhom"));
 }