Example #1
0
    private void getCustomerList()
    {
        System.Text.StringBuilder sb  = new System.Text.StringBuilder();
        HYTD.BLL.Call_CustomerBLL bll = new HYTD.BLL.Call_CustomerBLL();
        string strKeyWord             = string.Empty;

        if (!string.IsNullOrEmpty(Request["keyword"]))
        {
            strKeyWord = Request["keyword"].ToString().Trim();
        }
        System.Collections.Generic.List <Models.Call_Customer> list = bll.GetCall_CustomerList(strKeyWord);
        foreach (var m in list)
        {
            sb.Append("{ \"name\":\"" + m.CC_Name + "\", \"to\": \"" + m.CC_ID + "\" },");
        }
        strCumstomers = "[" + sb.ToString().Trim(',') + "]";
        sb.Clear();
        UserInfoBLL            uBll     = new UserInfoBLL();
        List <Models.UserInfo> userList = new List <UserInfo>();

        userList = uBll.GetUserInfoList();
        foreach (var m in userList)
        {
            sb.Append("{ \"name\":\"" + m.UserName + "\", \"to\": \"" + m.UserCode + "\" },");
        }
        strUsers = "[" + sb.ToString().Trim(',') + "]";
    }
Example #2
0
        /// <summary>
        /// 通过心跳把客户端的通信IP和端口号存入数据库,然后有新消息的时候就发送
        /// </summary>
        /// <param name="e"></param>
        private void UdpPacketArrive(UdpPacketArrivedEventArgs e)
        {
            try
            {
                string msg = Encoding.UTF8.GetString(e.PacketData);
                var    m   = JsonConvert.DeserializeObject <MessageModel>(msg);

                //判断用户是否已经登录
                if (!IsLogin(m.FromUid))
                {
                    return;
                }

                //获取我的消息
                GetMyMsg(m.FromUid, m.ToUid, e);

                //如果不是心跳包则新消息入库并立即发送
                if (!m.Msg.Equals("heart"))
                {
                    //入库并响应客户端
                    ResponseToClientIfMsgSendSuccess(SaveMsg(m), m.id, e);
                    //立即把消息发给朋友
                    SendMsg(m);
                }
                else
                {
                    //更新通信IP、端口
                    UserInfoBLL.UpdateUdpEndPoint(e.RemoteEndPoint.Address.ToString(), e.RemoteEndPoint.Port, m.FromUid);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace + ex.Message);
            }
        }
Example #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request["userName"] != null && Request["userPwd"] != null)
            {
                MessageInfo          msg  = new MessageInfo();
                string               name = Request["userName"].ToString();
                string               pwd  = Request["userPwd"].ToString();
                List <UserInfoModel> list = UserInfoBLL.LoginList(name, pwd);

                if (list.Count > 0)
                {
                    Response.Write("{");
                    Response.Write("\"intchk\":0,");
                    Response.Write("\"strMsg\":\"登录成功!\",");
                    Response.Write("\"rows\":");
                    Response.Write(JsonConvert.SerializeObject(list));
                    Response.Write("}");
                }
                else
                {
                    msg.intchk = 1;
                    msg.strMsg = "登录失败!";
                    Response.Write(JsonConvert.SerializeObject(msg));
                }
            }
        }
Example #4
0
        protected void edit_Click(object sender, EventArgs e)
        {
            var valueList = new List <UserDefinedFieldValue>();

            if (site_udfList != null && site_udfList.Count > 0)
            {
                //var list = new List<UserDefinedFieldValue>();
                foreach (var udf in site_udfList)
                {
                    var new_udf = new UserDefinedFieldValue()
                    {
                        id    = udf.id,
                        value = Request.Form[udf.id.ToString()] == "" ? null : Request.Form[udf.id.ToString()],
                    };
                    valueList.Add(new_udf);
                }
            }

            if (valueList != null && valueList.Count > 0)
            {
                var user = UserInfoBLL.GetUserInfo(GetLoginUserId());
                if (new UserDefinedFieldsBLL().UpdateUdfValue(DicEnum.UDF_CATE.SITE, site_udfList, account.id, valueList, user, DicEnum.OPER_LOG_OBJ_CATE.CUSTOMER_SITE))
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "提示信息", "<script>alert('保存成功');window.close();</script>");
                }
                else
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "提示信息", "<script>alert('保存失败');window.close();</script>");
                }
            }
            else
            {
                ClientScript.RegisterStartupScript(this.GetType(), "提示信息", "<script>alert('尚未配置站点信息');window.close();</script>");
            }
        }
