Exemple #1
0
 protected void Save_Btn(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(this.Oldpwd.Value) && !string.IsNullOrEmpty(this.newpwd.Value))
     {
         if (this.newpwd.Value.Trim() == this.newpwd1.Value.Trim())
         {
             IList all = Sys_User.Init().GetAll(string.Concat(new string[]
             {
                 "id=",
                 this.Uid,
                 " and password='******'"
             }), null);
             if (all.Count > 0)
             {
                 Sys_UserInfo sys_UserInfo = all[0] as Sys_UserInfo;
                 sys_UserInfo.PassWord = Encrypt.MD5_32(this.newpwd.Value.Trim().ToLower());
                 Sys_User.Init().Update(sys_UserInfo);
                 Help.UpdateIMUser(sys_UserInfo);
                 base.Response.Write("<script>alert('您好!密码已修改成功!');window.location='" + base.Request.Url.AbsoluteUri + "'</script>");
             }
             else
             {
                 base.Response.Write("<script>alert('原密码不正确,请重新输入!');window.location='" + base.Request.Url.AbsoluteUri + "'</script>");
             }
         }
         else
         {
             base.Response.Write("<script>alert('确认密码 不一致,请重新输入!');window.location='" + base.Request.Url.AbsoluteUri + "'</script>");
         }
     }
 }
        /// <summary>
        /// 删除用户
        /// </summary>
        /// <param name="id"></param>
        public string DelBank(string id)
        {
            string          msg     = string.Empty;
            bool            bol     = false;
            Sys_UserInfoBLL userBll = new Sys_UserInfoBLL();
            Sys_UserInfo    user    = userBll.Get(p => p.UserInfoID == id);

            if (user != null)
            {
                string s = "";
                user.UserInfo_IsDelete = true;
                bol = userBll.Update(user);
            }
            if (bol)
            {
                //删除成功
                msg = "1";
            }
            else
            {
                //删除失败
                msg = "0";
            }
            return(msg);
        }
Exemple #3
0
 /// <summary>Kiểm tra googleEmail co tồn tại trong hệ thống VNR chưa</summary>
 /// <param name="googleEmail">Google Email</param>
 /// <param name="googleProfileName">ProfileName của google</param>
 /// <returns></returns>
 public Sys_UserInfoEntity CheckEmailExisted(string googleEmail, string googleProfileName)
 {
     using (var context = new VnrHrmDataContext())
     {
         var unitOfWork = (IUnitOfWork)(new UnitOfWork(context));
         var repo = new Sys_UserRepository(unitOfWork);
         var userInfo = unitOfWork.CreateQueryable<Sys_UserInfo>(Guid.Empty, m => m.UserLogin == googleEmail).FirstOrDefault();
         var userInfoEntity = userInfo.CopyData<Sys_UserInfoEntity>();
         if (userInfo == null && !string.IsNullOrEmpty(googleEmail))
         {
             //neu chua co googleEmail => tao moi user
             Sys_UserInfo usr = new Sys_UserInfo
             {
                 Email = googleEmail,
                 FullName = googleProfileName,
                 UserLogin = googleEmail,
                 UserInfoName = googleProfileName,
                 Password = "******",
                 IsActivate = true
             };
             repo.Add(usr);
             repo.SaveChanges();
             userInfoEntity = usr.CopyData<Sys_UserInfoEntity>();
         }
         else
         {
             return userInfoEntity;
         }
         return userInfoEntity;
     }
 }
Exemple #4
0
    private void Show()
    {
        Sys_UserInfo byId = Sys_User.Init().GetById(Convert.ToInt32(this.Uid));

        this.userlist.Value = (byId.et6 ?? "");
        this.namelist.Value = (byId.et5 ?? "");
    }
Exemple #5
0
 /// <summary>
 /// 用户模式设置
 /// </summary>
 public string UserModelSetting(string id, string code)
 {
     if (id.Length > 0)
     {
         Sys_UserInfoBLL bllUser  = new Sys_UserInfoBLL();
         Sys_UserInfo    UserInfo = bllUser.Get(p => p.UserInfoID == id);
         if (UserInfo.IsNotNull())
         {
             UserInfo.UserInfo_WorkingState = code;
             if (bllUser.Update(UserInfo))
             {
                 return("1");
             }
             else
             {
                 return("0");
             }
         }
         else
         {
             return("0");
         }
     }
     else
     {
         return("0");
     }
 }
