private List <SYS_GROUP> MapSYS_GROUP(DataTable dt)
        {
            List <SYS_GROUP> rs = new List <SYS_GROUP>();

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                SYS_GROUP obj = new SYS_GROUP();
                if (dt.Columns.Contains("Group_ID"))
                {
                    obj.Group_ID = dt.Rows[i]["Group_ID"].ToString();
                }
                if (dt.Columns.Contains("Group_Name"))
                {
                    obj.Group_Name = dt.Rows[i]["Group_Name"].ToString();
                }
                if (dt.Columns.Contains("Group_NameEn"))
                {
                    obj.Group_NameEn = dt.Rows[i]["Group_NameEn"].ToString();
                }
                if (dt.Columns.Contains("Description"))
                {
                    obj.Description = dt.Rows[i]["Description"].ToString();
                }
                if (dt.Columns.Contains("Active"))
                {
                    obj.Active = bool.Parse(dt.Rows[i]["Active"].ToString());
                }

                rs.Add(obj);
            }
            return(rs);
        }
 public frmCapNhatPhanQuyen(string Group_ID)
 {
     InitializeComponent();
     objSYS_GROUP              = new SYS_GROUPController().SYS_GROUP_Get(Group_ID);
     txtGroup_ID.Text          = objSYS_GROUP.Group_ID;
     txtGroup_Name.Text        = objSYS_GROUP.Group_Name;
     chk_Active.Checked        = objSYS_GROUP.Active;
     txtGroup_Description.Text = objSYS_GROUP.Description;
     HienThiVaiTro(treeList1, Group_ID);
 }
Exemple #3
0
        public void UpdateRow(SYS_USER Item, CHBK2014_N9.Common.Class.RowClickEventArgs e)
        {
            AdvBandedGridView advBandedGridView = this.gbList;
            int rowIndex = e.RowIndex;

            advBandedGridView.SetRowCellValue(rowIndex, "Active", Item.Active);
            advBandedGridView.SetRowCellValue(rowIndex, "UserID", Item.UserID);
            advBandedGridView.SetRowCellValue(rowIndex, "UserName", Item.UserName);
            SYS_GROUP sYSGROUP = new SYS_GROUP();

            sYSGROUP.Get(Item.Group_ID);
            advBandedGridView.SetRowCellValue(rowIndex, "Role_Name", sYSGROUP.Group_Name);
            advBandedGridView.SetRowCellValue(rowIndex, "EmployeeCode", Item.EmployeeCode);
            advBandedGridView.SetRowCellValue(rowIndex, "Description", Item.Description);
            advBandedGridView.SetRowCellValue(rowIndex, "Active", Item.Active);
            advBandedGridView.UpdateCurrentRow();
        }
 public int SYS_GROUP_Insert(SYS_GROUP obj)
 {
     try
     {
         return(DataProvider.ExecuteNonquery(DataProvider.ConnectionString, "SYS_GROUP_Insert",
                                             obj.Group_ID,
                                             obj.Group_Name,
                                             obj.Group_NameEn,
                                             obj.Description,
                                             obj.Active
                                             ));
     }
     catch
     {
         //throw ex;
         return(-1);
     }
 }
Exemple #5
0
        public void AddRow(SYS_USER Item)
        {
            AdvBandedGridView advBandedGridView = this.gbList;
            int focusedRowHandle = advBandedGridView.FocusedRowHandle;

            advBandedGridView.AddNewRow();
            focusedRowHandle = advBandedGridView.FocusedRowHandle;
            advBandedGridView.SetRowCellValue(focusedRowHandle, "Active", Item.Active);
            advBandedGridView.SetRowCellValue(focusedRowHandle, "UserID", Item.UserID);
            advBandedGridView.SetRowCellValue(focusedRowHandle, "UserName", Item.UserName);
            SYS_GROUP sYSGROUP = new SYS_GROUP();

            sYSGROUP.Get(Item.Group_ID);
            advBandedGridView.SetRowCellValue(focusedRowHandle, "Role_Name", sYSGROUP.Group_Name);
            advBandedGridView.SetRowCellValue(focusedRowHandle, "EmployeeCode", Item.EmployeeCode);
            advBandedGridView.SetRowCellValue(focusedRowHandle, "Description", Item.Description);
            advBandedGridView.SetRowCellValue(focusedRowHandle, "Active", Item.Active);
            advBandedGridView.UpdateCurrentRow();
        }