Example #5
0
 private void OK()
 {
     if (Common.TextBoxChecked(this.tbPwd) && Common.TextBoxChecked(this.tbNewPwd) &&
         Common.TextBoxChecked(this.tbConfirm) && Common.PasswordConfirmed(tbNewPwd, tbConfirm) && tbNewPwd.Text.TrimEnd() != Common.User.Pwd)
     {
         Common.User.Pwd = this.tbNewPwd.Text.TrimEnd();
         Common.User.LastPwdChangedTime = DateTime.Now;
         UserInfoBLL _bll = new UserInfoBLL();
         if (_bll.UdateUser(Common.User))
         {
             Utils.ShowMessageBox(Messages.ResetPasswordSuccessfully, Messages.TitleNotification);
             Undo();
             //记录成功的日志
             if (Common.User.UserName != Common.SUPERUSER)
             {
                 logBll.InsertLog(() =>
                 {
                     Dictionary <string, object> dic = new Dictionary <string, object>();
                     dic.Add("OperateTime", DateTime.UtcNow);
                     dic.Add("Action", LogAction.ChangePassword);
                     dic.Add("UserName", Common.User.UserName);
                     dic.Add("FullName", Common.User.FullName);
                     dic.Add("Detail", Common.User.UserName);
                     dic.Add("LogType", LogAction.SystemAuditTrail);
                     return(dic);
                 });
             }
         }
         else
         {
             Utils.ShowMessageBox(Messages.ResetPasswordFailed, Messages.TitleError);
         }
         //form.Close();
     }
 }
