Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            groupInfo = GroupDB.GetInfo(ConvertUtility.ToInt32(Request.QueryString["groupid"]));
            if (groupInfo == null)
            {
                Response.Redirect(AppEnv.ADMIN_PATH);
            }

            txtGroupName.Text    = groupInfo.Group_Name;
            lblUpdateStatus.Text = string.Empty;
            if (!IsPostBack)
            {
                lstRoles.Items.Clear();
                CmdDB.FillToListBox(lstRoles.Items);
            }
        }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            groupInfo = GroupDB.GetInfo(ConvertUtility.ToInt32(Request.QueryString["groupid"]));
            if (groupInfo == null)
            {
                Response.Redirect(AppEnv.ADMIN_PATH);
            }

            txtGroupName.Text    = groupInfo.Group_Name;
            lblUpdateStatus.Text = string.Empty;
            if (!IsPostBack)
            {
                lstUsers.DataSource     = UserDB.GetAll();
                lstUsers.DataTextField  = "User_Email";
                lstUsers.DataValueField = "User_ID";
                lstUsers.DataBind();
            }
        }
Beispiel #3
0
        protected void cmdUpdate_Click(object sender, EventArgs e)
        {
            GroupInfo info = GroupDB.GetInfo(ConvertUtility.ToInt32(txtID.Text));

            if (info == null)
            {
                return;
            }

            info.Group_Name        = txtName.Text.Trim();
            info.Group_Description = txtDes.Text;
            try
            {
                GroupDB.Update(info);
                lblUpdateStatus.Text = MiscUtility.UPDATE_SUCCESS;
            }
            catch
            {
                lblUpdateStatus.Text = MiscUtility.UPDATE_ERROR;
            }
        }
Beispiel #4
0
 protected void dtgGroups_ItemCommand(object source, DataGridCommandEventArgs e)
 {
     if (e.CommandName == "edit")
     {
         GroupInfo group = GroupDB.GetInfo(Convert.ToInt32(e.Item.Cells[0].Text));
         if (group == null)
         {
             cmdEmpty_Click(null, null);
             return;
         }
         txtID.Text   = group.Group_ID.ToString();
         txtName.Text = group.Group_Name;
         txtDes.Text  = group.Group_Description;
     }
     if (e.CommandName == "del")
     {
         try
         {
             GroupDB.Delete(Convert.ToInt32(e.Item.Cells[0].Text));
             lblUpdateStatus.Text = MiscUtility.UPDATE_SUCCESS;
             cmdEmpty_Click(null, null);
         }
         catch
         {
             lblUpdateStatus.Text = MiscUtility.UPDATE_ERROR;
         }
     }
     if (e.CommandName == "roles")
     {
         Response.Redirect(AppEnv.ADMIN_CMD + "maingroupcmdroles&groupid=" + e.Item.Cells[0].Text);
     }
     if (e.CommandName == "members")
     {
         Response.Redirect(AppEnv.ADMIN_CMD + "maingroupmembers&groupid=" + e.Item.Cells[0].Text);
     }
     if (e.CommandName == "stores")
     {
         Response.Redirect(AppEnv.ADMIN_CMD + "cmdusergroupstoremanagement&groupid=" + e.Item.Cells[0].Text);
     }
 }