/// <summary>
        /// 批量删除权限数据
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            List <int> idlist = GetSelIDlist();

            if (idlist.Count == 0)
            {
                return;
            }
            string tipmsg = Resources.Site.TooltipDelOK;

            foreach (int id in idlist)
            {
                try
                {
                    bllPerm.Delete(id);
                }
                catch
                {
                    tipmsg = id.ToString() + "," + tipmsg;
                }
            }
            if (tipmsg != Resources.Site.TooltipDelOK)
            {
                tipmsg += Resources.Site.TooltipUpdateError;
            }
            YSWL.Common.MessageBox.ShowSuccessTip(this, tipmsg);
            LogHelp.AddUserLog(CurrentUser.UserName, CurrentUser.UserType, "批量删除权限数据", this);
            gridView.OnBind();
        }
        /// <summary>
        /// 保存操作
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void btnSave_Click(object sender, System.EventArgs e)
        {
            if (txtPayFree.Text.Trim() == "")
            {
                YSWL.Common.MessageBox.ShowSuccessTip(this, string.Format("设置费率{0}!", ""));
                return;
            }

            PayFreeModel.AgentID   = int.Parse(lbAgentId.Text);
            PayFreeModel.PayModeId = int.Parse(lbPayModelid.Text);
            PayFreeModel.FeeRate   = decimal.Parse(txtPayFree.Text);



            if (lbType.Text == "0")
            {
                //开通通道
                if (PayFreeBll.Add(PayFreeModel))
                {
                    YSWL.Common.MessageBox.ShowSuccessTip(this, string.Format("开通代理商通道成功,费率:【{0}】!", txtPayFree.Text));
                    LogHelp.AddUserLog(CurrentUser.UserName, CurrentUser.UserType, string.Format(" 代理商" + lbAgentId.Text + " ,设置费率:【{0}】", txtPayFree.Text), this);
                    Response.Redirect("AgentPayFeeList.aspx?AgentId=" + lbAgentId.Text + "");
                }
            }
            else
            {
                if (PayFreeBll.Update(PayFreeModel))
                {
                    YSWL.Common.MessageBox.ShowSuccessTip(this, string.Format("修改费率:【{0}】成功!", txtPayFree.Text));
                    LogHelp.AddUserLog(CurrentUser.UserName, CurrentUser.UserType, string.Format(" 代理商" + lbAgentId.Text + " ,设置费率:【{0}】", txtPayFree.Text), this);
                    Response.Redirect("AgentPayFeeList.aspx?AgentId=" + lbAgentId.Text + "");
                }
            }
        }
Exemple #3
0
        }                                                          //系统管理_用户类别管理_新增页面
        public void btnSave_Click(object sender, System.EventArgs e)
        {
            UserType newUserType = new UserType();
            string   userType    = txtUserType.Text.Trim();

            byte[] sarr = System.Text.Encoding.GetEncoding("gb2312").GetBytes(userType);
            if (sarr.Length > 2)
            {
                YSWL.Common.MessageBox.ShowFailTip(this, "输入的用户类型不能超过两个字符");
                return;
            }
            string description = txtDescription.Text.Trim();

            if (string.IsNullOrWhiteSpace(userType) || string.IsNullOrWhiteSpace(description))
            {
                return;
            }

            string  strErr  = "";
            DataSet dataSet = newUserType.GetList("UserType='" + YSWL.Common.InjectionFilter.SqlFilter(userType) + "'");

            if (dataSet != null && dataSet.Tables[0].Rows.Count > 0)
            {
                strErr += Resources.Site.TooltipUserTypeExist;
            }
            if (strErr != "")
            {
                YSWL.Common.MessageBox.ShowSuccessTip(this, strErr);
                return;
            }
            newUserType.Add(userType, description);
            LogHelp.AddUserLog(CurrentUser.UserName, CurrentUser.UserType, string.Format("新增用户类别用户类别:【{0}】", userType), this);
            YSWL.Common.MessageBox.ResponseScript(this, "parent.location.href='UserTypeAdmin.aspx'");
            //Response.Redirect("UserTypeAdmin.aspx");
        }