Example #6
0
        private void btnUserDel_Click(object sender, System.EventArgs e)
        {
            if (userDataGridView.SelectedRows.Count > 0)
            {
                UserManageBLL umb = new UserManageBLL();
                UserInfoBLL   uib = new UserInfoBLL();
                DialogResult  RSS = MessageBox.Show(this, "确定要删除选中行数据吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                switch (RSS)
                {
                case DialogResult.Yes:
                    for (int i = this.userDataGridView.SelectedRows.Count; i > 0; i--)
                    {
                        int ID = Convert.ToInt32(userDataGridView.SelectedRows[i - 1].Cells[0].Value);
                        umb.Delete(ID);
                    }
                    MessageBox.Show("成功删除选中行数据!", "信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    userDataGridView.DataSource = uib.GetList();
                    break;

                case DialogResult.No:
                    break;
                }
            }
            else
            {
                MessageBox.Show("请选择所要删除的行。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
        }
Example #7
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/html";

            UserInfoBLL bll = new UserInfoBLL();

            int      id   = Convert.ToInt32(context.Request.Form["id"]);
            UserInfo user = bll.GetUserById(id);

            if (user != null)
            {
                user.UserId   = id;
                user.UserName = context.Request.Form["name"];
                user.UserPwd  = context.Request.Form["pwd"];
                //bll.EditUser(user);
                if (bll.EditUser(user) > 0)
                {
                    context.Response.Redirect("UserInfoList.ashx");
                }
                else
                {
                    context.Response.Write("Edit Faild");
                }
            }
        }
Example #8
0
        public ActionResult UserLogin()
        {
            string validateCode = Session["code"] == null ? string.Empty : Session["code"].ToString();

            if (string.IsNullOrEmpty(validateCode))
            {
                return(Content("no:请输入验证码!"));
            }
            Session["code"] = null;
            string txtCode = Request["vCode"];

            if (!validateCode.Equals(txtCode, StringComparison.InvariantCultureIgnoreCase))
            {
                return(Content("no:验证码错误!"));
            }
            string      userName        = Request["LoginCode"];
            string      userPwd         = Request["LoginPwd"];
            UserInfoBLL UserInfoService = new UserInfoBLL();
            T_UserInfo  userInfo        = UserInfoService.GetUserInfo(userName, userPwd);

            if (userInfo != null)
            {
                Session["userInfo"] = userInfo;
                return(Content("ok:登录成功"));
            }
            else
            {
                return(Content("no:登录失败!!"));
            }
        }
Example #9
0
        /// <summary>
        /// 点击next时设置userinfo属性
        /// </summary>
        private bool SetUserInfo()
        {
            UserCreate createUser = dic[WizardName.CreateUser] as UserCreate;

            if (!string.IsNullOrEmpty(createUser.UserName) && !string.IsNullOrEmpty(createUser.FullName) &&
                !string.IsNullOrEmpty(createUser.Role) && !string.IsNullOrEmpty(createUser.Password))
            {
                /*密钥长度*/
                if (policy == null || policy.MinPwdSize > createUser.Password.Length)
                {
                    return(false);
                }
                int userid = new UserInfoBLL().GetCurrentUserID();
                if (user == null)
                {
                    user = new UserInfo();
                }
                user.Userid             = userid + 1;
                user.UserName           = createUser.UserName;
                user.Account            = createUser.UserName;
                user.FullName           = createUser.FullName;
                user.Description        = createUser.Role;
                user.Pwd                = createUser.Password;
                user.ChangePwd          = 1;
                user.Locked             = 0;
                user.RoleId             = createUser.Group;
                user.LastPwdChangedTime = DateTime.Now;
                user.Remark             = DateTime.Now.ToString();
                return(true);
            }
            return(false);
        }
        // GET: Login
        public string Login(string username, string password, string nickname)
        {
            var error = new ErrorMessage();

            if (string.IsNullOrEmpty(username) || string.IsNullOrEmpty(password))
            {
                error.State = 1;
                error.Msg   = "用户名或者昵称不可以为空";
            }
            else if (UserInfoBLL.IsExistUser <UserInfoModel>(username))
            {
                error.State = 1;
                error.Msg   = "用户名已经存在";
            }
            else if (UserInfoBLL.IsExistNickName <UserInfoModel>(nickname))
            {
                error.State = 2;
                error.Msg   = "昵称已经存在";
            }
            else
            {
                error.State = 0;
            }
            return(Newtonsoft.Json.JsonConvert.SerializeObject(error));
        }
Example #11
0
    /// <summary>
    /// 用户信息
    /// </summary>
    private void UpdateUserInfomation()
    {
        if (!string.IsNullOrEmpty(Context.Request.QueryString["userID"]))
        {
            int         id  = Convert.ToInt32(Context.Request.QueryString["userID"]);
            UserInfoBLL bll = new UserInfoBLL();
            user = new UserInfo();
            user = bll.GetUserInfoEntity(id);
            if (user.EntyTime != null)
            {
                EntyTime = Convert.ToDateTime(user.EntyTime).ToString("yyyy-MM-dd");
            }

            //Status = PublicEnum.GetEnumDescription<PublicEnum.PublicStatus>(user.UserStatus.ToString());\
            if (user.IsAdmin != null && !string.IsNullOrEmpty(user.IsAdmin.ToString()))
            {
                if (Convert.ToInt32(user.IsAdmin) == 0)
                {
                    isAdmin = "<input type='radio' name='rdAdmin' value='1'id='radio' style='width:50px;' />是 <input type='radio' name='rdAdmin' value='0'checked='checked' id='radio'style='width:50px;' />否";
                }
                else if (Convert.ToInt32(user.IsAdmin) == 1)
                {
                    isAdmin = "<input type='radio' name='rdAdmin' value='1' id='radio' checked='checked'style='width:50px;' />是 <input type='radio' name='rdAdmin' value='0'  id='radio' style='width:50px;' />否";
                }
            }
        }
    }
Example #12
0
 /// <summary>
 /// 初始化数据
 /// </summary>
 private void Init()
 {
     /*用户向导pannel维护列表*/
     dic = new Dictionary <WizardName, UserControl>();
     dic.Add(WizardName.CreateUser, new UserCreate(this)
     {
         FirstCreate = this.flag
     });
     dic.Add(WizardName.CreatePolicy, new UserPolicy());
     dic.Add(WizardName.CreateRight, new UserRight());
     dic.Add(WizardName.CreateMean, new UserMeaning());
     /*显示第一款面板*/
     this.pnShow.Controls.Clear();
     this.pnShow.Controls.Add(dic[WizardName.CreateUser]);
     this.btnSave.Enabled = false;
     this.UserEvent      += new EventHandler(delegate(object sender, EventArgs args) { ((UserCreate)dic[WizardName.CreateUser]).SetValue(); });
     this.PolicyEvent    += new EventHandler(delegate(object sender, EventArgs args) { ((UserPolicy)dic[WizardName.CreatePolicy]).SetValue(); });
     this.MeanEvent      += new EventHandler(delegate(object sender, EventArgs args) { ((UserMeaning)dic[WizardName.CreateMean]).SetValue(); });
     this.RightEvent     += new EventHandler((a, b) => { ((UserRight)dic[WizardName.CreateRight]).SetValue(); });
     ((UserRight)dic[WizardName.CreateRight]).SignRightOnChange += new EventHandler(SetNextEnableOnThird);
     if (this._userbll == null)
     {
         this._userbll = new UserInfoBLL();
     }
 }
        public ActionResult GetAllUserInfos()
        {
            int    pageIndex    = int.Parse(Request["page"] ?? "1");
            int    pageSize     = int.Parse(Request["rows"] ?? "10");
            int    total        = 0;
            string SearchName   = Request["SearchName"];
            string SearchReMark = Request["SearchMark"];


            //获取分页数据

            var queryParam = new QueryParam()
            {
                pageSize = pageSize, pageIndex = pageIndex, TotalCount = 0, SearchName = SearchName, SearchReMark = SearchReMark
            };

            var pageData = UserInfoBLL.LoadDataByParam(queryParam).Select(u => new { ID = u.ID, u.UName, u.ReMark, u.Pwd, u.ShowName, u.ModfiedOn, u.SubTime });
            //解决导航属性循环依赖的错误
            // var pageData = UserInfoBLL.GetEntitiesPage(pageSize, pageIndex, out total, u => u.DelFlag == DelFlag, u => u.ID).Select(u => new { u.ID, u.UName, u.ReMark, u.Pwd, u.ShowName, u.ModfiedOn, u.SubTime });

            //匿名类
            var data = new { total = queryParam.TotalCount, rows = pageData.ToList() };

            //返回json数据
            return(Json(data, JsonRequestBehavior.AllowGet));
        }
Example #14
0
        public ActionResult userCenter(UserInfo obj)
        {
            string userName = this.User.Identity.Name;

            obj = new UserInfoBLL().GetObjByUName(userName);
            return(View(obj));
        }
Example #15
0
        public ActionResult UCLeft(UserInfo obj)
        {
            string uPhone = this.User.Identity.Name;

            obj = new UserInfoBLL().GetObjByTel(uPhone);
            return(PartialView("_UCLeft", obj));
        }
Example #16
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (LoginSessionVal() || isLoginCookie())
     {
         if (Request.HttpMethod == "POST")
         {
             int    iUID       = GetUserID();
             string sCredenNum = UserInfoBLL.UserCredennumSel(iUID);
             string sBackUrL   = Request.UrlReferrer.ToString();
             string sGoUrL     = string.Format("http://{0}/user.html", Request.UrlReferrer.Host);
             if (sCredenNum.Length > 14)
             {
                 Response.Write(string.Format("<script>alert('已经解除防沉迷!');location.href='{0}';</script>", sBackUrL));
                 return;
             }
             string sUserName      = CYRequest.GetFormString("RealName");
             string sCredenNumPost = CYRequest.GetFormString("CredenNum");
             int    iNum           = UserInfoBLL.UserInfoUpdateOfIndulge(sUserName, sCredenNumPost, iUID);
             if (iNum > 0)
             {
                 Response.Write(string.Format("<script>alert('防沉迷解除成功!谢谢!');location.href='{0}';</script>", sGoUrL));
                 return;
             }
             else
             {
                 Response.Write(string.Format("<script>alert('防沉迷解除失败!');location.href='{0}';</script>", sBackUrL));
                 return;
             }
         }
     }
 }
Example #17
0
        protected void btnpost_OnClick(object sender, EventArgs e)
        {
            string username = this.txbUserName.Text.Trim();
            string pwd      = this.txbPWD.Text.Trim();

            switch (Helper.YzNameandPwd(username, pwd))
            {
            case 0:
                this.lbMsg.Text = "请输入用户名或密码!";
                return;

            case 1:
                this.lbMsg.Text = "用户名或密码格式错误!";
                return;

            case 2:
                break;
            }

            UserInfo userInfo = new UserInfoBLL().LoginUser(username);

            if (userInfo != null)
            {
                //登陆成功
                Session["UserInfo"]  = userInfo;
                Session["UserState"] = new UserStateBLL().GetUserState(userInfo);
                //跳转
                Response.Redirect("Index.aspx");
            }
        }
Example #18
0
        public void Login(HttpContext context)
        {
            string name = context.Request["name"];
            string pwd  = context.Request["pwd"];
            //context.Response.ContentType = "text/plain";
            DataTable dt = new UserInfoBLL().GetTable(name, pwd);

            if (dt.Rows.Count > 0)
            {
                string id = dt.Rows[0][0].ToString();
                context.Session["getuser"] = new UserInfoBLL().GetInfoById(id);
                UserInfoEntity obj = (UserInfoEntity)context.Session["getuser"];

                if (obj.UserStatr == 1)
                {
                    //context.Session["user"] = dt;
                    //修改最后登录时间
                    new UserInfoBLL().GetUpadteLoginTime(obj.UserID.ToString());
                    contextResponseWrite(context, dt);
                }
                else
                {
                    contextResponseWrite(context, "enableed");
                    return;
                }
            }
            else
            {
                contextResponseWrite(context, "1");
            }
        }
Example #19
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            //获取帐号和密码

            string name = txtLoginName.Text.Trim();
            string pwd  = txtLoginPwd.Text.Trim();

            //判断帐号和密码不能为空
            pwd = Common.GetStringMD5(pwd);
            if (CheckText(name, pwd))
            {
                //帐号和密码都不为空
                UserInfoBLL bll = new UserInfoBLL();
                string      msg;
                //登录是否成功
                if (bll.LoginByLoginName(name, pwd, out msg))
                {
                    msgDiv1.MsgDivShow(msg, 1, Bind);
                }
                else//登录失败
                {
                    msgDiv1.MsgDivShow(msg, 1);
                }
            }


            //调用bll中的登录的方法
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            UserInfoBLL bll = new UserInfoBLL();

            if (IsPostBack)
            {
                UserInfo ui = new UserInfo();
                ui.UserId      = int.Parse(Request["uid"]);
                ui.UserName    = Request["username"];
                ui.Email       = Request["email"];
                ui.Address     = Request["address"];
                ui.MobilePhone = Request["mobilephone"];
                if (bll.UpdateUserInfoById(ui))
                {
                    Response.Redirect("UserManagerList.aspx");
                }
                else
                {
                    Response.Redirect("Error.html");
                }
            }
            else
            {
                int id = int.Parse(Request["id"]);
                ui = bll.GetUserInfoById(id);
            }
        }
Example #21
0
        //查询当行
        public void SelectbyId(HttpContext context)
        {
            string         id  = context.Request["userid"];
            UserInfoEntity obj = new UserInfoBLL().GetInfoById(id);

            LoginHandler.contextResponseWrite(context, obj);
        }
Example #22
0
        private void Save()
        {
            MeanEvent(form, new EventArgs());//先获取meaning的设置
            if (_userbll == null)
            {
                _userbll = new UserInfoBLL();
            }
            UserMeaning um = dic[WizardName.CreateMean] as UserMeaning;

            if (_userbll.InsertUserWizard(user, um.mEntity))
            {
                form.DialogResult = DialogResult.OK;
                //insert sys log
                new OperationLogBLL().InsertLog(() =>
                {
                    Dictionary <string, object> d = new Dictionary <string, object>();
                    d.Add("OperateTime", DateTime.Now);
                    d.Add("Action", "Create user account");
                    d.Add("UserName", user.UserName);
                    d.Add("FullName", "");
                    d.Add("Detail", user.UserName);
                    d.Add("LogType", 0);
                    return(d);
                });
            }
            else
            {
                form.DialogResult = DialogResult.No;
            }
        }
Example #23
0
    private void getCustomerList()
    {
        strCallWorkBillStatusDrop = PublicMethod.getWorkBillStatusCallCategory(2, false, false, 27);// PublicEnum.EnumBindList_Client<PublicEnum.CallWorkBillStatus>(false, false, intStatus);

        System.Text.StringBuilder sb  = new System.Text.StringBuilder();
        HYTD.BLL.Call_CustomerBLL bll = new HYTD.BLL.Call_CustomerBLL();
        string strKeyWord             = string.Empty;

        if (!string.IsNullOrEmpty(Request["keyword"]))
        {
            strKeyWord = Request["keyword"].ToString().Trim();
        }
        System.Collections.Generic.List <Models.Call_Customer> list = bll.GetCall_CustomerList(strKeyWord);
        foreach (var m in list)
        {
            sb.Append("{ \"name\":\"" + m.CC_Name + "\", \"to\": \"" + m.CC_ID + "\" },");
        }
        strCumstomers = "[" + sb.ToString().Trim(',') + "]";
        sb.Clear();
        UserInfoBLL            uBll     = new UserInfoBLL();
        List <Models.UserInfo> userList = new List <UserInfo>();

        userList = uBll.GetUserInfoList();
        foreach (var m in userList)
        {
            sb.Append("{ \"name\":\"" + m.UserName + "\", \"to\": \"" + m.UserCode + "\" },");
        }
        strUsers = "[" + sb.ToString().Trim(',') + "]";
    }
Example #24
0
    /// <summary>
    /// 添加普通员工
    /// </summary>
    private void UpdateUser()
    {
        UserInfoBean uib  = new UserInfoBean(); //实体Bean
        UserInfoBLL  uBll = new UserInfoBLL();  //逻辑层

        //得到表单提交的值
        //uib.LoginName = Session["LoginName"].ToString();
        uib.UserId    = int.Parse(Request.Form["UserId"].ToString());
        uib.LoginPass = Request.Form["LoginPass"];
        uib.UserName  = Request.Form["UserName"];
        uib.Remark    = Request.Form["remark"];
        string json;

        //如果success为true,则表示服务器端处理成功
        if (uBll.UpdateUser(uib))
        {
            json = @"{success: true}";
        }
        else
        {
            json = @"{success: false}";
        }



        Response.Write(json);
    }
Example #25
0
        protected void Page_Load(object sender, EventArgs e)
        {
            UserInfoBLL bll = new UserInfoBLL();

            if (!IsPostBack)
            {
                int id;
                if (int.TryParse(Request.QueryString["id"], out id))
                {
                    EdUser = bll.GetUserById(id);
                }
                else
                {
                    Response.Write("paras Error");
                }
            }
            else
            {
                UserInfo user = new UserInfo();
                user.UserId   = Convert.ToInt32(Request.Form["id"]);
                user.UserName = Request.Form["name"];
                user.UserPwd  = Encryption.MD5encryption(Request.Form["pwd"]);

                if (bll.EditUser(user) > 0)
                {
                    Response.Redirect("Index.aspx");
                }
                else
                {
                    Response.Write("Error");
                }
            }
        }
        private void btnreg_Click(object sender, EventArgs e)
        {
            UserInfo userNew = new UserInfo();

            userNew.UserName = txtName.Text;

            userNew.UserPwd     = Encryption(txtPsw.Text);
            userNew.UserPhone   = txtPho.Text;
            userNew.Flag        = 0;
            userNew.UserDelFlag = 0;
            //给UserAccount赋值 由于UserAccount不能设置为自动增长,随机数又的检测重复,所以我再次只获取用户的数量,根据用户数量给用户设置登录账号
            UserInfoBLL userBLL   = new UserInfoBLL();
            int         userCount = userBLL.GetUserCountByUserDelFlag(0);

            userNew.UserAccount = GetUserAccountByUserCount(userCount);
            int msg = userBLL.InsertUserInfo(userNew);//1成功   0失败

            //查看是否注册成功 成功:给用户返回登录账号,关闭注册窗体   失败:显示直接停留在注册窗体
            if (msg == 1)
            {
                MessageBox.Show("注册成功,请牢记您的登录账号:" + userNew.UserAccount);
                this.Close();
            }
            else
            {
                MessageBox.Show("注册失败,请重新注册");
                txtName.Text = "";
                txtPho.Text  = "";
                txtPsw.Text  = "";
            }
        }
Example #27
0
        /// <summary>
        /// delete items User
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Button2_Click(object sender, EventArgs e)
        {
            string id = null;

            for (int i = 0; i < GridView1.Rows.Count; i++)
            {
                if (((CheckBox)(GridView1.Rows[i].FindControl("CheckBox1"))).Checked)
                {
                    id += GridView1.DataKeys[i].Value + ",";
                    // id += this.GridView1.Rows[i].Cells[1].Text + ",";
                }
            }

            if (id == null)
            {
                Response.Write(" <script>alert('请选择要删除的行!')</script>");
            }
            else
            {
                id = id.Substring(0, id.Length - 1);
                UserInfoBLL obj = new UserInfoBLL();
                Response.Write(" <script>alert('" + obj.deleteUserbyIds(id) + "')</script>");
                displaypage();
            }
        }
Example #28
0
        public void TestMethod1()
        {
            DataModelContainer db = new DataModelContainer();
            var temp = new UserInfoBLL().GetList(o => true);

            foreach (UserInfo userinfo in temp)
            {
                string a = userinfo.Name;
            }
            //for (int i = 29; i < 30; i++)
            //{
            //    UserInfo userinfo = new UserInfo()
            //    {
            //        Name = "测试" + i
            //    };
            //    new UserInfoBLL().Add(userinfo);
            //    //new UserInfoDAL().Add();
            //}
            //new UserInfoBLL().Delete(new UserInfo()
            //{
            //    ID = 2
            //});
            //var temp = new UserInfoBLL().GetList( o => o.Name.Contains("测"));
            //foreach (UserInfo userinfo in temp)
            //{

            //}
            //
            // TODO: 在此处添加测试逻辑
            //
        }
Example #29
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (IsPostBack)
     {
         UserInfo ui = new UserInfo();
         ui.UserName     = Request["userid"].Trim();
         ui.UserPwd      = UI.Common.MD5Encrypt.MD5Check(Request["password"]);
         ui.Email        = Request["email"];
         ui.Address      = Request["address"];
         ui.MobilePhone  = Request["mobilephone"];
         ui.RegisterTime = System.DateTime.Now;
         ui.LoginTime    = System.DateTime.Now;
         ui.State        = 0;
         UserInfoBLL bll = new UserInfoBLL();
         if (bll.InsertUserInfo(ui))
         {
             Session["user"] = ui.UserName;
             //Session["id"] = ui.UserId;
             Context.Response.Redirect("Activation.aspx");
         }
         else
         {
             Context.Response.Redirect("Error.html");
         }
     }
 }
