Пример #1
0
        public string AddUserInfo(Model.UserInfo userInfo)
        {
            if (userInfo.UserLoginName == "" || userInfo.UserLoginName == null)
            {
                return(ViewBag.Errmsg = "no:请输入用户登录名!");
            }
            if (userInfo.Age > 120 || userInfo.Age < 0 || userInfo.Age == null)
            {
                return(ViewBag.Errmsg = "no:请输入正确的年龄!");
            }
            if (userInfo.UserMail == "" || userInfo.UserMail == null)
            {
                return(ViewBag.Errmsg = "no:请输入邮箱!");
            }

            if (userInfo.UserName == "" || userInfo.UserName == null)
            {
                return(ViewBag.Errmsg = "no:请输入用户真实名!");
            }

            if (userInfo.UserPsd == "" || userInfo.UserPsd == null)
            {
                return(ViewBag.Errmsg = "no:请输入密码!");
            }

            if (userInfoBll.Add(userInfo))
            {
                return(ViewBag.Errmsg = "ok:添加成功");
            }
            else
            {
                return(ViewBag.Errmsg = "ok:添加失败");
            }
        }
Пример #2
0
        public int CheckAuthorisation(string username)
        {
            Context _Context = new Context();

            Model.UserInfo _UserInfo = _Context.UsersInfo.Where(e => e.Username == username).SingleOrDefault();
            return(_UserInfo.Authorisation);
        }
Пример #3
0
 public int Add(Model.UserInfo user)
 {
     using (IDbConnection cn = new MySqlConnection(cns))
     {
         string sql = "insert into userinfo values(@userName,@passWord,@qq,@email,@type,@userImg);";
         return(cn.Execute(sql, user));
     }
 }
Пример #4
0
 public int Update(Model.UserInfo user)
 {
     using (IDbConnection cn = new MySqlConnection(cns))
     {
         string sql = "update userinfo set password=@passWord,qq=@qq,email=@email,type=@type,userimg=@userImg where username=@userName";
         return(cn.Execute(sql, user));
     }
 }
Пример #5
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public static int UpdateShopInfo(Model.UserInfo model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update UserInfo set ");

            strSql.Append("username=@username,");
            strSql.Append("relName=@relName,");

            strSql.Append("comName=@comName,");

            strSql.Append("imgUrl=@imgUrl,");

            strSql.Append("remark=@remark,");

            strSql.Append("mobileCode=@mobileCode,");

            strSql.Append("activeCode=@activeCode,");
            strSql.Append("mainbrand=@mainbrand,");

            strSql.Append("email=@email,shopType=" + model.shopType + ",weibo = '" + model.weibo + "'");
            strSql.Append(" where id=@id");
            SqlParameter[] parameters =
            {
                new SqlParameter("@username",   SqlDbType.VarChar,  150),
                new SqlParameter("@relName",    SqlDbType.VarChar,  150),

                new SqlParameter("@comName",    SqlDbType.VarChar,  150),
                new SqlParameter("@imgUrl",     SqlDbType.VarChar,  150),

                new SqlParameter("@remark",     SqlDbType.VarChar, 1500),

                new SqlParameter("@mobileCode", SqlDbType.VarChar,  550),
                new SqlParameter("@activeCode", SqlDbType.VarChar,  550),
                new SqlParameter("@mainbrand",  SqlDbType.VarChar, 1500),

                new SqlParameter("@email",      SqlDbType.VarChar,  150),

                new SqlParameter("@id",         SqlDbType.Int, 4)
            };
            parameters[0].Value = model.username;
            parameters[1].Value = model.relName;
            parameters[2].Value = model.comName;
            parameters[3].Value = model.imgUrl;

            parameters[4].Value = model.remark;

            parameters[5].Value = model.mobileCode;
            parameters[6].Value = model.activeCode;
            parameters[7].Value = model.mainbrand;

            parameters[8].Value = model.email;
            parameters[9].Value = model.id;
            return(DBHelperSQL.ExecuteSql(strSql.ToString(), parameters));
        }
Пример #6
0
 /// <summary>
 /// 头像信息更新
 /// </summary>
 /// <param name="model"></param>
 /// <param name="num"></param>
 /// <returns></returns>
 public static int UpdateImg(Model.UserInfo model, int num)
 {
     if (num == 1)
     {
         string sql = "update UserInfo set shopingTime = '" + model.shopingtime + "' where id = " + model.id;
         return(DBHelperSQL.ExecuteSql(sql));
     }
     else if (num == 2)
     {
         string sql = "update UserInfo set mainbrand = '" + model.mainbrand + "' where id = " + model.id;
         return(DBHelperSQL.ExecuteSql(sql));
     }
     else if (num == 3)
     {
         string sql = "update UserInfo set mobileCode = '" + model.mobileCode + "' where id = " + model.id;
         return(DBHelperSQL.ExecuteSql(sql));
     }
     else if (num == 4)
     {
         string sql = "update UserInfo set activeCode = '" + model.activeCode + "' where id = " + model.id;
         return(DBHelperSQL.ExecuteSql(sql));
     }
     else if (num == 5)
     {
         string sql = "update UserInfo set imgUrl = '" + model.imgUrl + "' where id = " + model.id;
         return(DBHelperSQL.ExecuteSql(sql));
     }
     else if (num == 6)
     {
         string sql = "update UserInfo set remark = '" + model.remark + "' where id = " + model.id;
         return(DBHelperSQL.ExecuteSql(sql));
     }
     else if (num == 10)
     {
         string sql = "update UserInfo set zipCode = '" + model.zipCode + "' where id = " + model.id;
         return(DBHelperSQL.ExecuteSql(sql));
     }
     else if (num == 11)
     {
         string sql = "update UserInfo set qq = '" + model.qq + "' where id = " + model.id;
         return(DBHelperSQL.ExecuteSql(sql));
     }
     else if (num == 12)
     {
         string sql = "update UserInfo set weixin = '" + model.weixin + "' where id = " + model.id;
         return(DBHelperSQL.ExecuteSql(sql));
     }
     else if (num == 13)
     {
         string sql = "update UserInfo set weibo = '" + model.weibo + "' where id = " + model.id;
         return(DBHelperSQL.ExecuteSql(sql));
     }
     return(0);
 }