Exemple #4
0
        protected void btnSave_Click(object sender, System.EventArgs e)
        {
            UserType newUserType = new UserType();
            string   userType    = txtUserType.Text.Trim();
            string   description = txtDescription.Text.Trim();

            if (string.IsNullOrWhiteSpace(userType) || string.IsNullOrWhiteSpace(description))
            {
                return;
            }

            //string strErr = "";
            //if (newUserType.Exists(userType, description))
            //{
            //    strErr += Resources.Site.TooltipUserTypeExist;
            //}
            //if (strErr != "")
            //{
            //    YSWL.Common.MessageBox.ShowSuccessTip(this, strErr);
            //    return;
            //}
            newUserType.Update(userType, description);
            LogHelp.AddUserLog(CurrentUser.UserName, CurrentUser.UserType, string.Format("编辑用户类别用户类别:【{0}】", userType), this);
            this.btnCancle.Enabled = false;
            this.btnSave.Enabled   = false;
            YSWL.Common.MessageBox.ResponseScript(this, "parent.location.href='UserTypeAdmin.aspx'");
            //Response.Redirect("UserTypeAdmin.aspx");
        }
Exemple #5
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (txtDescription.Text.Trim().Length > 0)
            {
                if (bll.Exists(txtDescription.Text.Trim()))
                {
                    YSWL.Common.MessageBox.ShowFailTip(this, Resources.Site.TooltipDataExist);
                    return;
                }
                else
                {
                    if (DropListPermissions.SelectedIndex > 0)
                    {
                        bll.Add(txtDescription.Text.Trim(), Convert.ToInt32(DropListPermissions.SelectedValue));
                    }
                    else
                    {
                        bll.Add(txtDescription.Text.Trim());
                    }

                    gridView.OnBind();
                }
            }
            LogHelp.AddUserLog(CurrentUser.UserName, CurrentUser.UserType, string.Format("新增功能行为:【{0}】", txtDescription.Text.Trim()), this);
        }
Exemple #6
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     if (txtRoleName.Text.Trim().Length <= 0)
     {
         YSWL.Common.MessageBox.ShowFailTip(this, Resources.SysManage.ErrorRoleIsNull);
         return;
     }
     try
     {
         Role role = new Role();
         if (!role.RoleExists(txtRoleName.Text.Trim()))
         {
             role.Description = txtRoleName.Text;
             role.Create();
             LogHelp.AddUserLog(CurrentUser.UserName, CurrentUser.UserType, string.Format("新增角色:【{0}】", txtRoleName.Text), this);
             YSWL.Common.MessageBox.ShowSuccessTip(this, Resources.Site.TooltipSaveOK);
         }
         else
         {
             YSWL.Common.MessageBox.ShowFailTip(this, Resources.Site.TooltipDataExist);
         }
     }
     catch (Exception ex)
     {
         lblToolTip.Text = ex.Message;
         return;
     }
     txtRoleName.Text = "";
     dataBind();
 }
Exemple #7
0
 protected void btnDeleteAll_Click(object sender, EventArgs e)
 {
     ColoPay.BLL.SysManage.ErrorLog.DeleteByDate(Globals.SafeDateTime((txtDate.Text), DateTime.Now));
     gridView.OnBind();
     LogHelp.AddUserLog(CurrentUser.UserName, CurrentUser.UserType, string.Format("批量删除【{0}】之前的错误日志", txtDate.Text), this);
     MessageBox.ShowSuccessTip(this, Resources.Site.TooltipDelOK);
 }
Exemple #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session[YSWL.Common.Globals.SESSIONKEY_ADMIN] != null)
            {
                YSWL.Accounts.Bus.User currentUser = (YSWL.Accounts.Bus.User)Session[YSWL.Common.Globals.SESSIONKEY_ADMIN];

                LogHelp.AddUserLog(currentUser.UserName, currentUser.UserType, "退出系统", this);

                #region 更新最新的登录时间
                ColoPay.BLL.Members.UsersExp uBll   = new BLL.Members.UsersExp();
                Model.Members.UsersExpModel  uModel = new Model.Members.UsersExpModel();
                uModel = uBll.GetUsersExpModel(currentUser.UserID);
                if (uModel != null)
                {
                    uModel.LastAccessIP  = Request.UserHostAddress;
                    uModel.LastLoginTime = DateTime.Now;
                    uBll.Update(uModel);
                }
                #endregion
            }
            FormsAuthentication.SignOut();
            Session.Remove(Globals.SESSIONKEY_ADMIN);
            Session.Clear();
            Session.Abandon();
            Response.Clear();
            Response.Write("<script language='javascript'>window.top.location='" + defaullogin + "'</script>");
            Response.End();
        }