Example #30
0
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            string msg = UserInfoBLL.GetUserCountByNameAndPwd(txtUsername.Text, txtPwd.Text, isAdmin);

            if (msg == "登录成功")
            {
                Session["isadmin"] = isAdmin;
                Session["uname"]   = txtUsername.Text;
                Session["uid"]     = UserInfoBLL.GetIDByName(txtUsername.Text);
                if (isAdmin)
                {
                    Modal.Show(this, "登录成功,即将跳转到管理面板", 1000, "dashboard/index.aspx");
                }
                else
                {
                    Modal.Show(this, "登录成功,即将跳转到首页", 1000, "index.aspx");
                }
            }
            else
            {
                Session["isadmin"] = null;
                Session["uname"]   = null;
                Session["uid"]     = null;
                Modal.Show(this, msg);
            }
        }
Example #31
0
 public SMSSend()
 {
     departmentBLL = new P_DepartmentInfoBLL();
     groupBLL = new P_GroupBLL();
     personBLL = new P_PersonInfoBLL();
     jobTemplateBLL = new J_JobTemplateBLL();
     jobInfoBLL = new J_JobInfoBLL();
     userInfoBLL = new UserInfoBLL();
     smsContentBLL = new S_SMSContentBLL();
     smsRecord_CurrentBLL = new S_SMSRecord_CurrentBLL();
     SetRedisProperties();
 }
