コード例 #1
0
        /// <summary>
        /// 根据用户ID获取用户实体信息
        /// </summary>
        /// <param name="sysflag"></param>
        /// <param name="usernameormobilenum"></param>
        /// <param name="pwd"></param>
        /// <param name="username"></param>
        /// <returns>返回用户对象实体</returns>
        private userinfos GetUAppIDUserCheckByUpt(string sysflag, string uid)
        {
            ComSqlHelper csh = new ComSqlHelper();

            SqlParameter[] Parameters = { new SqlParameter("@uid", uid) };
            DataTable      dt         = csh.FillDataSet(WebProc.GetAppSysflagKey(sysflag), WebProc.Proc("QWGProc_App_GetUserInfo"), Parameters).Tables[0];

            if (dt.Rows.Count > 0)
            {
                userinfos appvduser = new userinfos();
                appvduser.uid       = dt.Rows[0]["UID"].ToString().Trim();
                appvduser.username  = dt.Rows[0]["NAME"].ToString().Trim();
                appvduser.pwd       = dt.Rows[0]["PASSWORD"].ToString().Trim();
                appvduser.mobilenum = dt.Rows[0]["MobileNum"].ToString().Trim();


                appvduser.memo        = dt.Rows[0]["MEMO"].ToString();
                appvduser.email       = dt.Rows[0]["Email"].ToString();
                appvduser.fullname    = dt.Rows[0]["FullName"].ToString();
                appvduser.sex         = dt.Rows[0]["Sex"].ToString();
                appvduser.phoneno     = dt.Rows[0]["PHONENO"].ToString();
                appvduser.id_card_no  = dt.Rows[0]["ID_CARD_NO"].ToString();
                appvduser.nativeplace = dt.Rows[0]["NATIVEPLACE"].ToString();
                appvduser.adress      = dt.Rows[0]["ADDRESS"].ToString();

                return(appvduser);
            }
            else
            {
                return(null);
            }
        }
コード例 #2
0
        /// <summary>
        /// 根据用户名和手机号码获取用户实体信息
        /// </summary>
        /// <param name="sysflag"></param>
        /// <param name="usernameormobilenum"></param>
        /// <param name="pwd"></param>
        /// <param name="username"></param>
        /// <returns></returns>
        private void GetUAppIDUserCheck(string sysflag, string usernameormobilenum, string pwd)
        {
            ComSqlHelper csh = new ComSqlHelper();

            SqlParameter[] Parameters = { new SqlParameter("@nameormobile", usernameormobilenum), new SqlParameter("@pwd", pwd) };
            DataTable      dt         = csh.FillDataSet(WebProc.GetAppSysflagKey(sysflag), WebProc.Proc("QWGProc_Appvd_GetUserByNameORMobilenum"), Parameters).Tables[0];

            if (dt.Rows.Count > 0)
            {
                appvduser = new userinfos();
                string dbpwd = dt.Rows[0]["PASSWORD"].ToString();
                appvduser.uid         = dt.Rows[0]["UID"].ToString();
                appvduser.username    = dt.Rows[0]["NAME"].ToString().Trim();
                appvduser.pwd         = dt.Rows[0]["PASSWORD"].ToString().Trim();
                appvduser.mobilenum   = dt.Rows[0]["MobileNum"].ToString().Trim();
                appvduser.source      = dt.Rows[0]["SourceId"].ToString();
                appvduser.memo        = dt.Rows[0]["MEMO"].ToString();
                appvduser.email       = dt.Rows[0]["Email"].ToString();
                appvduser.fullname    = dt.Rows[0]["FullName"].ToString();
                appvduser.sex         = dt.Rows[0]["SEX"].ToString();
                appvduser.phoneno     = dt.Rows[0]["PHONENO"].ToString();
                appvduser.id_card_no  = dt.Rows[0]["ID_CARD_NO"].ToString();
                appvduser.adress      = dt.Rows[0]["ADDRESS"].ToString();
                appvduser.nativeplace = dt.Rows[0]["NATIVEPLACE"].ToString();

                appvdreturn.userinfo = appvduser;
            }
        }