Exemple #9
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (txtKeyName.Text.Trim() == "")
            {
                lblToolTip.ForeColor = Color.Red;
                lblToolTip.Text      = Resources.SysManage.ErrorKeyNameNotNull;
                return;
            }
            if (txtValue.Text.Trim() == "")
            {
                lblToolTip.ForeColor = Color.Red;
                lblToolTip.Text      = Resources.SysManage.ErrorValueNotNull;
                return;
            }
            if (txtDescription.Text.Trim() == "")
            {
                lblToolTip.ForeColor = Color.Red;
                lblToolTip.Text      = Resources.SysManage.fieldDescription + Resources.SysManage.ErrorContentNotNull;
                return;
            }

            ColoPay.BLL.SysManage.ConfigSystem.Add(txtKeyName.Text.Trim(),
                                                   txtValue.Text.Trim(), txtDescription.Text.Trim(),
                                                   YSWL.Common.Globals.SafeEnum(
                                                       dropConfigType.SelectedValue, Model.SysManage.ApplicationKeyType.System));
            MessageBox.ShowSuccessTip(this, Resources.Site.TooltipAddSuccess);

            LogHelp.AddUserLog(CurrentUser.UserName, CurrentUser.UserType, string.Format("新增系统参数:【{0}】", txtKeyName.Text.Trim()), this);
            gridView.OnBind();
            lblToolTip.Text     = "";
            txtKeyName.Text     = "";
            txtValue.Text       = "";
            txtDescription.Text = "";
        }
Exemple #10
0
        protected void gridView_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            string        ID         = gridView.DataKeys[e.RowIndex].Value.ToString();
            List <string> UserIDlist = YSWL.Common.StringPlus.GetStrArray(BLL.SysManage.ConfigSystem.GetValueByCache("AdminUserID"), ',', true);

            if (UserIDlist.Contains(ID))
            {
                YSWL.Common.MessageBox.ShowFailTip(this, Resources.Site.ErrorCannotDeleteID);
                return;
            }
            try
            {
                User User2 = new User(int.Parse(ID));
                ColoPay.BLL.Members.Users userBll = new BLL.Members.Users();
                userBll.DeleteEx(int.Parse(ID));

                LogHelp.AddUserLog(CurrentUser.UserName, CurrentUser.UserType, string.Format("删除用户:【{0}】", User2.UserName), this);
                YSWL.Common.MessageBox.ShowSuccessTip(this, "删除成功!");
                gridView.OnBind();
            }
            catch (System.Data.SqlClient.SqlException ex)
            {
                if (ex.Number == 547)
                {
                    YSWL.Common.MessageBox.ShowFailTip(this, Resources.Site.ErrorCannotDeleteUser);
                }
            }
        }
Exemple #11
0
 protected void DropListPermissions2_Changed(object sender, EventArgs e)
 {
     if (DropListCategory2.SelectedIndex > 0)
     {
         if (DropListPermissions2.SelectedIndex <= 0)
         {
             YSWL.Common.MessageBox.ShowFailTip(this, Resources.Site.TooltripPer);
             return;
         }
         string idlist = GetSelIDlist();
         if (idlist.Length > 0)
         {
             if ((DropListPermissions2.SelectedItem != null) && (DropListPermissions2.SelectedValue.Length > 0))
             {
                 bll.AddPermission(idlist, Convert.ToInt32(DropListPermissions2.SelectedValue));
             }
             gridView.OnBind();
             YSWL.Common.MessageBox.ShowSuccessTip(this, Resources.Site.TooltipSaveOK);
         }
         else
         {
             YSWL.Common.MessageBox.ShowFailTip(this, Resources.Site.TooltripPerNum);
         }
         LogHelp.AddUserLog(CurrentUser.UserName, CurrentUser.UserType, "批量设置功能行为的权限", this);
     }
     else
     {
         YSWL.Common.MessageBox.ShowFailTip(this, Resources.Site.TooltripPer);
     }
 }