Пример #7
0
 private void Repeater1bind()
 {
     if (userid > 0)
     {
         Model.UserInfo info = BLL.UsersBLL.GetModel(userid);// UsersController.GetUserByUserID(userid);
         lbUserName.Text = info.UserName;
         //List<Model.Roles> list = BLL.Roles.GetList(-1, "RoleID in (select Roleid from UserRoles where userid=" + userid + ")", ""); //UsersController.GetListUserRoleByUserId(userid);
         DataTable dt = BLL.UserRolesBLL.GetUserRolesANDRoles("O.userid=" + userid);
         Repeater1.DataSource = dt;
         Repeater1.DataBind();
     }
 }
Пример #8
0
        /// <summary>
        /// 平台类登陆
        /// </summary>
        /// <param name="openId"></param>
        /// <param name="accessToken"></param>
        /// <param name="infoType"></param>
        /// <returns></returns>
        public static UserInfo GetModel(string loginname, string password)
        {
            string sql = "select * from UserInfo where mobile = '" + loginname + "' and md5Pass = '******'";

            Model.UserInfo model = new Model.UserInfo();
            DataSet        ds    = DBHelperSQL.Query(sql);

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DataRowToModel(ds.Tables[0].Rows[0]));
            }
            return(null);
        }
Пример #9
0
        public static string GetMenuJSON(int UserID)
        {
            string UserType = "";

            Model.UserInfo userinfo = BLL.UsersBLL.GetModel(UserID);
            if (userinfo == null || userinfo.UserID != UserID)
            {
                return("");
            }
            UserType = userinfo.UserType;
            List <TabsInfo> list   = BLL.TabsBLL.GetList(-1, "ParentId=0 and DisPlay='True'", "");
            string          result = "[";

            if (list != null && list.Count > 0)
            {
                foreach (TabsInfo info in list)
                {
                    if (PermissionBLL.GetPermission(info.TabKey, UserID, "VIEW"))
                    {
                        string TabUrl = "javascript:void(0);";
                        if (info.TabUrl.Length > 0)
                        {
                            //if (i == 1)
                            //    TabUrl = "Main.aspx?menuid=" + info.TabID;
                            //else
                            TabUrl = info.TabUrl;
                        }

                        result += "{\"url\":\"" + TabUrl + "\",\"id\":\"" + info.TabID + "\",\"name\":\"" + info.TabName + "\",\"submenu\":[]},";
                    }
                }
            }
            if (UserType == Common.enumUserType.host.ToString())
            {
                result += "{\"url\":\"javascript:void(0);\",\"id\":\"admin\",\"name\":\"admin\",\"submenu\":[]},";
                result += "{\"url\":\"javascript:void(0);\",\"id\":\"host\",\"name\":\"Host\",\"submenu\":[]},";
            }
            if (UserType == Common.enumUserType.admin.ToString())
            {
                result += "{\"url\":\"javascript:void(0);\",\"id\":\"admin\",\"name\":\"admin\",\"submenu\":[]},";
            }
            if (result.EndsWith(","))
            {
                result = result.Remove(result.Length - 1);
            }
            result += "]";
            return(result);
        }
Пример #10
0
        /// <summary>
        /// qq登陆授权
        /// </summary>
        /// <param name="openId"></param>
        /// <param name="accessToken"></param>
        /// <param name="infoType"></param>
        /// <returns></returns>
        public static UserInfo GetModel(string openId, string accessToken, int infoType)
        {
            string sql = "select * from UserInfo where bodyCode = '" + openId + "' and comName = '" + accessToken + "' and infoType = " + infoType;

            Model.UserInfo model = new Model.UserInfo();
            DataSet        ds    = DBHelperSQL.Query(sql);

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DataRowToModel(ds.Tables[0].Rows[0]));
            }
            else
            {
                return(null);
            }
        }
Пример #11
0
        public string ChangeUserInformation(int userID, string firstName, string familyName, string username, string phoneNumber, string plate)
        {
            Context _Context = new Context();

            Model.UserInfo _UserInfoObj = _Context.UsersInfo.Where(e => e.UserInfoID == userID).SingleOrDefault();
            _UserInfoObj = new Model.UserInfo()
            {
                FirstName   = firstName,
                FamilyName  = familyName,
                Username    = username,
                PhoneNumber = phoneNumber,
                Plate       = plate
            };
            _Context.Entry(_UserInfoObj).State = System.Data.Entity.EntityState.Modified;
            _Context.SaveChanges();
            return("Changed Successful!");
        }
Пример #12
0
        public bool AddNewUser(string firstName, string familyName, string username, string password, string phoneNumber, string plate, int authorisation)
        {
            Context _Context = new Context();

            Model.UserInfo _UserInfoObj = new Model.UserInfo()
            {
                FirstName     = firstName,
                FamilyName    = familyName,
                Username      = username,
                Password      = password,
                PhoneNumber   = phoneNumber,
                Plate         = plate,
                Authorisation = authorisation
            };
            _Context.UsersInfo.Add(_UserInfoObj);
            _Context.SaveChanges();
            return(true);
        }