Exemple #6
0
        private void AddUser(HttpContext context)
        {
            Sys_UserInfo org = new Sys_UserInfo();

            org.IDCard      = context.Request["IDCard"].SafeToString();
            org.LoginName   = context.Request["LoginName"].SafeToString();
            org.RegisterOrg = context.Request["RegisterOrg"].SafeToString();
            org.Password    = EncryptHelper.Md5By32("123456");

            org.Name       = context.Request["Name"].SafeToString();
            org.Sex        = Convert.ToByte(context.Request["Sex"]);
            org.Address    = context.Request["Address"].SafeToString();
            org.Phone      = context.Request["Phone"].SafeToString();
            org.Nickname   = context.Request["Nickname"].SafeToString();
            org.UserType   = Convert.ToByte(context.Request["UserType"]);
            org.Birthday   = Convert.ToDateTime(context.Request["Birthday"]);
            org.Remarks    = context.Request["Remarks"].SafeToString();
            org.HeadPic    = context.Request["HeadPic"].SafeToString();
            org.AuthenType = Convert.ToByte(context.Request["AuthenType"]);
            org.CreateUID  = context.Request["CreateUID"].SafeToString();
            org.IsDelete   = 0;
            org.Email      = context.Request["Emai"].SafeToString();

            org.RegisterOrg = context.Request["RegisterOrg"].SafeToString();
            jsonModel       = bll.AddUserInfo(org);
        }
Exemple #7
0
    private void DownLoads()
    {
        string       text  = "";
        string       text2 = " ( ";
        string       text3 = base.Request.QueryString["tt"];
        int          num   = Convert.ToInt32(base.Request.QueryString["uid"]);
        Sys_UserInfo byId  = Sys_User.Init().GetById(num);
        string       text4 = text;

        text = string.Concat(new string[]
        {
            text4,
            byId.RealName,
            " (",
            byId.DepName,
            ")\r\n\r\n"
        });
        if (byId.et6.Contains("#" + this.Uid + "#") && text3.Contains(";"))
        {
            string[] array = text3.Split(new char[]
            {
                ';'
            });
            for (int i = 0; i < array.Length; i++)
            {
                if (!string.IsNullOrEmpty(array[i]))
                {
                    if (i != array.Length - 2)
                    {
                        text2 = text2 + " stime like '" + array[i] + "%' or ";
                    }
                    else
                    {
                        text2 = text2 + " stime like '" + array[i] + "%' ) ";
                    }
                }
            }
            this.GetCT(num, ref text, text2);
            base.Response.Clear();
            base.Response.ClearHeaders();
            base.Response.Buffer = false;
            base.Response.AppendHeader("Content-Disposition", "attachment;filename=CalendarReports.txt");
            base.Response.ContentType = "application/vnd.txt";
            base.Response.Write(text);
            base.Response.Flush();
            base.Response.End();
        }
        else
        {
            base.Response.Write(string.Concat(new string[]
            {
                "<script>alert('您不是",
                byId.RealName,
                "(",
                byId.DepName,
                ")的直接上级,无权查看他的工作日程');window.location='/manage/common/MyMemo.aspx'</script>"
            }));
        }
    }
Exemple #8
0
    private void Show(string uid)
    {
        this.UUserName.Attributes.Add("readonly", "readonly");
        Sys_UserInfo byId = Sys_User.Init().GetById(Convert.ToInt32(uid));

        this.ViewState["su"]        = byId;
        this.UUserName.Value        = byId.UserName;
        this.PassWord.Value         = byId.PassWord;
        this.PassWord2.Value        = byId.PassWord;
        this.URealName.Value        = byId.RealName;
        this.Sex1.SelectedValue     = string.Concat(byId.Sex);
        this.Birthday.Value         = byId.Birthday;
        this.Phone.Value            = byId.Phone;
        this.RoleID.SelectedValue   = string.Concat(byId.RoleID);
        this.parentID.SelectedValue = string.Concat(byId.DepID);
        this.Status1.SelectedValue  = string.Concat(byId.Status);
        this.IsLock.Checked         = Convert.ToBoolean(byId.IsLock);
        this.Notes.Value            = byId.Notes;
        this.Tel.Value              = byId.Tel;
        this.JoinTime.Value         = byId.JoinTime;
        this.HomeAddress.Value      = byId.HomeAddress;
        this.PositionName.Value     = byId.PositionName;
        this.Email.Value            = byId.Email;
        this.QQ.Value               = byId.QQ;
        this.Orders.Value           = string.Concat(byId.Orders);
        this.RoleGUID.SelectedValue = string.Concat(byId.MsgTime);
        this.MemoShare.Checked      = Convert.ToBoolean(byId.MemoShare);
        this.userlist.Value         = byId.et6;
        this.namelist.Value         = byId.et5;
        if (byId.DepGUID == "no")
        {
            this.DepGuid.SelectedValue = "no";
        }
        if (!string.IsNullOrEmpty(byId.et4) && byId.et4.Contains("|"))
        {
            this.Attachword.Visible = true;
            List <TmpInfo> list  = new List <TmpInfo>();
            string[]       array = byId.et4.Split(new char[]
            {
                '|'
            });
            for (int i = 0; i < array.Length; i++)
            {
                if (array[i].Trim() != "")
                {
                    TmpInfo tmpInfo = new TmpInfo();
                    int     num     = array[i].LastIndexOf('/') + 1;
                    string  tmp     = array[i].Substring(num, array[i].Length - num);
                    string  tmp2    = array[i].Replace("~", "");
                    tmpInfo.Tmp1 = array[i];
                    tmpInfo.Tmp2 = tmp;
                    tmpInfo.Tmp3 = tmp2;
                    list.Add(tmpInfo);
                }
            }
            this.rpt.DataSource = list;
            this.rpt.DataBind();
        }
    }