Example #32
0
        static void Main(string[] args)
        {
            //TestModel.PersonInfo perModel = GetPerson();
            //Console.WriteLine(perModel.Id);
            //Console.WriteLine(perModel.Name);
            //Console.WriteLine("------------------");
            //perModel.Name = "屈远";
            //DBContextFactory.SetTestModel(perModel);
            //Console.WriteLine(GetPerson().Id);
            //Console.WriteLine(GetPerson().Name);
            //Console.ReadLine();
            //UserInfoDAL dal = new UserInfoDAL();

            IUserInfoBLL ibll;

            ibll = new UserInfoBLL();

            //List<UserInfo> list= dal.GetListBy(
            //    u => u.DelFlag==false).ToList();

            List<UserInfo> list = ibll.GetListBy(u => u.DelFlag == false&&u.ID==2).ToList();

            //UserInfo userInfo = new UserInfo()
            //{
            //    DelFlag = false,
            //    ModifiedOnTime = DateTime.Now,
            //    Sort =100,
            //    SubTime = DateTime.Now,
            //     Remark="123",
            //    UName ="测试1",
            //    UPwd="123"
            //};
            //dal.Create(userInfo);
            //dal.SaveChange();
            //list.ForEach(a => Console.WriteLine(a.ID + " " + a.UName));
            Console.ReadLine();
        }