Пример #13
0
        public UserInfo SelectUser(string userName) //查询表并返回结果
        {
            UserInfo user = null;                   //用于保存读取的数据

            try
            {
                SqlConnection conn = new SqlConnection(DbUtil.ConnString);
                //创建一个命令对象,并添加命令
                SqlCommand cmd = conn.CreateCommand();
                cmd.CommandText = DbUtil.userDataBasesql3;
                cmd.CommandType = CommandType.Text;
                cmd.Parameters.Add(new SqlParameter("@account", userName));

                //cmd.Parameters.Add(new SqlParameter("@account", "%" + userName + "%"));

                conn.Open();        //打开数据链接
                SqlDataReader reader = cmd.ExecuteReader();



                while (reader.Read())    //开始读取数据
                {
                    if (user == null)    //如果没有,则重新生成一个
                    {
                        user = new Model.UserInfo();
                    }
                    user.Account    = reader.GetString(reader.GetOrdinal("account"));
                    user.Name       = reader.GetString(reader.GetOrdinal("name"));
                    user.Password   = reader.GetString(reader.GetOrdinal("password"));
                    user.Permission = reader.GetString(reader.GetOrdinal("permission"));
                    user.Department = reader.GetString(reader.GetOrdinal("department"));
                }
            }
            catch (Exception ee)
            {
                exception = ee.ToString();
                //Console.WriteLine(ee.ToString());
            }

            //Console.WriteLine(image.ToString());
            return(user);
        }
Пример #14
0
        /// <summary>
        /// 查询是否有权限
        /// </summary>
        /// <param name="TabKey">页面Key</param>
        /// <param name="RoleID">角色ID</param>
        /// <param name="PermissionKey">权限Key(全部为大写 如添加为ADD,修改为UPDATE,删除为DELETE,查看为VIEW)</param>
        /// <returns></returns>
        public static bool GetPermission(string TabKey, int UserID, string PermissionKey)
        {
            bool isVIEW = false;

            try
            {
                Model.UserInfo userInfo = BLL.UsersBLL.GetModel(UserID);
                if (userInfo == null || userInfo.UserID <= 0)
                {
                    return(false);
                }
                if (userInfo.UserType == Common.enumUserType.host.ToString() || userInfo.UserType == Common.enumUserType.admin.ToString())
                {
                    return(true);
                }

                List <int> TabIDs = BLL.TabsBLL.GetTabIDsByTabKey(TabKey);

                foreach (int TabID in TabIDs)
                {
                    if (TabID > 0)
                    {
                        List <Model.RoleInfo> rolelist = BLL.RolesBLL.GetList(-1, "RoleID in (select Roleid from UserRoles where userid=" + UserID + ")", "");
                        bool isPermission = false;
                        foreach (Model.RoleInfo roleinfo in rolelist)
                        {
                            isVIEW = new PermissionDAL().GetPermission(TabID, roleinfo.RoleID, PermissionKey);
                            if (isVIEW)
                            {
                                isPermission = true;
                            }
                        }
                        if (isPermission)
                        {
                            break;
                        }
                    }
                }
            }
            catch { }
            return(isVIEW);
        }
Пример #15
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public static Model.UserInfo GetModel(int id)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 * from UserInfo ");
            strSql.Append(" where id=@id");
            SqlParameter[] parameters =
            {
                new SqlParameter("@id", SqlDbType.Int, 4)
            };
            parameters[0].Value = id;

            Model.UserInfo model = new Model.UserInfo();
            DataSet        ds    = DBHelperSQL.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DataRowToModel(ds.Tables[0].Rows[0]));
            }
            else
            {
                return(null);
            }
        }
Пример #16
0
 public UserEdit(Model.UserInfo m_userinfo)
 {
     InitializeComponent();
     // TODO: Complete member initialization
     this._m_userinfo = m_userinfo;
 }
