Esempio n. 1
0
        /// <summary>
        /// APP获取指定的APK版本
        /// </summary>
        /// <param name="inparams">JSON格式的数据参数</param>
        /// <returns></returns>
        public ResponseAppResult AppvdGetApkVersion(Dictionary <string, string> inparams)
        {
            ResponseAppResult Result    = null;
            userinfos         appvdInfo = new userinfos();

            try
            {
                if (!inparams.Keys.Contains("apkid") || inparams["apkid"] == "")
                {
                    Result = new ResponseAppResult(ResState.ParamsImperfect, "缺少apkid或apkid为空!", null);
                    return(Result);
                }
                apkinfo info = GetApkVersionByID(inparams["sysflag"], inparams["apkid"]);
                if (info != null)
                {
                    Result = new ResponseAppResult(ResState.Success, "操作成功", info);
                }
                else
                {
                    Result = new ResponseAppResult(ResState.OperationFailed, "当前APK编号不存在!", null);
                }
            }
            catch (Exception ex)
            {
                LogHelper.WriteError("AppvdGetApkVersion调用异常", ex);
                Result = new ResponseAppResult(ResState.OperationFailed, ex.Message, null);
            }
            return(Result);
        }
Esempio n. 2
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);
            }
        }
Esempio n. 3
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);
            }
        }