コード例 #3
0
        /// <summary>
        /// 验证用户名和手机号码
        /// </summary>
        /// <param name="sysflag"></param>
        /// <param name="username"></param>
        /// <param name="mobilenum"></param>
        /// <returns></returns>
        private int CheckUserNameMobileNum(string sysflag, string username, string mobilenum)
        {
            int          res = 0;
            ComSqlHelper csh = new ComSqlHelper();

            SqlParameter[] Parameters = { new SqlParameter("@username", username), new SqlParameter("@mobilenum", mobilenum) };
            DataTable      dt         = csh.FillDataSet(WebProc.GetAppSysflagKey(sysflag), WebProc.Proc("QWGProc_App_CheckUserNameMobileNum"), Parameters).Tables[0];

            if (dt.Rows.Count > 0)
            {
                res = int.Parse(dt.Rows[0][0].ToString());
            }
            return(res);
        }
コード例 #4
0
        /// <summary>
        /// 记录操作日志
        /// </summary>
        /// <param name="logmodel">操作日志类</param>
        public void WriteSysLog(LogModel logmodel)
        {
            ComSqlHelper csh = new ComSqlHelper();

            SqlParameter[] Parameters = new SqlParameter[6];
            Parameters[0] = new SqlParameter("@UserID", logmodel.UserId);
            Parameters[1] = new SqlParameter("@LogType", logmodel.LogType);
            Parameters[2] = new SqlParameter("@LogContent", logmodel.LogContent);
            Parameters[3] = new SqlParameter("@LogResult", logmodel.LogResult);
            Parameters[4] = new SqlParameter("@OneCarUser", logmodel.OneCarUser);
            Parameters[5] = new SqlParameter("@SysName", logmodel.SysName);


            csh.ExecuteSPNoQuery(WebProc.GetAppSysflagKey(logmodel.SysFlag), WebProc.Proc("SysLogInsert"), Parameters, true);
        }
コード例 #5
0
        private void GetUserRolesAndRightsAndCars(string sysflag, int uid, string logintype)
        {
            appvduser.uid = uid.ToString();
            ComSqlHelper csh = new ComSqlHelper();

            SqlParameter[] Parameters = { new SqlParameter("@uid", uid), new SqlParameter("@logintype", logintype) };
            DataSet        ds         = csh.FillDataSet(WebProc.GetAppSysflagKey(sysflag), WebProc.Proc("QWGProc_Appvd_GetUserRolesAndRights"), Parameters);
            DataTable      dtrole     = ds.Tables[0];
            DataTable      dtrights   = ds.Tables[1];

            foreach (DataRow dr in dtrole.Rows)     //获取角色列表
            {
                roleinfo rolei = new roleinfo();
                rolei.roleid   = dr["RID"].ToString();
                rolei.rolename = dr["NAME"].ToString();
                appvdreturn.rolelist.Add(rolei);
            }
            foreach (DataRow dr in dtrights.Rows)   //获取APP功能模块权限列表
            {
                apkinfo apk = new apkinfo();
                apk.apkid       = dr["APK_ID"].ToString();
                apk.apkname     = dr["APK_NAME"].ToString();
                apk.apkpath     = dr["APK_PATH"].ToString();
                apk.apkversion  = dr["APK_VERSION"].ToString();
                apk.publishdate = dr["PUBLISH_DATE"].ToString();
                apk.isupdate    = dr["IS_UPDATE"].ToString();
                appvdreturn.apkright.Add(apk);
            }

            SqlParameter[] Parameters_car = { new SqlParameter("@uid", uid) };
            AppProess      ap             = new AppProess();
            DataTable      dt_carlist     = ap.GetUserCrsbyOnline(sysflag, appvduser.uid);

            foreach (DataRow dr in dt_carlist.Rows)   //获取用户车辆数据权限列表
            {
                carsinfo cars = new carsinfo();
                cars.cid     = dr["cid"].ToString();
                cars.tno     = dr["tno"].ToString();
                cars.carno   = dr["carno"].ToString().Trim();
                cars.sim     = dr["sim"].ToString();
                cars.color   = dr["color"].ToString();
                cars.cartype = dr["cartype"].ToString();
                cars.online  = dr["online"].ToString();
                appvdreturn.carlist.Add(cars);
            }
        }