Exemple #12
0
        protected void gridView_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            int ID = (int)gridView.DataKeys[e.RowIndex].Value;

            bll.DelTreeNode(ID);
            LogHelp.AddUserLog(CurrentUser.UserName, CurrentUser.UserType, "删除菜单", this);
            gridView.OnBind();
        }
Exemple #13
0
        protected void gridView_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            int ID = (int)gridView.DataKeys[e.RowIndex].Value;

            ColoPay.BLL.SysManage.ConfigSystem.Delete(ID);
            LogHelp.AddUserLog(CurrentUser.UserName, CurrentUser.UserType, "删除系统参数", this);
            gridView.OnBind();
            MessageBox.ShowSuccessTip(this, Resources.Site.TooltipDelOK);
        }
Exemple #14
0
        public void btnSave_Click(object sender, System.EventArgs e)
        {
            User   newUser = new User();
            string strErr  = "";

            if (newUser.HasUserByUserName(txtUserName.Text))
            {
                strErr += Resources.Site.TooltipUserExist;
            }
            if (strErr != "")
            {
                YSWL.Common.MessageBox.ShowSuccessTip(this, strErr);
                return;
            }
            newUser.UserName = txtUserName.Text;
            newUser.Password = AccountsPrincipal.EncryptPassword(txtPassword.Text);
            newUser.NickName = newUser.UserName;    //昵称和用户名相同 SNS模块使用
            newUser.TrueName = txtTrueName.Text;
            newUser.Sex      = "1";
            //if (RadioButton1.Checked)
            //    newUser.Sex = "1";//男
            //else
            //    newUser.Sex = "0";//女
            newUser.Phone      = txtPhone.Text.Trim();
            newUser.Email      = txtEmail.Text;
            newUser.EmployeeID = 0;
            //newUser.DepartmentID=this.Dropdepart.SelectedValue;
            newUser.Activity        = true;
            newUser.UserType        = radbtnlistUserType.SelectedValue;
            newUser.Style           = 1;
            newUser.User_dateCreate = DateTime.Now;
            newUser.User_iCreator   = CurrentUser.UserID;
            newUser.User_dateValid  = DateTime.Now;
            newUser.User_cLang      = "zh-CN";

            int userid = newUser.Create();

            if (userid == -100)
            {
                //ERROR
                YSWL.Common.MessageBox.ShowSuccessTip(this, Resources.Site.TooltipUserExist);
                return;
            }
            UsersExp bllUsersExp = new UsersExp();

            bllUsersExp.Add(new UsersExpModel
            {
                UserID         = userid,
                LastAccessTime = DateTime.Now,
                LastLoginTime  = DateTime.Now,
                LastPostTime   = DateTime.Now
            });
            LogHelp.AddUserLog(CurrentUser.UserName, CurrentUser.UserType, string.Format("新增用户:【{0}】", txtUserName.Text), this);
            Response.Redirect("RoleAssignment.aspx?UserID=" + userid);
        }
Exemple #15
0
 protected void btnSaveType_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrWhiteSpace(txtTypeName.Text.Trim()))
     {
         BLL.SysManage.ConfigType bllCT = new BLL.SysManage.ConfigType();
         bllCT.Add(txtTypeName.Text.Trim());
         LogHelp.AddUserLog(CurrentUser.UserName, CurrentUser.UserType, string.Format("新增参数类别:【{0}】", txtTypeName.Text.Trim()), this);
         txtTypeName.Text = "";
         BindConfigType();
     }
 }
Exemple #16
0
        public void BtnUpName_Click(object sender, EventArgs e)
        {
            string newname = this.TxtNewname.Text.Trim();

            currentRole             = new Role(Convert.ToInt32(lblRoleID.Text));
            currentRole.Description = newname;
            currentRole.Update();
            DoInitialDataBind();
            LogHelp.AddUserLog(CurrentUser.UserName, CurrentUser.UserType, string.Format("编辑角色:【{0}】", newname), this);
            lblTiptool.Text = Resources.Site.TooltipUpdateOK;// "修改成功!";
        }