Exemple #9
0
        public void Delete(int id)
        {
            if (true)
            {
            }
            Sys_UserInfo sys_UserInfo = new Sys_UserInfo();

            sys_UserInfo.id = id;
            this.control.DeleteEntity(sys_UserInfo);
        }
Exemple #10
0
    private List <string> GetPhoneList(string ulist, string userlist)
    {
        List <string> list = new List <string>();

        if (ulist.Contains(","))
        {
            string[] array = ulist.Split(new char[]
            {
                ','
            });
            int i   = 0;
            int num = array.Length;
            while (i < num)
            {
                if (Help.ValidateMobile(array[i]))
                {
                    list.Add(array[i]);
                }
                i++;
            }
        }
        else
        {
            if (Help.ValidateMobile(ulist))
            {
                list.Add(ulist);
            }
        }
        if (userlist.Contains(","))
        {
            string[] array = userlist.Split(new char[]
            {
                ','
            });
            int i   = 0;
            int num = array.Length;
            while (i < num)
            {
                if (array[i].Contains("#"))
                {
                    string value = array[i].Split(new char[]
                    {
                        '#'
                    })[1];
                    Sys_UserInfo byId = Sys_User.Init().GetById(Convert.ToInt32(value));
                    if (Help.ValidateMobile(byId.Phone))
                    {
                        list.Add(byId.Phone);
                    }
                }
                i++;
            }
        }
        return(list);
    }