Example #33
0
        public ActionResult Configure(string conf_css, string conf_side_html, string conf_first_html, string conf_tail_html, string conf_js)
        {
            var IsShowCSS = Request.Form["IsShowCSS"] == "on";
            var IsDisCSS = Request.Form["IsDisCSS"] == "on";
            if (BLLSession.UserInfoSessioin == null)
                return Json("您还没有登录 不能修改~"); ;
            try
            {
                //==============================================================================================================
                //遗留问题:
                //如下:如果 userinfobll.Up(BLLSession.UserInfoSessioin.UserInfo)两次的话 报异常:[一个实体对象不能由多个 IEntityChangeTracker 实例引用]
                //那么 我只能 new一个新的对象 修改  然后 同时 BLLSession.UserInfoSessioin.UserInfo里面的属性,不然 其他地方访问的话 是没有修改过来的值
                //==============================================================================================================
                var userinftemp = new ModelDB.UserInfo(); //BLLSession.UserInfoSessioin.UserInfo;
                BLL.UserInfoBLL userinfobll = new UserInfoBLL();
                if (Request.Form["TerminalType"] == "PC")//如果是PC端
                {
                    userinftemp.IsShowCSS =
                        BLLSession.UserInfoSessioin.UserInfo.IsShowCSS = IsShowCSS;
                    userinftemp.IsDisCSS =
                        BLLSession.UserInfoSessioin.UserInfo.IsDisCSS = IsDisCSS;
                    userinftemp.Id =
                        BLLSession.UserInfoSessioin.UserInfo.Id;
                    userinfobll.Up(userinftemp, "IsShowCSS", "IsDisCSS");//"IsShowHTML",, "IsShowJS"
                }
                else
                {
                    userinftemp.IsShowMCSS =
                      BLLSession.UserInfoSessioin.UserInfo.IsShowMCSS = IsShowCSS;
                    userinftemp.IsDisMCSS =
                        BLLSession.UserInfoSessioin.UserInfo.IsDisMCSS = IsDisCSS;
                    userinftemp.Id =
                        BLLSession.UserInfoSessioin.UserInfo.Id;
                    userinfobll.Up(userinftemp, "IsShowMCSS", "IsDisMCSS");
                }

                CacheData.GetAllUserInfo().FirstOrDefault(t => t.Id == BLLSession.UserInfoSessioin.Id).UserInfo
                    = BLLSession.UserInfoSessioin.UserInfo;

                userinfobll.save();

                string path = FileHelper.defaultpath + "/MyConfigure/" + BLLSession.UserInfoSessioin.UserName + "/";
                FileHelper.CreatePath(path);
                if (conf_css.Length >= 40000 ||
                    conf_tail_html.Length >= 40000 ||
                    conf_first_html.Length >= 40000 ||
                    conf_side_html.Length >= 40000 ||
                    conf_js.Length >= 40000)
                {
                    return Json("您修改的内容字符过多~");
                }

                if (Request.Form["TerminalType"] == "PC")//如果是PC端
                {
                    FileHelper.SaveFile(path, "conf.css", conf_css);
                    FileHelper.SaveFile(path, "conf_side.txt", conf_side_html);
                    FileHelper.SaveFile(path, "conf_first.txt", conf_first_html);
                    FileHelper.SaveFile(path, "conf_tail.txt", conf_tail_html);
                    FileHelper.SaveFile(path, "conf.js", conf_js);
                }
                else
                {
                    FileHelper.SaveFile(path, "Mconf.css", conf_css);
                    FileHelper.SaveFile(path, "Mconf_side.txt", conf_side_html);
                    FileHelper.SaveFile(path, "Mconf_first.txt", conf_first_html);
                    FileHelper.SaveFile(path, "Mconf_tail.txt", conf_tail_html);
                    FileHelper.SaveFile(path, "Mconf.js", conf_js);
                }

                return Json("修改成功~");
            }
            catch (Exception)
            {
                return Json("修改失败~"); ;
            }
        }
