Beispiel #1
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void DeleteButton_Click(object sender, EventArgs e)
        {
            bool deleted = false;

            using (iiUser userProvider = new iiUser())
            {
                foreach (GridViewRow row in List.Rows)
                {
                    HtmlInputCheckBox rowCheckControl = (HtmlInputCheckBox)row.FindControl("RowCheck");
                    if (rowCheckControl.Checked)
                    {
                        try
                        {
                            //删除
                            userProvider.Delete(List.DataKeys[row.RowIndex]["ID"].ToString().Trim());
                        }
                        catch (Exception error)
                        {
                            this.ShowErrorMessage(this.GetGlobalResourceString("DeleteErrorMessage") + error.Message);
                            return;
                        }
                        //有项被删除
                        deleted = true;
                    }
                }
            }
            if (deleted)
            {
                this.BindList();
            }
            else
            {
                this.ShowInfoMessage(this.GetGlobalResourceString("NotSelectMessage"));
            }
        }
Beispiel #2
0
 /// <summary>
 /// 绑定列表
 /// </summary>
 private void BindList()
 {
     using (iiUser userProvider = new iiUser())
     {
         List.DataSource = userProvider.GetList(
             UID.Text, Name.Text, Remark.Text,
             string.Empty, string.Empty, string.Empty, string.Empty, string.Empty,
             RoleSelector1.RIDList
             );
     }
     List.DataBind();
 }
Beispiel #3
0
 /// <summary>
 /// 确定
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void OKButton_Click(object sender, EventArgs e)
 {
     using (iiUser userProvider = new iiUser())
     {
         if (this.CurrentID.Length == 0)
         {
             //新增
             if (userProvider.GetItem(UID.Text) == null) //不存在
             {
                 try
                 {
                     userProvider.Create(UID.Text, Name.Text, Password.Text, Remark.Text,
                                         string.Empty, string.Empty, string.Empty, string.Empty, string.Empty,
                                         RoleSelector1.RIDList
                                         );
                 }
                 catch (Exception error)
                 {
                     this.ShowErrorMessage(this.GetGlobalResourceString("CreateErrorMessage") + error.Message);
                     return;
                 }
             }
             else
             {
                 this.ShowWarningMessage(this.GetGlobalResourceString("ExistedErrorMessage"));
                 return;
             }
         }
         else
         {
             //编辑
             try
             {
                 if (Password.Text.Length != 0) //要修改密码
                 {
                     userProvider.Update(UID.Text, Password.Text);
                 }
                 userProvider.Update(UID.Text, Name.Text, Remark.Text,
                                     string.Empty, string.Empty, string.Empty, string.Empty, string.Empty,
                                     RoleSelector1.RIDList
                                     );
             }
             catch (Exception error)
             {
                 this.ShowErrorMessage(this.GetGlobalResourceString("UpdateErrorMessage") + error.Message);
                 return;
             }
         }
     }
     //回调
     this.DialogCallback("'CloseRefresh'", "window");
 }
Beispiel #4
0
 /// <summary>
 /// 确定
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void OKButton_Click(object sender, EventArgs e)
 {
     using (iiUser userProvider = new iiUser())
     {
         try
         {
             userProvider.Update(UID.Text, NewPassword.Text);
         }
         catch (Exception error)
         {
             this.ShowErrorMessage(this.GetGlobalResourceString("UpdateErrorMessage") + error.Message);
             return;
         }
     }
     this.ShowInfoMessage(this.GetGlobalResourceString("PasswordChangedMessage"));
 }
Beispiel #5
0
        /// <summary>
        /// 绑定项目
        /// </summary>
        private void BindItem()
        {
            DataRow user;

            using (iiUser userProvider = new iiUser())
            {
                user = userProvider.GetItem(this.CurrentID);
            }

            UID.Text    = user["ID"].ToString().Trim();
            UID.Enabled = false;
            Name.Text   = user["Name"].ToString();
            Remark.Text = user["Remark"].ToString();
            //角色
            RoleSelector1.RIDList = user["RIDList"].ToString();
            RoleSelector1.Enabled = (user["Status"].ToString().Trim() != "S");
        }