Exemplo n.º 1
0
 /// <summary>
 /// 添加管理员
 /// </summary>
 /// <param name="info"></param>
 /// <returns></returns>
 public static AdminInfo AddAdminInfo(AdminInfo info)
 {
     return db.Insert(info) as AdminInfo;
 }
Exemplo n.º 2
0
        private AdminInfo GetEditForm(AdminInfo info)
        {
            FormItem<string> adminNameItem = new FormItem<string>("adminName", "帐号", 3, 15);
            FormItem<string> passwordItem = new FormItem<string>("password", "密码", 5, 10, "");
            FormItem<int> statusItem = new FormItem<int>("status", "状态", -100, 99999, 0);

            info.AdminName = adminNameItem.GetFormValue(ErrorMsg);
            info.Password = passwordItem.GetFormValue(ErrorMsg);
            info.Status = statusItem.GetFormValue(ErrorMsg);
            info.UpdateTime = DateTime.Now;

            if (!string.IsNullOrEmpty(info.Password))
            {
                info.Keyt = Zero.Core.Web.Utils.GetRandomEn(5);
                info.Password = Zero.Core.Security.Encrypt.EncodeMD5(info.Keyt + info.Password);
            }
            return info;
        }
Exemplo n.º 3
0
 /// <summary>
 /// 更新管理员
 /// </summary>
 /// <param name="info"></param>
 /// <returns></returns>
 public static int UpdateAdminInfo(AdminInfo info)
 {
     return db.Update(info);
 }
Exemplo n.º 4
0
        private AdminInfo GetAddForm()
        {
            AdminInfo info = new AdminInfo();
            FormItem<string> adminNameItem = new FormItem<string>("adminName", "帐号", 3, 15);
            FormItem<string> passwordItem = new FormItem<string>("password", "密码", 5, 10);
            FormItem<int> statusItem = new FormItem<int>("status", "状态", -100, 99999, 0);

            info.AdminName = adminNameItem.GetFormValue(ErrorMsg);
            info.Password = passwordItem.GetFormValue(ErrorMsg);
            info.Status = statusItem.GetFormValue(ErrorMsg);
            info.Keyt = Zero.Core.Web.Utils.GetRandomEn(5);
            info.Password = Zero.Core.Security.Encrypt.EncodeMD5(info.Keyt + info.Password);
            return info;
        }