Ejemplo n.º 1
0
        protected void SubmitButton_Click(object sender, EventArgs E)
        {
            AdminGroupInfo adminGroup = new AdminGroupInfo();

            adminGroup.Id    = RequestHelper.GetQueryString <int>("ID");
            adminGroup.Name  = Name.Text;
            adminGroup.Power = RequestHelper.GetForm <string>("Rights").Replace(",", "|");
            adminGroup.Note  = Note.Text;
            if (adminGroup.Power != string.Empty)
            {
                adminGroup.Power = "|" + adminGroup.Power + "|";
            }
            string alertMessage = ShopLanguage.ReadLanguage("UpdateOK");

            if (adminGroup.Id == int.MinValue)
            {
                CheckAdminPower("AddAdminGroup", PowerCheckType.Single);
                int id = AdminGroupBLL.Add(adminGroup);
                AdminLogBLL.Add(ShopLanguage.ReadLanguage("AddRecord"), ShopLanguage.ReadLanguage("AdminGroup"), id);
            }
            else
            {
                CheckAdminPower("UpdateAdminGroup", PowerCheckType.Single);
                AdminGroupInfo tmpAdminGroup = AdminGroupBLL.Read(adminGroup.Id);
                adminGroup.AdminCount = tmpAdminGroup.AdminCount;
                adminGroup.AddDate    = tmpAdminGroup.AddDate;
                adminGroup.IP         = tmpAdminGroup.IP;

                AdminGroupBLL.Update(adminGroup);
                AdminLogBLL.Add(ShopLanguage.ReadLanguage("UpdateRecord"), ShopLanguage.ReadLanguage("AdminGroup"), adminGroup.Id);
                alertMessage = ShopLanguage.ReadLanguage("UpdateOK");
            }
            ScriptHelper.Alert(alertMessage, RequestHelper.RawUrl);
        }
Ejemplo n.º 2
0
 public string UpdateAdminGroup(int groupid, string groupname, string remark)
 {
     if (groupname.Length < 1)
     {
         return("000000");  //验证用户组名不能为空;
     }
     Group.GroupId   = groupid;
     Group.GroupName = groupname;
     Group.Remark    = remark;
     return(GroupBLL.Update(Group).ToString());
 }