コード例 #6
0
        /// <summary>
        /// 用户信息修改
        /// </summary>
        /// <param name="uinfo"></param>
        public void UserInfoUpdate(userinfos uinfo, string sysflag)
        {
            ComSqlHelper csh = new ComSqlHelper();

            SqlParameter[] Parameters = { new SqlParameter("@uid",         uinfo.uid),
                                          new SqlParameter("@username",    uinfo.username),
                                          new SqlParameter("@pwd",         uinfo.pwd),
                                          new SqlParameter("@mobilenum",   uinfo.mobilenum),
                                          new SqlParameter("@memo",        uinfo.memo),
                                          new SqlParameter("@email",       uinfo.email),
                                          new SqlParameter("@fullname",    uinfo.fullname),
                                          new SqlParameter("@sex",         uinfo.sex),
                                          new SqlParameter("@phoneno",     uinfo.phoneno),
                                          new SqlParameter("@id_card_no",  uinfo.id_card_no),
                                          new SqlParameter("@adress",      uinfo.adress),
                                          new SqlParameter("@nativeplace", uinfo.nativeplace), };
            csh.ExecuteSPNoQuery(WebProc.GetAppSysflagKey(sysflag), WebProc.Proc("QWGProc_Appvd_UserUpdate"), Parameters, true);
        }
コード例 #7
0
        /// <summary>
        /// 根据用户名和手机号码获取用户编号
        /// </summary>
        /// <param name="sysflag"></param>
        /// <param name="usernameormobilenum"></param>
        /// <param name="pwd"></param>
        /// <param name="username"></param>
        /// <returns></returns>
        private int GetUIDUserCheck(string sysflag, string usernameormobilenum, string pwd, out string username)
        {
            username = "";
            ComSqlHelper csh = new ComSqlHelper();

            SqlParameter[] Parameters = { new SqlParameter("@nameormobile", usernameormobilenum) };
            DataTable      dt         = csh.FillDataSet(WebProc.GetAppSysflagKey(sysflag), WebProc.Proc("QWGProc_App_GetUserByNameORMobilenum"), Parameters).Tables[0];

            if (dt.Rows.Count > 0)
            {
                string dbpwd = dt.Rows[0]["PASSWORD"].ToString();
                if (pwd == dbpwd)
                {
                    username = dt.Rows[0]["Name"].ToString();
                    return(int.Parse(dt.Rows[0]["UID"].ToString()));
                }
            }
            return(0);
        }
コード例 #8
0
        /// <summary>
        /// 根据APK编号获取信息
        /// </summary>
        /// <param name="sysflag"></param>
        /// <param name="apkId"></param>
        /// <returns></returns>
        public apkinfo GetApkVersionByID(string sysflag, string apkId)
        {
            apkinfo info = new apkinfo();

            ComSqlHelper csh = new ComSqlHelper();

            SqlParameter[] Parameters = { new SqlParameter("@apkid", apkId) };
            DataTable      dt         = csh.FillDataSet(WebProc.GetAppSysflagKey(sysflag), WebProc.Proc("QWGProc_Appvd_GetAPKById"), Parameters).Tables[0];

            if (dt.Rows.Count > 0)
            {
                info.apkid       = dt.Rows[0]["APK_ID"].ToString().Trim();
                info.apkname     = dt.Rows[0]["APK_NAME"].ToString().Trim();
                info.apkpath     = dt.Rows[0]["APK_PATH"].ToString().Trim();
                info.apkversion  = dt.Rows[0]["APK_VERSION"].ToString().Trim();
                info.publishdate = dt.Rows[0]["PUBLISH_DATE"].ToString().Trim();
                info.isupdate    = dt.Rows[0]["IS_UPDATE"].ToString().Trim();
                return(info);
            }
            else
            {
                return(null);
            }
        }