Exemple #17
0
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            string idlist = GetSelIDlist(); if (idlist.Trim().Length == 0)

            {
                return;
            }

            ColoPay.BLL.SysManage.UserLog.Delete(idlist);
            LogHelp.AddUserLog(CurrentUser.UserName, CurrentUser.UserType, "批量删除用户日志", this);
            gridView.OnBind();
        }
Exemple #18
0
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            string idlist = GetSelIDlist(); if (idlist.Trim().Length == 0)

            {
                return;
            }

            bll.DelTreeNodes(idlist);

            LogHelp.AddUserLog(CurrentUser.UserName, CurrentUser.UserType, "批量删除菜单", this);
            gridView.OnBind();
        }
Exemple #19
0
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            string idlist = GetSelIDlist();

            if (idlist.Trim().Length == 0)
            {
                return;
            }
            ColoPay.BLL.SysManage.ErrorLog.Delete(idlist);

            LogHelp.AddUserLog(CurrentUser.UserName, CurrentUser.UserType, "批量删除错误日志", this);
            gridView.OnBind();
            MessageBox.ShowSuccessTip(this, Resources.Site.TooltipDelOK);
        }
Exemple #20
0
        public void RemoveRoleButton_Click(object sender, System.EventArgs e)
        {
            if (ReservedRoleIDs.Contains(lblRoleID.Text))
            {
                YSWL.Common.MessageBox.ShowSuccessTip(this, Resources.Site.ErrorCannotDeleteRole);
                return;
            }
            int  currentRole = Convert.ToInt32(lblRoleID.Text);
            Role bizRole     = new Role(currentRole);

            bizRole.Delete();
            LogHelp.AddUserLog(CurrentUser.UserName, CurrentUser.UserType, string.Format("删除角色:【{0}】", this.TxtNewname.Text.Trim()), this);
            Server.Transfer("RoleAdmin.aspx");
        }
Exemple #21
0
        public void gridView_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            string id          = gridView.DataKeys[e.RowIndex].Values[0].ToString();
            string Description = ((TextBox)gridView.Rows[e.RowIndex].FindControl("TBDescription")).Text;

            if (Description == "")
            {
                YSWL.Common.MessageBox.ShowFailTip(this, Resources.Site.TooltipNoNull);
                return;
            }
            bllPerm.Update(int.Parse(id), Description);
            LogHelp.AddUserLog(CurrentUser.UserName, CurrentUser.UserType, string.Format("编辑权限数据:【{0}】", Description), this);
            gridView.EditIndex = -1;
            gridView.OnBind();
        }
 protected void gridView_RowDeleting(object sender, GridViewDeleteEventArgs e)
 {
     /*权限配置开始*/
     if (!UserPrincipal.HasPermissionID(GetPermidByActID(Act_DelData)) && GetPermidByActID(Act_DelData) != -1)//删除数据-单个
     {
         gridView.OnBind();
         return;
     }
     /*权限配置结束*/
     #warning 代码生成警告:请检查确认真实主键的名称和类型是否正确
     int ID = (int)gridView.DataKeys[e.RowIndex].Value;
     /*增加日志*/ LogHelp.AddUserLog(CurrentUser.UserName, CurrentUser.UserType, string.Format("Delete:【{0}】", new JavaScriptSerializer().Serialize(bll.GetModel(ID))), this);
     bll.Delete(ID);
     gridView.OnBind();
 }
Exemple #23
0
        protected void listTarget2_Changed(object sender, EventArgs e)
        {
            string idlist = GetSelIDlist(); if (idlist.Trim().Length == 0)
            {
                return;
            }
            int ParentID = -1;

            if (!String.IsNullOrWhiteSpace(listTarget2.SelectedValue))
            {
                ParentID = YSWL.Common.Globals.SafeInt(listTarget2.SelectedValue, 0);
                bll.MoveNodes(idlist, ParentID);
                LogHelp.AddUserLog(CurrentUser.UserName, CurrentUser.UserType, "批量移动菜单", this);
            }

            gridView.OnBind();
        }
