示例#1
0
 /// <summary>
 /// 保存安全问题
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void btnSafeQues_Click(object sender, EventArgs e)
 {
     Song.Entities.EmpAccount obj = Extend.LoginState.Admin.CurrentUser;
     obj = this.EntityFill(obj) as Song.Entities.EmpAccount;
     Business.Do <IEmployee>().Save(obj);
     this.Alert("操作成功!");
 }
示例#2
0
 /// <summary>
 /// 修改密码
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void btnEnter_Click(object sender, EventArgs e)
 {
     Song.Entities.EmpAccount obj = Extend.LoginState.Admin.CurrentUser;
     try
     {
         string pw    = this.tbOldPw.Text.Trim();
         bool   isHav = Business.Do <IEmployee>().LoginCheck(obj.Org_ID, obj.Acc_AccName, pw);
         this.lbShow.Visible = !isHav;
         if (!isHav)
         {
             return;
         }
         //员工登录密码,为空
         if (tbPw1.Text != "")
         {
             string md5 = WeiSha.Common.Request.Controls[tbPw1].MD5;
             obj.Acc_Pw = md5;
         }
         Business.Do <IEmployee>().Save(obj);
         this.Alert("操作成功!");
     }
     catch (Exception ex)
     {
         Message.ExceptionShow(ex);
     }
 }
 private void isLogin()
 {
     //账号为空
     if (string.IsNullOrWhiteSpace(acc))
     {
         this.Response.Redirect("index.ashx?error=1");
     }
     //验证码不正确
     if (!isCodeImg())
     {
         this.Response.Redirect("index.ashx?error=2&acc=" + acc);
     }
     //当前机构,通过二级域名判断,如果不存在或无法判断,则返回默认机构
     Song.Entities.Organization org = Business.Do <IOrganization>().OrganCurrent();
     //通过验证,进入登录状态
     Song.Entities.EmpAccount emp = Business.Do <IEmployee>().EmpLogin(acc, pw, org.Org_ID);
     if (emp != null)
     {
         LoginState.Admin.Write(emp);
         this.Response.Redirect("panel.ashx");
     }
     else
     {
         //密码不正确
         this.Response.Redirect("index.ashx?error=3&acc=" + acc);
     }
 }
示例#4
0
 private void fill()
 {
     Song.Entities.EmpAccount th = id == 0 ? Extend.LoginState.Admin.CurrentUser : Business.Do <IEmployee>().GetSingle(id);
     if (th == null)
     {
         return;
     }
     this.EntityBind(th);
 }
示例#5
0
        protected override void InitPageTemplate(HttpContext context)
        {
            //当前版本
            string version = WeiSha.Common.License.Value.VersionName;

            WeiSha.Common.License lic = WeiSha.Common.License.Value;
            this.Document.Variables.SetValue("lic", lic);
            //
            Song.Entities.EmpAccount acc = this.Admin;
            if (acc == null)
            {
                context.Response.Redirect("index.ashx");
                return;
            }
            this.Document.Variables.SetValue("CurrUser", acc);
        }