Пример #17
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Model.UserInfo model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update UserInfo set ");
            strSql.Append("username=@username,");
            strSql.Append("mobile=@mobile,");
            strSql.Append("isBindMobile=@isBindMobile,");
            strSql.Append("email=@email,");
            strSql.Append("isBindEmail=@isBindEmail,");
            strSql.Append("password=@password,");
            strSql.Append("md5Pass=@md5Pass,");
            strSql.Append("relName=@relName,");
            strSql.Append("bodyCode=@bodyCode,");
            strSql.Append("comName=@comName,");
            strSql.Append("pid=@pid,");
            strSql.Append("cid=@cid,");
            strSql.Append("regionId=@regionId,");
            strSql.Append("address=@address,");
            strSql.Append("zipCode=@zipCode,");
            strSql.Append("qq=@qq,");
            strSql.Append("weixin=@weixin,");
            strSql.Append("isBindWeiXin=@isBindWeiXin,");
            strSql.Append("weibo=@weibo,");
            strSql.Append("isBindWeiBo=@isBindWeiBo,");
            strSql.Append("shopType=@shopType,");
            strSql.Append("shopTypeName=@shopTypeName,");
            strSql.Append("imgUrl=@imgUrl,");
            strSql.Append("comInfo=@comInfo,");
            strSql.Append("remark=@remark,");
            strSql.Append("status=@status,");
            strSql.Append("addTime=@addTime,");
            strSql.Append("mobileCode=@mobileCode,");
            strSql.Append("activeCode=@activeCode,");
            strSql.Append("infoType=@infoType");
            strSql.Append(" where id=@id");
            SqlParameter[] parameters =
            {
                new SqlParameter("@username",     SqlDbType.VarChar,   150),
                new SqlParameter("@mobile",       SqlDbType.VarChar,   150),
                new SqlParameter("@isBindMobile", SqlDbType.Int,         4),
                new SqlParameter("@email",        SqlDbType.VarChar,   150),
                new SqlParameter("@isBindEmail",  SqlDbType.Int,         4),
                new SqlParameter("@password",     SqlDbType.VarChar,   150),
                new SqlParameter("@md5Pass",      SqlDbType.VarChar,   150),
                new SqlParameter("@relName",      SqlDbType.VarChar,   150),
                new SqlParameter("@bodyCode",     SqlDbType.VarChar,   150),
                new SqlParameter("@comName",      SqlDbType.VarChar,   150),
                new SqlParameter("@pid",          SqlDbType.Int,         4),
                new SqlParameter("@cid",          SqlDbType.Int,         4),
                new SqlParameter("@regionId",     SqlDbType.Int,         4),
                new SqlParameter("@address",      SqlDbType.VarChar,   150),
                new SqlParameter("@zipCode",      SqlDbType.VarChar,   150),
                new SqlParameter("@qq",           SqlDbType.VarChar,   150),
                new SqlParameter("@weixin",       SqlDbType.VarChar,   150),
                new SqlParameter("@isBindWeiXin", SqlDbType.Int,         4),
                new SqlParameter("@weibo",        SqlDbType.VarChar,   150),
                new SqlParameter("@isBindWeiBo",  SqlDbType.Int,         4),
                new SqlParameter("@shopType",     SqlDbType.Int,         4),
                new SqlParameter("@shopTypeName", SqlDbType.VarChar,   150),
                new SqlParameter("@imgUrl",       SqlDbType.VarChar,   150),
                new SqlParameter("@comInfo",      SqlDbType.NText),
                new SqlParameter("@remark",       SqlDbType.VarChar,   150),
                new SqlParameter("@status",       SqlDbType.Int,         4),
                new SqlParameter("@addTime",      SqlDbType.DateTime),
                new SqlParameter("@mobileCode",   SqlDbType.VarChar,   150),
                new SqlParameter("@activeCode",   SqlDbType.VarChar,   150),
                new SqlParameter("@infoType",     SqlDbType.Int,         4),
                new SqlParameter("@id",           SqlDbType.Int, 4)
            };
            parameters[0].Value  = model.username;
            parameters[1].Value  = model.mobile;
            parameters[2].Value  = model.isBindMobile;
            parameters[3].Value  = model.email;
            parameters[4].Value  = model.isBindEmail;
            parameters[5].Value  = model.password;
            parameters[6].Value  = model.md5Pass;
            parameters[7].Value  = model.relName;
            parameters[8].Value  = model.bodyCode;
            parameters[9].Value  = model.comName;
            parameters[10].Value = model.pid;
            parameters[11].Value = model.cid;
            parameters[12].Value = model.regionId;
            parameters[13].Value = model.address;
            parameters[14].Value = model.zipCode;
            parameters[15].Value = model.qq;
            parameters[16].Value = model.weixin;
            parameters[17].Value = model.isBindWeiXin;
            parameters[18].Value = model.weibo;
            parameters[19].Value = model.isBindWeiBo;
            parameters[20].Value = model.shopType;
            parameters[21].Value = model.shopTypeName;
            parameters[22].Value = model.imgUrl;
            parameters[23].Value = model.comInfo;
            parameters[24].Value = model.remark;
            parameters[25].Value = model.status;
            parameters[26].Value = model.addTime;
            parameters[27].Value = model.mobileCode;
            parameters[28].Value = model.activeCode;
            parameters[29].Value = model.infoType;
            parameters[30].Value = model.id;

            int rows = DBHelperSQL.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #18
0
 //根据jobid 修改底薪
 public static int UpdateDxById(Model.UserInfo uinfo, int dx)
 {
     return(DAL.JobServer.UpdateDxById(uinfo, dx));
 }