Exemple #24
0
        /// <summary>
        /// 保存操作
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void btnSave_Click(object sender, System.EventArgs e)
        {
            if (txtPayFree.Text.Trim() == "")
            {
                YSWL.Common.MessageBox.ShowSuccessTip(this, string.Format("设置费率{0}!", ""));
                return;
            }

            PayFreeModel.EnterpriseID = int.Parse(lbEnterPid.Text);
            PayFreeModel.PayModeId    = int.Parse(lbPayModelid.Text);
            PayFreeModel.FeeRate      = decimal.Parse(txtPayFree.Text);

            EnterPriseModel = EnterpriseBll.GetModel(int.Parse(lbEnterPid.Text));
            if (EnterPriseModel != null)
            {
                if (EnterPriseModel.AgentId.ToString() == lbAgentId.Text)
                {
                    if (lbType.Text == "0")
                    {
                        //开通通道
                        if (PayFreeBll.Add(PayFreeModel))
                        {
                            YSWL.Common.MessageBox.ShowSuccessTip(this, string.Format("开通通道成功,费率:【{0}】!", txtPayFree.Text));
                            LogHelp.AddUserLog(CurrentUser.UserName, CurrentUser.UserType, string.Format(" 商户" + lbEnterPid.Text + " ,设置费率:【{0}】", txtPayFree.Text), this);
                            Response.Redirect("PayFeeList.aspx?Enterpid=" + lbEnterPid.Text + "");
                        }
                    }
                    else
                    {
                        if (PayFreeBll.Update(PayFreeModel))
                        {
                            YSWL.Common.MessageBox.ShowSuccessTip(this, string.Format("修改费率:【{0}】成功!", txtPayFree.Text));
                            LogHelp.AddUserLog(CurrentUser.UserName, CurrentUser.UserType, string.Format(" 商户" + lbEnterPid.Text + " ,设置费率:【{0}】", txtPayFree.Text), this);
                            Response.Redirect("PayFeeList.aspx?Enterpid=" + lbEnterPid.Text + "");
                        }
                    }
                }
                else
                {
                    YSWL.Common.MessageBox.ShowSuccessTip(this, string.Format("不可修改别家商户的数据!用户:【{0}】", CurrentUser.UserName));
                    LogHelp.AddUserLog(CurrentUser.UserName, CurrentUser.UserType, string.Format(" 商户" + lbEnterPid.Text + " ,不可修改别家商户的数据", txtPayFree.Text), this);
                }
            }
        }
Exemple #25
0
        protected void btnSave_Click(object sender, System.EventArgs e)
        {
            string            username = this.lblName.Text.Trim();
            AccountsPrincipal user     = new AccountsPrincipal(username);
            User currentUser           = new YSWL.Accounts.Bus.User(user);

            currentUser.UserName = username;
            currentUser.TrueName = txtTrueName.Text.Trim();
            if (txtPassword.Text.Trim() != "")
            {
                currentUser.Password = AccountsPrincipal.EncryptPassword(txtPassword.Text);
            }
            //if (RadioButton1.Checked)
            //    currentUser.Sex = "1";
            //else
            //    currentUser.Sex = "0";

            currentUser.UserType = dropUserType.SelectedValue;
            currentUser.Phone    = this.txtPhone.Text.Trim();
            currentUser.Email    = txtEmail.Text.Trim();
            if (txtEmployeeID.Text.Length > 0)
            {
                currentUser.EmployeeID = Convert.ToInt32(txtEmployeeID.Text);
            }
            else
            {
                currentUser.EmployeeID = 0;
            }
            currentUser.Activity = !chkActive.Checked;

            //int style = int.Parse(this.dropStyle.SelectedValue);
            //currentUser.Style = style;

            if (!currentUser.Update())
            {
                this.lblMsg.ForeColor = Color.Red;
                this.lblMsg.Text      = Resources.Site.TooltipUpdateError;
            }
            else
            {
                LogHelp.AddUserLog(CurrentUser.UserName, CurrentUser.UserType, string.Format("编辑用户:【{0}】", username), this);
                Response.Redirect("useradmin.aspx");
            }
        }