Example #34
0
        public void ExceutedTest(IJobExecutionContext context)
        {
            if (jobInfoBLL == null)
            {
                jobInfoBLL = new J_JobInfoBLL();
            }
            if (userInfoBLL == null)
            {
                userInfoBLL = new UserInfoBLL();
            }
            if (qrtz_triggerBLL == null)
            {
                qrtz_triggerBLL = new QRTZ_TRIGGERSBLL();
            }
            #region 11月8日测试修改数据库的bug,现注释
            //11月8日测试修改数据库的bug,现注释
            //var targetJob = jobInfoBLL.GetListBy(j => j.JID == 18).FirstOrDefault();
            //if (targetJob != null)
            //{
            //    targetJob.JobState = 2;

            //}
            //jobInfoBLL.Update(targetJob);
            #endregion

            //向数据库中写入
            //获取JobDataMap
            var data = context.JobDetail.JobDataMap;
            //1 需要传入一个用户id

            var uid = data.GetInt("UID");
            if (uid != 0)
            {
                //var uid_int = int.Parse(uid);
                var user_temp = userInfoBLL.GetListBy(u => u.ID == uid).FirstOrDefault();
                //2 根据用户id查询查询该用户所拥有的作业
                var list = userInfoBLL.GetJobListByUser(user_temp.ID);

                //3 取出对应的作业
                //取出的context.JobDetail.Key.Name实际为JID
                //**查错,暂时注释**
                var targetJob = (from j in list
                                 where j.JID == Convert.ToInt32(context.JobDetail.Key.Name)  /*&& j.JobGroup == context.JobDetail.Key.Group*/
                                 select j).FirstOrDefault();
                PMS.BLL.J_JobInfoBLL job_temp = new PMS.BLL.J_JobInfoBLL();

                //UpdateJobState(targetJob);
                //4 若存在则更新作业状态
                //**查错,暂时注释**
                if (targetJob != null)
                {
                    //4 更新作业状态的思路
                    //4-1 获取trigger的状态
                    var trigger_temp = qrtz_triggerBLL.GetListBy(t => t.TRIGGER_NAME == context.JobDetail.Key.Name).FirstOrDefault();
                    //注意若完成时其中的
                    if (trigger_temp != null)
                    {
                        var dic = PMS.Model.Dictionary.Quartz_TriggerStateDictionary.GetResponseCode();
                        //4-2获取trigger其他状态
                        //1)修改往数据库中写入的作业状态
                        targetJob.JobState = dic[trigger_temp.TRIGGER_STATE == null ? "null" : trigger_temp.TRIGGER_STATE];
                        //2)修改作业结束时间(世界时需+8)
                        targetJob.EndRunTime = context.Trigger.EndTimeUtc.GetValueOrDefault().DateTime.AddHours(8);
                        //3)修改作业下次执行时间(世界时需+8)
                        if (context.Trigger.GetNextFireTimeUtc() != null)
                        {
                            targetJob.NextRunTime = context.Trigger.GetNextFireTimeUtc().GetValueOrDefault().DateTime.AddHours(8);
                        }
                    }
                    UpdateJobState(targetJob);

                }
                //4 若不存在则创建新的作业
            }
        }