Пример #19
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public static int Add(Model.UserInfo model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into UserInfo(");
            strSql.Append("username,mobile,isBindMobile,email,isBindEmail,password,md5Pass,relName,bodyCode,comName,pid,cid,regionId,address,zipCode,qq,weixin,isBindWeiXin,weibo,isBindWeiBo,shopType,shopTypeName,imgUrl,comInfo,remark,status,addTime,mobileCode,activeCode,infoType,shopingTime,mainBrand,assessCount,shareCount,productType,goodCount,badCount,viewsCount,loginTime,loginIP)");
            strSql.Append(" values (");
            strSql.Append("@username,@mobile,@isBindMobile,@email,@isBindEmail,@password,@md5Pass,@relName,@bodyCode,@comName,@pid,@cid,@regionId,@address,@zipCode,@qq,@weixin,@isBindWeiXin,@weibo,@isBindWeiBo,@shopType,@shopTypeName,@imgUrl,@comInfo,@remark,@status,@addTime,@mobileCode,@activeCode,@infoType,@shopingTime,@mainBrand,@assessCount,@shareCount,@productType,@goodCount,@badCount,@viewsCount,@loginTime,@loginIP)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters =
            {
                new SqlParameter("@username",     SqlDbType.VarChar,    150),
                new SqlParameter("@mobile",       SqlDbType.VarChar,    150),
                new SqlParameter("@isBindMobile", SqlDbType.Int,          4),
                new SqlParameter("@email",        SqlDbType.VarChar,    150),
                new SqlParameter("@isBindEmail",  SqlDbType.Int,          4),
                new SqlParameter("@password",     SqlDbType.VarChar,    150),
                new SqlParameter("@md5Pass",      SqlDbType.VarChar,    150),
                new SqlParameter("@relName",      SqlDbType.VarChar,    150),
                new SqlParameter("@bodyCode",     SqlDbType.VarChar,    150),
                new SqlParameter("@comName",      SqlDbType.VarChar,    150),
                new SqlParameter("@pid",          SqlDbType.Int,          4),
                new SqlParameter("@cid",          SqlDbType.Int,          4),
                new SqlParameter("@regionId",     SqlDbType.Int,          4),
                new SqlParameter("@address",      SqlDbType.VarChar,    150),
                new SqlParameter("@zipCode",      SqlDbType.VarChar,    150),
                new SqlParameter("@qq",           SqlDbType.VarChar,    150),
                new SqlParameter("@weixin",       SqlDbType.VarChar,    150),
                new SqlParameter("@isBindWeiXin", SqlDbType.Int,          4),
                new SqlParameter("@weibo",        SqlDbType.VarChar,    150),
                new SqlParameter("@isBindWeiBo",  SqlDbType.Int,          4),
                new SqlParameter("@shopType",     SqlDbType.Int,          4),
                new SqlParameter("@shopTypeName", SqlDbType.VarChar,    150),
                new SqlParameter("@imgUrl",       SqlDbType.VarChar,    150),
                new SqlParameter("@comInfo",      SqlDbType.NText),
                new SqlParameter("@remark",       SqlDbType.VarChar,   1500),
                new SqlParameter("@status",       SqlDbType.Int,          4),
                new SqlParameter("@addTime",      SqlDbType.DateTime),
                new SqlParameter("@mobileCode",   SqlDbType.VarChar,    150),
                new SqlParameter("@activeCode",   SqlDbType.VarChar,    150),
                new SqlParameter("@infoType",     SqlDbType.Int,          4),
                new SqlParameter("@shopingTime",  SqlDbType.VarChar,     54),
                new SqlParameter("@mainBrand",    SqlDbType.VarChar,    154),
                new SqlParameter("@assessCount",  SqlDbType.Int,          4),
                new SqlParameter("@shareCount",   SqlDbType.Int,          4),
                new SqlParameter("@productType",  SqlDbType.Int,          4),
                new SqlParameter("@goodCount",    SqlDbType.Int,          4),
                new SqlParameter("@badCount",     SqlDbType.Int,          4),
                new SqlParameter("@viewsCount",   SqlDbType.Int,          4),new SqlParameter("@loginTime",SqlDbType.DateTime), new SqlParameter("@loginIP", SqlDbType.VarChar, 54)
            };
            parameters[0].Value  = model.username;
            parameters[1].Value  = model.mobile;
            parameters[2].Value  = model.isBindMobile;
            parameters[3].Value  = model.email;
            parameters[4].Value  = model.isBindEmail;
            parameters[5].Value  = model.password;
            parameters[6].Value  = model.md5Pass;
            parameters[7].Value  = model.relName;
            parameters[8].Value  = model.bodyCode;
            parameters[9].Value  = model.comName;
            parameters[10].Value = model.pid;
            parameters[11].Value = model.cid;
            parameters[12].Value = model.regionId;
            parameters[13].Value = model.address;
            parameters[14].Value = model.zipCode;
            parameters[15].Value = model.qq;
            parameters[16].Value = model.weixin;
            parameters[17].Value = model.isBindWeiXin;
            parameters[18].Value = model.weibo;
            parameters[19].Value = model.isBindWeiBo;
            parameters[20].Value = model.shopType;
            parameters[21].Value = model.shopTypeName;
            parameters[22].Value = model.imgUrl;
            parameters[23].Value = model.comInfo;
            parameters[24].Value = model.remark;
            parameters[25].Value = model.status;
            parameters[26].Value = model.addTime;
            parameters[27].Value = model.mobileCode;
            parameters[28].Value = model.activeCode;
            parameters[29].Value = model.infoType;


            parameters[30].Value = model.shopingtime;
            parameters[31].Value = model.mainbrand;
            parameters[32].Value = model.assesscount;
            parameters[33].Value = model.sharecount;
            parameters[34].Value = model.producttype;
            parameters[35].Value = model.goodcount;
            parameters[36].Value = model.badcount;
            parameters[37].Value = model.viewscountd;
            parameters[38].Value = model.logintime;
            parameters[39].Value = model.loginip;
            object obj = DBHelperSQL.GetSingle(strSql.ToString(), parameters);

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
Пример #20
0
        /// <summary>
        /// 更新普通用户信息
        /// </summary>
        /// <returns></returns>
        public static int UpdateCommonInfo(Model.UserInfo model)
        {
            string sql = "update UserInfo set pid=" + model.pid + ",cid = " + model.cid + ", comName = '" + model.comName + "',mobile = '" + model.mobile + "',mainBrand = '" + model.mainbrand + "',email = '" + model.email + "',address = '" + model.address + "',regionId = " + model.regionId + " where id = " + model.id;

            return(DBHelperSQL.ExecuteSql(sql));
        }
Пример #21
0
 //查询员工 员工编号 职务 底薪 返回DataSet
 public static DataSet SelectAStaffJobDxById(Model.UserInfo uinfo)
 {
     return(DAL.JobServer.SelectAStaffJobDxById(uinfo));
 }
Пример #22
0
 //查询员工 员工编号 职务 底薪 返回DataSet
 public static DataSet SelectAStaffJobDxById(Model.UserInfo uinfo)
 {
     sqltext = "SELECT UserInfo.name as 员工,UserInfo.uid as 员工编号,departjob.jobname as 职务,departjob.dx as 底薪 FROM UserInfo ,departjob  where UserInfo.jobid=departjob.jobid AND UserInfo.uid='" + uinfo.Uid + "'";
     return(DAL.SQLHELPER.ExecuteDataSet(sqltext));
 }
Пример #23
0
 //根据jobid 修改底薪
 public static int UpdateDxById(Model.UserInfo uinfo, int dx)
 {
     sqltext = "UPDATE departjob SET dx='" + dx + "' WHERE jobid='" + uinfo.Uid + "'";
     return(Convert.ToInt32(DAL.SQLHELPER.ExecuteNonQuery(sqltext)));
 }
Пример #24
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public static Model.UserInfo DataRowToModel(DataRow row)
        {
            Model.UserInfo model = new Model.UserInfo();
            if (row != null)
            {
                if (row["id"] != null && row["id"].ToString() != "")
                {
                    model.id = int.Parse(row["id"].ToString());
                }
                if (row["username"] != null)
                {
                    model.username = row["username"].ToString();
                }
                if (row["mobile"] != null)
                {
                    model.mobile = row["mobile"].ToString();
                }
                if (row["isBindMobile"] != null && row["isBindMobile"].ToString() != "")
                {
                    model.isBindMobile = int.Parse(row["isBindMobile"].ToString());
                }
                if (row["email"] != null)
                {
                    model.email = row["email"].ToString();
                }
                if (row["isBindEmail"] != null && row["isBindEmail"].ToString() != "")
                {
                    model.isBindEmail = int.Parse(row["isBindEmail"].ToString());
                }
                if (row["password"] != null)
                {
                    model.password = row["password"].ToString();
                }
                if (row["md5Pass"] != null)
                {
                    model.md5Pass = row["md5Pass"].ToString();
                }
                if (row["telephone"] != null)
                {
                    model.telephone = row["telephone"].ToString();
                }

                if (row["relName"] != null)
                {
                    model.relName = row["relName"].ToString();
                }
                if (row["bodyCode"] != null)
                {
                    model.bodyCode = row["bodyCode"].ToString();
                }
                if (row["comName"] != null)
                {
                    model.comName = row["comName"].ToString();
                }
                if (row["pid"] != null && row["pid"].ToString() != "")
                {
                    model.pid = int.Parse(row["pid"].ToString());
                }
                if (row["cid"] != null && row["cid"].ToString() != "")
                {
                    model.cid = int.Parse(row["cid"].ToString());
                }
                if (row["regionId"] != null && row["regionId"].ToString() != "")
                {
                    model.regionId = int.Parse(row["regionId"].ToString());
                }
                if (row["address"] != null)
                {
                    model.address = row["address"].ToString();
                }
                if (row["zipCode"] != null)
                {
                    model.zipCode = row["zipCode"].ToString();
                }
                if (row["qq"] != null)
                {
                    model.qq = row["qq"].ToString();
                }
                if (row["weixin"] != null)
                {
                    model.weixin = row["weixin"].ToString();
                }
                if (row["isBindWeiXin"] != null && row["isBindWeiXin"].ToString() != "")
                {
                    model.isBindWeiXin = int.Parse(row["isBindWeiXin"].ToString());
                }
                if (row["weibo"] != null)
                {
                    model.weibo = row["weibo"].ToString();
                }
                if (row["isBindWeiBo"] != null && row["isBindWeiBo"].ToString() != "")
                {
                    model.isBindWeiBo = int.Parse(row["isBindWeiBo"].ToString());
                }
                if (row["shopType"] != null && row["shopType"].ToString() != "")
                {
                    model.shopType = int.Parse(row["shopType"].ToString());
                }
                if (row["shopTypeName"] != null)
                {
                    model.shopTypeName = row["shopTypeName"].ToString();
                }
                if (row["imgUrl"] != null)
                {
                    model.imgUrl = row["imgUrl"].ToString();
                }
                if (row["comInfo"] != null)
                {
                    model.comInfo = row["comInfo"].ToString();
                }
                if (row["remark"] != null)
                {
                    model.remark = row["remark"].ToString();
                }
                if (row["status"] != null && row["status"].ToString() != "")
                {
                    model.status = int.Parse(row["status"].ToString());
                }
                if (row["addTime"] != null && row["addTime"].ToString() != "")
                {
                    model.addTime = DateTime.Parse(row["addTime"].ToString());
                }
                if (row["mobileCode"] != null)
                {
                    model.mobileCode = row["mobileCode"].ToString();
                }
                if (row["activeCode"] != null)
                {
                    model.activeCode = row["activeCode"].ToString();
                }
                if (row["infoType"] != null && row["infoType"].ToString() != "")
                {
                    model.infoType = int.Parse(row["infoType"].ToString());
                }
                model.shopingtime = row["shopingTime"].ToString();
                model.mainbrand   = row["mainbrand"].ToString();

                if (row["assessCount"] != null && row["assessCount"].ToString() != "")
                {
                    model.assesscount = int.Parse(row["assessCount"].ToString());
                }


                if (row["shareCount"] != null && row["shareCount"].ToString() != "")
                {
                    model.sharecount = int.Parse(row["shareCount"].ToString());
                }
                if (row["productType"] != null && row["productType"].ToString() != "")
                {
                    model.producttype = int.Parse(row["productType"].ToString());
                }
                if (row["goodCount"] != null && row["goodCount"].ToString() != "")
                {
                    model.goodcount = int.Parse(row["goodCount"].ToString());
                }


                if (row["badCount"] != null && row["badCount"].ToString() != "")
                {
                    model.badcount = int.Parse(row["badCount"].ToString());
                }
                if (row["viewsCount"] != null && row["viewsCount"].ToString() != "")
                {
                    model.viewscountd = int.Parse(row["viewsCount"].ToString());
                }


                model.loginip = row["loginip"].ToString();
                if (row["logintime"] != null && row["logintime"].ToString() != "")
                {
                    model.logintime = DateTime.Parse(row["logintime"].ToString());
                }
                model.relName = row["relName"].ToString();
            }
            return(model);
        }
Пример #25
0
 /// <summary>
 /// 用于向 UserInfo EntitySet 添加新对象的方法,已弃用。请考虑改用关联的 ObjectSet&lt;T&gt; 属性的 .Add 方法。
 /// </summary>
 public void AddToUserInfo(UserInfo userInfo)
 {
     base.AddObject("UserInfo", userInfo);
 }
 public OrderInfo()
 {
     this.VisitTimes = new System.Collections.Generic.List<VisitTime>();
     this.Doctor = new DoctorInfo();
     this.User = new UserInfo();
 }
Пример #27
0
        /// <summary>
        /// 子菜单JSON
        /// </summary>
        /// <param name="UserID">当前登陆帐号</param>
        /// <param name="menuid">菜单ID 一般为父级ID 也可以是admin或host 如果是"0"则查全部</param>
        /// <param name="Level">级别 0为到所有级 1为到一级 2为到二级 ...</param>
        /// <returns></returns>
        public static string GetSubMenuJSON(int UserID, string menuid, int Level)
        {
            i = 0;
            if (menuid.Trim().Length == 0 || menuid.Trim() == "-1")
            {
                return("[]");
            }

            string UserType = "";

            Model.UserInfo userinfo = BLL.UsersBLL.GetModel(UserID);
            if (userinfo == null || userinfo.UserID != UserID)
            {
                return("[]");
            }
            UserType = userinfo.UserType;

            string result = "[";

            if ((UserType == Common.enumUserType.host.ToString() || UserType == Common.enumUserType.admin.ToString()) && (menuid.Trim().ToLower() == "admin"))
            {
                if (menuid.Trim().ToLower() == "admin")
                {
                    if (Level > 1)
                    {
                        result += "{\"url\":\"DesktopModules/district/district.aspx\",\"id\":\"district\",\"name\":\"城市设置\",\"submenu\":[]},";
                        //result += "{\"url\":\"DesktopModules/companys/companys.aspx\",\"id\":\"companys\",\"name\":\"代理商\",\"submenu\":[]},";
                        result += "{\"url\":\"DesktopModules/Users/ViewUsers.aspx\",\"id\":\"users\",\"name\":\"帐号管理\",\"submenu\":[]},";
                        result += "{\"url\":\"DesktopModules/Roles/ViewRoles.aspx\",\"id\":\"viewroles\",\"name\":\"角色\",\"submenu\":[]},";
                        result += "{\"url\":\"DesktopModules/eventlog/eventlog.aspx\",\"id\":\"eventlog\",\"name\":\"事件日志\",\"submenu\":[]},";
                    }
                }
                if (result.EndsWith(","))
                {
                    result = result.Remove(result.Length - 1);
                }
                result += "]";
                return(result);
            }
            if (UserType == Common.enumUserType.host.ToString() && (menuid.Trim().ToLower() == "host"))
            {
                if (menuid.Trim().ToLower() == "host")
                {
                    if (Level > 1)
                    {
                        result += "{\"url\":\"DesktopModules/console/datainit.aspx\",\"id\":\"datainit\",\"name\":\"刷新基础数据\",\"submenu\":[]},";
                        result += "{\"url\":\"DesktopModules/Tabs/TabsList.aspx\",\"id\":\"pagemenu\",\"name\":\"菜单\",\"submenu\":[]},";
                        result += "{\"url\":\"DesktopModules//SQL/execSQL.aspx\",\"id\":\"execsql\",\"name\":\"执行脚本\",\"submenu\":[]},";
                    }
                }

                if (result.EndsWith(","))
                {
                    result = result.Remove(result.Length - 1);
                }
                result += "]";
                return(result);
            }

            int ParentId = -1;

            int.TryParse(menuid.Trim(), out ParentId);
            if (ParentId > 0)
            {
                result += menuJSON(UserID, ParentId, Level);
            }
            if (result.EndsWith(","))
            {
                result = result.Remove(result.Length - 1);
            }
            result += "]";
            return(result);
        }
Пример #28
0
        /// <summary>
        /// 菜单XML
        /// </summary>
        /// <param name="UserID">当前登陆帐号</param>
        /// <param name="menuid">菜单ID 一般为父级ID 也可以是admin或host 如果是"0"则查全部</param>
        /// <param name="Level">级别 0为到所有级 1为到一级 2为到二级 ...</param>
        /// <returns></returns>
        public static string GetMenuXML(int UserID, string menuid, int Level)
        {
            i = 0;
            string result = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>";

            if (menuid.Trim().Length == 0 || menuid.Trim() == "-1")
            {
                return(result);
            }

            string UserType = "";

            Model.UserInfo userinfo = BLL.UsersBLL.GetModel(UserID);
            if (userinfo == null || userinfo.UserID != UserID)
            {
                return("");
            }
            UserType = userinfo.UserType;
            result  += "<Tabs>";

            string addto1 = "";

            if ((UserType == Common.enumUserType.host.ToString() || UserType == Common.enumUserType.admin.ToString()) && (menuid.Trim().ToLower() == "admin"))
            {
                if (menuid.Trim().ToLower() == "admin")
                {
                    if (Level != 1)
                    {
                        addto1 += "<Tab NavigateUrl=\"DesktopModules/companys/companys.aspx\" ID=\"companys\" Text=\"代理商\" />";
                        addto1 += "<Tab NavigateUrl=\"DesktopModules/Users/ViewUsers.aspx\" ID=\"users\" Text=\"帐号管理\" />";
                        addto1 += "<Tab NavigateUrl=\"DesktopModules/Roles/ViewRoles.aspx\" ID=\"viewroles\" Text=\"角色\"/>";
                    }
                }
                else
                {
                    addto1 += "<Tab ID=\"admin\" NavigateUrl=\"Main.aspx?menuid=admin\" Text=\"Admin\">";
                    if (Level != 1)
                    {
                        addto1 += "<Tab NavigateUrl=\"DesktopModules/companys/companys.aspx\" ID=\"companys\" Text=\"代理商\" />";
                        addto1 += "<Tab NavigateUrl=\"DesktopModules/Users/ViewUsers.aspx\" ID=\"users\" Text=\"帐号管理\" />";
                        addto1 += "<Tab NavigateUrl=\"DesktopModules/Roles/ViewRoles.aspx\" ID=\"viewroles\" Text=\"角色\"/>";
                    }
                    addto1 += "</Tab>";
                }
            }
            if (UserType == Common.enumUserType.host.ToString() && (menuid.Trim().ToLower() == "host"))
            {
                if (menuid.Trim().ToLower() == "host")
                {
                    if (Level != 1)
                    {
                        addto1 += "<Tab NavigateUrl=\"DesktopModules/Tabs/TabsList.aspx\" ID=\"pagemenu\" Text=\"菜单\" />";
                        addto1 += "<Tab NavigateUrl=\"DesktopModules/SQL/execSQL.aspx\" ID=\"execsql\" Text=\"执行脚本\" />";
                    }
                }
                else
                {
                    addto1 += "<Tab ID=\"host\" NavigateUrl=\"Main.aspx?menuid=host\" Text=\"host\">";
                    if (Level != 1)
                    {
                        addto1 += "<Tab NavigateUrl=\"DesktopModules/Tabs/TabsList.aspx\" ID=\"pagemenu\" Text=\"菜单\" />";
                        addto1 += "<Tab NavigateUrl=\"DesktopModules/SQL/execSQL.aspx\" ID=\"execsql\" Text=\"执行脚本\" />";
                    }
                    addto1 += "</Tab>";
                }
            }

            int ParentId = -1;

            try { ParentId = int.Parse(menuid.Trim()); }
            catch { }

            string addto0 = "";

            //if (menuid.Trim().ToLower() == "0")
            //    addto0 = "<Tab NavigateUrl=\"javascript:void(0);\" ID=\"home\" Text=\"\" Img=\"images/home.png\"/>";
            result += menuXML(UserID, ParentId, Level, addto0, addto1);
            result += "</Tabs>";
            return(result);
        }
Пример #29
0
 public bool Equals(UserInfo anotherUserInfo)
 {
     return this.UiID == anotherUserInfo.UiID
         && this.UiName == anotherUserInfo.UiName
         && this.UiSex == anotherUserInfo.UiSex
         && this.UiIdentityNum == anotherUserInfo.UiIdentityNum
         && this.UiDepartment == anotherUserInfo.UiDepartment
         && this.UiTelephone == anotherUserInfo.UiTelephone
         && this.UiEmail == anotherUserInfo.UiEmail
         && this.UiMobPhone == anotherUserInfo.UiMobPhone
         && this.UiAddress == anotherUserInfo.UiAddress
         && this.UiZipCode == anotherUserInfo.UiZipCode
         && this.UiType == anotherUserInfo.UiType
         && this.UiJob == anotherUserInfo.UiJob
         && this.UiFund == anotherUserInfo.UiFund
         && this.UiCharacter == anotherUserInfo.UiCharacter
         && this.UiCompany == anotherUserInfo.UiCompany
         && this.UiEvaluationStatus == anotherUserInfo.UiEvaluationStatus; ;
 }
Пример #30
0
 /// <summary>
 /// 创建新的 UserInfo 对象。
 /// </summary>
 /// <param name="id">ID 属性的初始值。</param>
 /// <param name="userName">UserName 属性的初始值。</param>
 /// <param name="pwd">Pwd 属性的初始值。</param>
 /// <param name="phone">Phone 属性的初始值。</param>
 /// <param name="idCard">IdCard 属性的初始值。</param>
 /// <param name="level">Level 属性的初始值。</param>
 public static UserInfo CreateUserInfo(global::System.Int32 id, global::System.String userName, global::System.String pwd, global::System.String phone, global::System.String idCard, global::System.Int32 level)
 {
     UserInfo userInfo = new UserInfo();
     userInfo.ID = id;
     userInfo.UserName = userName;
     userInfo.Pwd = pwd;
     userInfo.Phone = phone;
     userInfo.IdCard = idCard;
     userInfo.Level = level;
     return userInfo;
 }