Exemple #11
0
        //public static void UpdateIMUser(Sys_UserInfo ui)
        //{
        //    try
        //    {
        //        string cmdText = "select [Key] from WM_Users where Name='" + ui.UserName + "'";
        //        string text = string.Concat(MsSqlOperate.ExecuteScalar(CommandType.Text, cmdText, new SqlParameter[0]));
        //        if (Utils.IsNumber(text))
        //        {
        //            string str = string.Concat(new string[]
        //    {
        //        "update WM_Users set Nickname='",
        //        ui.RealName,
        //        "',Password='******',EMail='",
        //        ui.Email,
        //        "',Phone='",
        //        ui.Phone,
        //        "',TelPhone='",
        //        ui.Tel,
        //        "' where Name='",
        //        ui.UserName,
        //        "';"
        //    });
        //            string text2 = string.Format("DELETE FROM WM_UDD WHERE uid={1} ; INSERT INTO WM_UDD(did,uid,tid)VALUES({0},{1},0) ", ui.DepID, text);
        //            text2 = str + text2;
        //            MsSqlOperate.ExecuteNonQuery(CommandType.Text, text2, new SqlParameter[0]);
        //            AccountImpl.Instance._RefreshUserInfo(Convert.ToInt64(text));
        //        }
        //        else
        //        {
        //            AccountImpl.Instance.AddUser(ui.UserName, ui.RealName, ui.PassWord, ui.Email, ui.Phone, ui.Tel);
        //            string cmdText2 = "select [Key] from WM_Users where Name='" + ui.UserName + "'";
        //            string text3 = string.Concat(MsSqlOperate.ExecuteScalar(CommandType.Text, cmdText2, new SqlParameter[0]));
        //            if (Utils.IsNumber(text3))
        //            {
        //                string text2 = string.Format("DELETE FROM WM_UDD WHERE uid={1} ; INSERT INTO WM_UDD(did,uid,tid)VALUES({0},{1},0) ", ui.DepID, text3);
        //                MsSqlOperate.ExecuteNonQuery(CommandType.Text, text2, new SqlParameter[0]);
        //            }
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        throw ex;
        //    }
        //}

        public static void UpdateIMUser(Sys_UserInfo ui)
        {
            try
            {
                string cmdText = "select ID from Users where Name='" + ui.UserName + "'";
                string text    = string.Concat(MsSqlOperate.ExecuteScalar(CommandType.Text, cmdText, new SqlParameter[0]));
                if (Utils.IsNumber(text))
                {
                    string str = string.Concat(new string[]
                    {
                        "update Users set Nickname='",
                        ui.RealName,
                        "',Password='******',EMail='",
                        ui.Email,
                        "',Tel='",
                        ui.Phone,
                        "',Mobile='",
                        ui.Tel,
                        "' where Name='",
                        ui.UserName,
                        "';"
                    });

                    //MsSqlOperate.ExecuteNonQuery(CommandType.Text, str, new SqlParameter[0]);
                }
                else
                {
                    int id = AccountImpl.Instance.CreateUser(
                        ui.UserName.ToString(),
                        ui.RealName.ToString(),
                        ui.PassWord.ToString(),
                        ui.Email.ToString(),
                        -1, 0
                        );
                    AccountInfo newUser = AccountImpl.Instance.GetUserInfo(id);



                    //AccountImpl.Instance.AddUser(ui.UserName, ui.RealName, ui.PassWord, ui.Email, ui.Phone, ui.Tel);
                    string cmdText2 = "select ID from Users where Name='" + ui.UserName + "'";
                    string text3    = string.Concat(MsSqlOperate.ExecuteScalar(CommandType.Text, cmdText2, new SqlParameter[0]));
                    if (Utils.IsNumber(text3))
                    {
                        string text2 = string.Format("DELETE FROM WM_UDD WHERE uid={1} ; INSERT INTO WM_UDD(did,uid,tid)VALUES({0},{1},0) ", ui.DepID, text3);
                        //MsSqlOperate.ExecuteNonQuery(CommandType.Text, text2, new SqlParameter[0]);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #12
0
        /// <summary>
        /// 区域负责人
        /// </summary>
        /// <returns></returns>

        public List <PrincipalDetailDto> Principal()
        {
            var res    = new List <PrincipalDetailDto>();
            int shopId = this.app.User.ShopId;

            if (shopId <= 0)
            {
                return(res);
            }

            List <int> houseGroupids = this.db.HouseGroupByCompanyQuery.Where(c => c.CompanyId == shopId).Select(c => c.HouseGroupId).Distinct().OrderBy(c => c).ToList();

            string principalArrayStr = string.Empty;

            if (!houseGroupids.Any())
            {
                //取平台管理员
                Sys_UserInfo sys_UserInfo = this.db.Sys_UserInfoQuery.FirstOrDefault(c => c.Type == 0);
                if (sys_UserInfo != null)
                {
                    principalArrayStr = sys_UserInfo.Principal;
                }
            }
            else
            {
                //取区域代理
                Sys_UserInfo sys_UserInfo = this.db.Sys_UserInfoQuery.FirstOrDefault(c => c.Principal == houseGroupids.GHSerializeObject());
                if (sys_UserInfo == null)
                {
                    sys_UserInfo = this.db.Sys_UserInfoQuery.FirstOrDefault(c => c.Type == 0);                       //取平台管理员
                }
                if (sys_UserInfo != null)
                {
                    principalArrayStr = sys_UserInfo.Principal;
                }
            }
            if (string.IsNullOrEmpty(principalArrayStr))
            {
                return(res);
            }

            List <int> principalArray = principalArrayStr.GHDeserializeObject <List <int> >();

            res = (from u in this.db.UsersQuery
                   join t in this.db.ChineseTraderInfoQuery on u.Id equals t.UserId
                   where principalArray.Contains(u.Id)
                   select new PrincipalDetailDto
            {
                TraderName = t.TraderName,
                PhoneNumber = u.PhoneNumber,
                IMUserName = u.UserName
            }).ToList();

            return(res);
        }
Exemple #13
0
        public static void BBS_Check(string u)
        {
            IList all = Sys_User.Init().GetAll("id=" + Convert.ToInt32(u), null);

            if (all.Count > 0)
            {
                Sys_UserInfo sys_UserInfo = all[0] as Sys_UserInfo;
                Help.BBS_Update(sys_UserInfo.UserName, sys_UserInfo.PassWord, sys_UserInfo);
                Help.BBS_Login(sys_UserInfo.UserName, sys_UserInfo.PassWord);
            }
        }
Exemple #14
0
    private void DeleteUser(int did)
    {
        IList all = Sys_User.Init().GetAll("DepID=" + did, null);

        for (int i = 0; i < all.Count; i++)
        {
            Sys_UserInfo sys_UserInfo = all[i] as Sys_UserInfo;
            // Help.DeleteIMUser(sys_UserInfo.id);
            Sys_User.Init().Delete(sys_UserInfo.id);
        }
    }
Exemple #15
0
        public void GetUserInfoByToken(HttpContext context)
        {
            //响应者
            HttpResponse Response = context.Response;
            //请求者
            HttpRequest Request = context.Request;
            //往返路径
            string returnUrl = Request["returnUrl"];

            JsonModel jsonModel = new JsonModel();

            if (Request["tokenID"] != string.Empty)
            {
                string tokenID = Request["tokenID"];
                if (KeepToken(tokenID))
                {
                    SSOToken token = KeepToken_Valied(tokenID);
                    if (token != null)
                    {
                        Sys_UserInfo userInfo = UserManage.GetUserInfo(token.User.UserName, token.User.PassWord);
                        if (userInfo != null)
                        {
                            jsonModel.retData = userInfo;
                            jsonModel.errNum  = 0;
                        }
                        else
                        {
                            jsonModel.errMsg = "用户名密码错误";
                            jsonModel.errNum = 999;
                        }
                    }
                    else
                    {
                        jsonModel.errMsg = "获取用户信息失败";
                        jsonModel.errNum = 222;
                    }
                }
                else
                {
                    jsonModel.errMsg = "无效令牌";
                    jsonModel.errNum = 333;
                }
            }
            else
            {
                jsonModel.errMsg = "未获取到令牌";
                jsonModel.errNum = 666;
            }
            //Response.Write(JsHelper.Serialize(new { Data = returnData }));

            string callback = context.Request["jsoncallback"];

            Response.Write(callback + "({\"result\":" + JsHelper.Serialize(jsonModel) + "})");
        }
Exemple #16
0
		protected string GetStepUsers(object userlist, object namelist, object userlist_dep, object step_type)
		{
			string text = "";
			if (step_type.ToString() == "0")
			{
				text = string.Concat(userlist);
			}
			if (step_type.ToString() == "1")
			{
				string text2 = string.Concat(userlist_dep);
				if (text2.Contains(","))
				{
					string[] array = text2.Split(new char[]
					{
						','
					});
					List<Sys_UserInfo> list = new List<Sys_UserInfo>();
					for (int i = 0; i < array.Length; i++)
					{
						if (array[i].Trim() != "")
						{
							string str = array[i].Split(new char[]
							{
								'#'
							})[1];
							IList all = Sys_User.Init().GetAll("depid=" + str, null);
							foreach (object current in all)
							{
								Sys_UserInfo item = current as Sys_UserInfo;
								if (!list.Contains(item))
								{
									list.Add(item);
								}
							}
						}
					}
					for (int i = 0; i < list.Count; i++)
					{
						object obj = text;
						text = string.Concat(new object[]
						{
							obj,
							list[i].RealName,
							"#",
							list[i].id,
							"#",
							list[i].DepName,
							","
						});
					}
				}
			}
			return text;
		}
Exemple #17
0
        private static void SMS_Send_Flow(Sys_UserInfo ui, string flow_title)
        {
            Hashtable hashtable = (Hashtable)HttpContext.Current.Application["sms"];
            string    text      = string.Concat(hashtable["sms_url"]);
            string    text2     = string.Concat(hashtable["sms_user"]);
            string    text3     = string.Concat(hashtable["sms_pwd"]);
            string    text4     = string.Concat(hashtable["cont_f"]);

            string.Concat(hashtable["cont_g"]);
            string.Concat(hashtable["cont_n"]);
            string.Concat(hashtable["cont_m"]);
            string a = string.Concat(hashtable["cont_f_e"]);

            string.Concat(hashtable["cont_g_e"]);
            string.Concat(hashtable["cont_n_e"]);
            string.Concat(hashtable["cont_m_e"]);
            if (Help.ValidateMobile(ui.Phone))
            {
                string text5 = text;
                string text6 = text4;
                string text7 = text2;
                string text8 = text3;
                text6 = text6.Replace("x", ui.RealName).Replace("t", flow_title).Replace("p", ui.PositionName);
                if (a == "1")
                {
                    try
                    {
                        string text9 = string.Concat(new string[]
                        {
                            text5,
                            "/?Uid=",
                            text7,
                            "&Key=",
                            text8,
                            "&smsMob=",
                            ui.Phone,
                            "&smsText=",
                            HttpUtility.UrlEncode(text6, Encoding.GetEncoding("GBK"))
                        });
                        string      requestUriString = text9.Trim().ToString();
                        WebRequest  webRequest       = WebRequest.Create(requestUriString);
                        WebResponse response         = webRequest.GetResponse();
                        Stream      responseStream   = response.GetResponseStream();
                        using (StreamReader streamReader = new StreamReader(responseStream, Encoding.GetEncoding("GBK")))
                        {
                            streamReader.ReadToEnd();
                        }
                    }
                    catch
                    {
                    }
                }
            }
        }
Exemple #18
0
    private void MyDownLoad(string s, string e)
    {
        string       text  = "";
        string       text2 = " ( ";
        int          num   = Convert.ToInt32(base.Request.QueryString["uid"]);
        Sys_UserInfo byId  = Sys_User.Init().GetById(num);
        string       text3 = text;

        text = string.Concat(new string[]
        {
            text3,
            byId.RealName,
            " (",
            byId.DepName,
            ")\r\n\r\n"
        });
        text3 = text2;
        text2 = string.Concat(new string[]
        {
            text3,
            " substring(STime,1,8) between '",
            s,
            "' and '",
            e,
            "' )"
        });
        this.GetCT(num, ref text, text2);
        string str;

        if (s != e)
        {
            str = string.Concat(new string[]
            {
                this.UserName,
                "_",
                s,
                "to",
                e
            });
        }
        else
        {
            str = this.UserName + "_" + s;
        }
        base.Response.Clear();
        base.Response.ClearHeaders();
        base.Response.Buffer = false;
        base.Response.AppendHeader("Content-Disposition", "attachment;filename=" + str + ".txt");
        base.Response.ContentType = "application/vnd.txt";
        base.Response.Write(text);
        base.Response.Flush();
        base.Response.End();
    }
Exemple #19
0
        //public static Hashtable GetUserHash()
        //{
        //    Hashtable hashtable = new Hashtable();
        //    IList all = Sys_User.Init().GetAll(null, null);
        //    IEnumerator enumerator = all.GetEnumerator();
        //    try
        //    {
        //        int num = 1;
        //        while (true)
        //        {
        //            bool flag = false;
        //            switch (num)
        //            {
        //                case 2:
        //                    goto IL_BC;
        //                case 3:
        //                    {
        //                        if (!flag)
        //                        {
        //                            num = 4;
        //                            continue;
        //                        }
        //                        object current = enumerator.Current;
        //                        Sys_UserInfo sys_UserInfo = current as Sys_UserInfo;
        //                        hashtable.Add(sys_UserInfo.id.ToString(), sys_UserInfo);
        //                        num = 0;
        //                        continue;
        //                    }
        //                case 4:
        //                    num = 2;
        //                    continue;
        //            }
        //        IL_54:
        //            flag = enumerator.MoveNext();
        //            num = 3;
        //            continue;
        //            goto IL_54;
        //        }
        //    IL_BC:
        //        goto IL_1F;
        //    }
        //    finally
        //    {
        //        while (true)
        //        {
        //            IDisposable disposable = enumerator as IDisposable;
        //            bool flag = disposable == null;
        //            int num2 = 2;
        //            while (true)
        //            {
        //                switch (num2)
        //                {
        //                    case 0:
        //                        disposable.Dispose();
        //                        num2 = 1;
        //                        continue;
        //                    case 1:
        //                        goto IL_117;
        //                    case 2:
        //                        if (!flag)
        //                        {
        //                            num2 = 0;
        //                            continue;
        //                        }
        //                        goto IL_119;
        //                }
        //                break;
        //            }
        //        }
        //    IL_117:
        //    IL_119: ;
        //    }
        //    goto IL_11A;
        //IL_1F:
        //    Hashtable result = hashtable;
        //IL_11A:
        //    if (true)
        //    {
        //    }
        //    return result;
        //}

        public static List <Sys_UserInfo> GetUserHash()
        {
            Admin_Help.UpdateDeps();
            IList all = Sys_User.Init().GetAll(null, null);
            List <Sys_UserInfo> list = new List <Sys_UserInfo>();

            foreach (object current in all)
            {
                Sys_UserInfo item = current as Sys_UserInfo;
                list.Add(item);
            }
            return(list);
        }
Exemple #20
0
		protected void Page_Load(object sender, EventArgs e)
		{
			this.power_menu = this.GetUserPowerMenu(this.Modules);
			IList all = News_Type.Init().GetAll(null, " order by orders asc");
			for (int i = 0; i < all.Count; i++)
			{
				News_TypeInfo news_TypeInfo = all[i] as News_TypeInfo;
				this.news_type += string.Format(this.ft, "nn" + (i + 1), news_TypeInfo.TypeName, "News/News_List.aspx?tid=" + news_TypeInfo.id);
				this.news_type1 += string.Format(this.ft1, "nn" + (i + 1), news_TypeInfo.TypeName);
			}
			this.uid.Value = this.Uid;
			Bas_ComInfo bas_ComInfo = HttpContext.Current.Application["cominfo"] as Bas_ComInfo;
			this.comname = bas_ComInfo.ComName;
			this.weburl = bas_ComInfo.WebUrl;
			this.logo = bas_ComInfo.Logo;
			Sys_UserInfo byId = Sys_User.Init().GetById(Convert.ToInt32(this.Uid));
			byId.RoleGUID = (byId.RoleGUID ?? "");
			if (!string.IsNullOrEmpty(byId.RoleGUID) && byId.RoleGUID.ToLower().Contains(".jpg"))
			{
				this.wallpaper = "myLib.desktop.wallpaper.init('" + byId.RoleGUID + "');";
			}
			if (bas_ComInfo.MsgState != 1)
			{
				this.message_div.Visible = false;
			}
			else
			{
				try
				{
					int num = byId.MsgTime;
					if (num == -1)
					{
						this.message_div.Visible = false;
					}
					if (num > -1)
					{
						num = num * 60 * 1000;
						this.notice_time.Value = string.Concat(num);
						this.stay_time.Value = "30000";
					}
				}
				catch
				{
				}
			}
			if (bas_ComInfo.BBSState == 1)
			{
				this.dxbbs_div.Visible = true;
			}
		}
Exemple #21
0
        private void ResetUser(HttpContext context)
        {
            int Id = Convert.ToInt32(context.Request["ID"]);

            jsonModel = bll.GetEntityById(Id);
            if (jsonModel.errNum == 0)
            {
                Sys_UserInfo org = (Sys_UserInfo)jsonModel.retData;
                org.Id           = Id;
                org.Password     = "******";
                org.IsFirstLogin = 0;
                jsonModel        = bll.EditUserInfo(org);
            }
        }
Exemple #22
0
        /// <summary>
        /// 用户审核
        /// </summary>
        /// <param name="context"></param>
        private void CheckUser(HttpContext context)
        {
            int Id = Convert.ToInt32(context.Request["ID"]);

            jsonModel = bll.GetEntityById(Id);
            if (jsonModel.errNum == 0)
            {
                Sys_UserInfo org = (Sys_UserInfo)jsonModel.retData;
                org.AuthenType = Convert.ToByte(context.Request["AuthenType"]);
                org.CheckMsg   = context.Request["CheckMsg"].SafeToString();

                jsonModel = bll.Update(org);
            }
        }
Exemple #23
0
        public string GetAuthToken(LogionModel logion)
        {
            SearchCondition search = new SearchCondition();

            search.AddCondition("F_Account", logion.Account, SqlOperator.Equal);
            search.AddCondition("F_PassWord", logion.PassWord, SqlOperator.Equal);
            Sys_UserInfo user = BLLFactory <Sys_User> .Instance.FindSingle(GetConditionStr(search));

            if (user != null)
            {
                return(JWTTokenHelper.GetToken(user.F_Account, user.F_IsAdministrator ?? false));
            }
            return("账号或者密码不正确");
        }
Exemple #24
0
    private void Show(string uid)
    {
        Sys_UserInfo byId = Sys_User.Init().GetById(Convert.ToInt32(uid));

        this.URealName5.InnerText = byId.RealName;
        this.UDepName5.InnerText  = byId.DepName;
        this.Sex5.InnerText       = ((byId.Sex == 0) ? "男" : "女");
        this.Birthday5.InnerText  = this.GetAges(byId.Birthday);
        if (Help.ValidateMobile(byId.Phone))
        {
            this.Phone5.InnerHtml = string.Concat(new string[]
            {
                "<a href='wtai://wp/mc;",
                byId.Phone,
                "'>",
                byId.Phone,
                " (拨号)</a>"
            });
        }
        this.Tel5.InnerHtml              = byId.Tel;
        this.Notes5.InnerText            = byId.Notes;
        this.Status5.InnerText           = ((byId.Status == 0) ? "在职" : "离职");
        this.JoinTime5.InnerText         = byId.JoinTime;
        this.DirectSupervisor5.InnerText = byId.et5;
        this.HomeAddress5.InnerText      = byId.HomeAddress;
        this.PositionName5.InnerText     = byId.PositionName;
        this.Email5.InnerText            = byId.Email;
        this.QQ5.InnerText = byId.QQ;
        if (!string.IsNullOrEmpty(byId.PerPic) && Utils.FileExists(base.Server.MapPath("~/Files/common/" + byId.PerPic)))
        {
            this.PerPic.ImageUrl = "~/Files/common/" + byId.PerPic;
        }
        if (!string.IsNullOrEmpty(base.Request.QueryString["type"]) && !string.IsNullOrEmpty(byId.et4) && (this.Modules.Contains("19") || this.Modules.Contains("20")) && byId.et4.Contains("|"))
        {
            string[] array = byId.et4.Split(new char[]
            {
                '|'
            });
            for (int i = 0; i < array.Length; i++)
            {
                if (array[i].Trim() != "")
                {
                    int    num = array[i].LastIndexOf('/') + 1;
                    string arg = array[i].Substring(num, array[i].Length - num);
                    string s   = array[i].Replace("~", "");
                    this.fjs += string.Format(this.fj, base.Server.UrlEncode(s), arg);
                }
            }
        }
    }
Exemple #25
0
        /// <summary>
        /// 重新基类在Action执行之前的事情
        /// </summary>
        /// <param name="filterContext">重写方法的参数</param>
        protected override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            base.OnActionExecuting(filterContext);

            var user = Session["UserInfo"] as Sys_UserInfo;

            if (user == null)
            {
                Response.Redirect("/Account/Login");//如果用户为空跳转到登录界面
            }
            else
            {
                CurrentUser = user;
            }
        }
Exemple #26
0
        /// <summary>
        /// 提交
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btntijiao_Click(object sender, ImageClickEventArgs e)
        {
            string userid = CurrUserInfo().UserID;

            modelUser = bllUser.Get(p => p.UserInfoID == userid);
            FormModel.GetForm <Sys_UserInfo>(this, modelUser, "t_");
            if (modelUser != null)
            {
                modelUser.UserInfo_LoginUserPwd = DESEncrypt.Encrypt(t_UserInfo_LoginUserPwd.Text.ToString().Trim());
            }
            //if (t_UserInfo_IdentityCred.Text != "")
            //{
            //    modelUser.UserInfo_Age = Convert.ToInt32(t_UserInfo_Age.Text);
            //    modelUser.UserInfo_DateBirth = Convert.ToDateTime(t_UserInfo_DateBirth.Text);
            //}
            if (txt_Yhxx_DTcsrq.Value != "")
            {
                modelUser.UserInfo_DateBirth = Convert.ToDateTime(Convert.ToDateTime(txt_Yhxx_DTcsrq.Value).ToString("yyyy年MM月dd日"));
            }
            if (txt_Yhxx_Iage.Value != "")
            {
                modelUser.UserInfo_Age = Convert.ToInt32(txt_Yhxx_Iage.Value);
            }
            string UserInfo_PhoneNumber = this.t_UserInfo_PhoneNumber.Text.Trim().ToString();
            //List<Sys_UserInfo> bu = bllUser.FindWhere("UserInfo_PhoneNumber='" + this.t_UserInfo_PhoneNumber.Text.Trim().ToString() + "'and UserInfoID not in('"+CurrUserInfo().UserID+"')");
            List <Sys_UserInfo> bu = bllUser.GetList(p => p.UserInfo_PhoneNumber == UserInfo_PhoneNumber && p.UserInfoID != userid).ToList();

            if (bu.Count > 0)
            {
                this.t_UserInfo_PhoneNumber.Text = "";
                MessageBox.Show(this, "手机号码已存在,请重新输入!");
            }
            else
            {
                if (bllUser.Update(modelUser))
                {
                    new Common_BLL().AddLog("系统管理>>个人信息维护", "", "修改", "修改个人信息维护", CurrUserInfo().UserID, CurrUserInfo().DepartmentCode);

                    MessageBox.ShowAndRedirect(this, "修改成功", "UserInfoModify.aspx?rn=" + new Random().Next());
                    //    //更新此人对应的岗位自查表模块表
                    //(new DAL.PositionChange()).UpdateGwfxwx(model.ManID, "1", model.Position);
                }
                else
                {
                    MessageBox.Show(this, "修改错误");
                }
            }
        }
Exemple #27
0
        private void UpdatePwdByLoginName(HttpContext context)
        {
            Hashtable ht = new Hashtable();

            ht.Add("LoginName", context.Request["LoginName"].SafeToString());

            jsonModel = bll.GetPage(ht, false);
            string       ID   = (jsonModel.retData as List <Dictionary <string, object> >)[0]["Id"].ToString();
            Sys_UserInfo user = (Sys_UserInfo)bll.GetEntityById(int.Parse(ID)).retData;

            if (jsonModel.errNum == 0)
            {
                user.Password = EncryptHelper.Md5By32(context.Request["Password"].SafeToString());
                jsonModel     = bll.EditUserInfo(user);
            }
        }
Exemple #28
0
    private void Show()
    {
        Sys_UserInfo byId = Sys_User.Init().GetById(Convert.ToInt32(this.Uid));

        this.ViewState["su"]    = byId;
        this.PositionName.Value = byId.PositionName;
        this.Sex.SelectedValue  = string.Concat(byId.Sex);
        this.Birthday.Value     = byId.Birthday;
        this.Phone.Value        = byId.Phone;
        this.Tel.Value          = byId.Tel;
        this.HomeAddress.Value  = byId.HomeAddress;
        this.JoinTime.Value     = byId.JoinTime;
        this.Notes.Value        = byId.Notes;
        this.QQ.Value           = byId.QQ;
        this.Email.Value        = byId.Email;
    }
Exemple #29
0
 //protected HtmlHead Head1;
 //protected HtmlForm form1;
 //protected Button Button1;
 //protected HtmlInputText SealName;
 //protected HtmlInputText TagName;
 //protected DropDownList uids;
 //protected HtmlInputPassword PWD;
 //protected FileUpload Fup;
 //protected Image PerPic;
 //protected HtmlInputCheckBox Status;
 //protected HtmlTextArea Notes;
 //protected Button save_bt;
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         IList all = Sys_User.Init().GetAll(null, "order by depid asc,orders asc");
         this.uids.Items.Add(new ListItem("请选择 印章/签名使用者", ""));
         for (int i = 0; i < all.Count; i++)
         {
             Sys_UserInfo sys_UserInfo = all[i] as Sys_UserInfo;
             this.uids.Items.Add(new ListItem(sys_UserInfo.RealName + " (" + sys_UserInfo.DepName + ")", string.Concat(sys_UserInfo.id)));
         }
     }
     if (!string.IsNullOrEmpty(base.Request.QueryString["mid"]) && !base.IsPostBack)
     {
         this.Show(base.Request.QueryString["mid"]);
     }
 }
Exemple #30
0
        /// <summary>
        /// 注册用户
        /// </summary>
        /// <param name="context"></param>
        private void Register(HttpContext context)
        {
            Sys_UserInfo org = new Sys_UserInfo();

            org.UniqueNo    = Guid.NewGuid().ToString();
            org.UserType    = Convert.ToByte(context.Request["UserType"]);
            org.Name        = context.Request["Name"].SafeToString();
            org.IDCard      = context.Request["IDCard"].SafeToString();
            org.LoginName   = context.Request["LoginName"].SafeToString();
            org.Password    = EncryptHelper.Md5By32(context.Request["Password"]).SafeToString();
            org.RegisterOrg = context.Request["OrgCode"].SafeToString();
            org.UserType    = Convert.ToByte(((int)enumUserType.学生));
            org.CreateTime  = DateTime.Now;
            org.IsDelete    = Convert.ToByte(((int)SysStatus.正常));
            org.AuthenType  = (int)AuthenType.新用户注册;
            org.IsEnable    = (int)isEnable.启用;
            jsonModel       = bll.Add(org);
        }