예제 #1
0
        public bool addUser(bean.UserInfo ui, String cd)
        {
            if (ui.Enable == 0)
            {
                ui.Enable = 1;
            }
            string time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            int    ret  = 0;
            int    rt   = 0;
            String sql  = "select * from userinfo where name='" + ui.UserName + "'";

            ret = DbHelperMySQL.ExecuteSql(sql);
            string id = Result.GetNewId();

            if (ret == -1)
            {
                string sql1 = "insert into userinfo (id,name,pwd,enable,createTime,power) values ('" + id + "','" + ui.UserName + "', '" + ui.Pwd + "', '" + ui.Enable + "', '" + time + "', '" + ui.Power + "')";
                rt = DbHelperMySQL.ExecuteSql(sql1);

                if (cd != null && cd != "")
                {
                    string   terminalnames  = null;
                    string[] terminalnames0 = cd.Split(new char[] { ',' });
                    for (int i = 0; i < terminalnames0.Count(); i++)
                    {
                        terminalnames += "','" + terminalnames0[i];
                    }
                    terminalnames = terminalnames.Substring(3);
                    String sql0 = "update lb_device_information set imei='" + ui.UserName + "' where terminalname in ('" + terminalnames + "')";
                    DbHelperMySQL.ExecuteSql(sql0);
                }
            }

            return(rt == 0 ? false : true);
        }
예제 #2
0
 public static bool updatePassWord(string name, string password)
 {
     bean.UserInfo userinfo = new bean.UserInfo();
     userinfo.UserName = name;
     userinfo.Password = password;
     return(user.updatePassWord(userinfo));
 }
예제 #3
0
        public static DataTable UserExists(string name, string password)
        {
            bean.UserInfo userinfo = new bean.UserInfo();
            userinfo.UserName = name;
            userinfo.Password = password;

            return(user.exists(userinfo));
        }
예제 #4
0
파일: UserDao.cs 프로젝트: zuyunfei/zkhw
        public bool updateUser(bean.UserInfo ui)
        {
            int    ret = 0;
            String sql = "update zkhw_user_info set username='******' where id='" + ui.Id + "'";

            ret = DbHelperMySQL.ExecuteSql(sql);
            return(ret == 0 ? false : true);
        }
예제 #5
0
파일: UserDao.cs 프로젝트: zuyunfei/zkhw
        public bool updatePassWord(bean.UserInfo user)
        {
            int    ret = 0;
            String sql = "update zkhw_user_info set password='******' where username = '******'";

            ret = DbHelperMySQL.ExecuteSql(sql);
            return(ret == 0 ? false : true);
        }
예제 #6
0
파일: UserDao.cs 프로젝트: zuyunfei/zkhw
        public bool addUser(bean.UserInfo ui)
        {
            string  time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            int     rt   = 0;
            String  sql  = "select * from zkhw_user_info where name='" + ui.UserName + "'";
            DataSet ds   = new DataSet();

            ds.Clear();
            ds = DbHelperMySQL.Query(sql);
            if (ds.Tables[0].Rows.Count <= 0)
            {
                string sql1 = "insert into zkhw_user_info (username,password,lasttime,loginnumber,depaid,name,type) values ('" + ui.UserName + "', '" + ui.Password + "', '" + ui.Lasttime + "', '" + ui.Loginnumber + "', '" + ui.Depaid + "', '" + ui.Name + "', '" + ui.Type + "')";
                rt = DbHelperMySQL.ExecuteSql(sql1);
            }

            return(rt == 0 ? false : true);
        }
예제 #7
0
        public bool updateUser(bean.UserInfo ui, String cd)
        {
            int    ret = 0;
            String sql = "update userinfo set name='" + ui.UserName + "',enable='" + ui.Enable + "',power='" + ui.Power + "' where id='" + ui.Id + "'";

            if (cd != null)
            {
                string   terminalnames  = null;
                string[] terminalnames0 = cd.Split(new char[] { ',' });
                for (int i = 0; i < terminalnames0.Count(); i++)
                {
                    terminalnames += "','" + terminalnames0[i];
                }
                terminalnames = terminalnames.Substring(3);
                String sql0 = "update lb_device_information set imei='" + ui.UserName + "' where terminalname in ('" + terminalnames + "')";
                DbHelperMySQL.ExecuteSql(sql0);
            }
            ret = DbHelperMySQL.ExecuteSql(sql);
            return(ret == 0 ? false : true);
        }
예제 #8
0
 public bool updateUser(bean.UserInfo ui)
 {
     return(user.updateUser(ui));
 }
예제 #9
0
 public bool addUser(bean.UserInfo ui)
 {
     return(user.addUser(ui));
 }
예제 #10
0
 public bool updateUser(bean.UserInfo ui, String cd)
 {
     return user.updateUser(ui, cd);
 }
예제 #11
0
 public bool addUser(bean.UserInfo ui, String cd)
 {
     return user.addUser(ui, cd);
 }