Exemple #26
0
        public void btnSave_Click(object sender, EventArgs e)
        {
            User currentUser = new User(Convert.ToInt32(lblUserID.Text));

            foreach (ListItem item in CheckBoxList1.Items)
            {
                if (item.Selected == true)
                {
                    currentUser.AddToRole(Convert.ToInt32(item.Value));
                }
                else
                {
                    currentUser.RemoveRole(Convert.ToInt32(item.Value));
                }
            }

            LogHelp.AddUserLog(CurrentUser.UserName, CurrentUser.UserType, string.Format("编辑用户【{0}】的权限", currentUser.UserName), this);
            Response.Redirect("UserAdmin.aspx?PageIndex=" + Request.Params["PageIndex"]);
        }
Exemple #27
0
        public void gridView_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            string id          = gridView.DataKeys[e.RowIndex].Values[0].ToString();
            string keyname     = (gridView.Rows[e.RowIndex].Cells[0].Controls[0] as TextBox).Text;
            string Value       = (gridView.Rows[e.RowIndex].Cells[1].Controls[0] as TextBox).Text;
            string Description = (gridView.Rows[e.RowIndex].Cells[2].Controls[0] as TextBox).Text;

            if ((Value.Length == 0))
            {
                MessageBox.Show(this, Resources.Site.TooltipNoNull);
                return;
            }

            ColoPay.BLL.SysManage.ConfigSystem.Update(int.Parse(id), keyname, Value, Description);
            gridView.EditIndex = -1;
            gridView.OnBind();
            LogHelp.AddUserLog(CurrentUser.UserName, CurrentUser.UserType, string.Format("编辑系统参数:【{0}】", keyname), this);
            MessageBox.ShowSuccessTip(this, Resources.Site.TooltipUpdateOK);
        }
Exemple #28
0
 protected void btnRemove_Click(object sender, EventArgs e)
 {
     for (int i = 0; i < gridView.Rows.Count; i++)
     {
         CheckBox ChkBxItem = (CheckBox)gridView.Rows[i].FindControl(gridView.CheckBoxID);
         if (ChkBxItem != null && ChkBxItem.Checked)
         {
             if (gridView.DataKeys[i].Value != null)
             {
                 int userid = Convert.ToInt32(gridView.DataKeys[i].Value);
                 bllUser.RemoveRole(userid, int.Parse(lblRoleID.Text));
                 User currentUser = new User(userid);
                 LogHelp.AddUserLog(CurrentUser.UserName, CurrentUser.UserType, string.Format("从角色中移除用户:【{0}】", currentUser.UserName), this);
             }
         }
     }
     YSWL.Common.MessageBox.ShowSuccessTip(this, "移除成功!");
     gridView.OnBind();
 }
Exemple #29
0
        /// <summary>
        /// 批量移动权限
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void droplistCategories_Changed(object sender, EventArgs e)
        {
            List <int> idlist = GetSelIDlist();

            if (idlist.Count == 0)
            {
                return;
            }
            string stridlist = YSWL.Common.StringPlus.GetArrayStr(idlist);

            if (!String.IsNullOrWhiteSpace(droplistCategories.SelectedValue))
            {
                int CategoriesID = YSWL.Common.Globals.SafeInt(droplistCategories.SelectedValue, 0);
                bllPerm.UpdateCategory(stridlist, CategoriesID);

                LogHelp.AddUserLog(CurrentUser.UserName, CurrentUser.UserType, "批量移动权限数据", this);
                gridView.OnBind();
            }
        }
Exemple #30
0
        protected void gridView_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            string ID = gridView.DataKeys[e.RowIndex].Value.ToString();

            try
            {
                userTypeManage.Delete(ID);
                string keyname = gridView.Rows[e.RowIndex].Cells[0].Text;
                LogHelp.AddUserLog(CurrentUser.UserName, CurrentUser.UserType, string.Format("删除用户类别:【{0}】", keyname), this);
                gridView.OnBind();
            }
            catch (System.Data.SqlClient.SqlException ex)
            {
                if (ex.Number == 547)
                {
                    YSWL.Common.MessageBox.ShowSuccessTip(this, Resources.Site.ErrorCannotDeleteUser);
                }
            }
        }