public IHttpActionResult QueryStoreOrder(StoreOrderModelGet_ modelGet)
        {
            DataSet dtStoreOrder = _storeOrderDal.QueryStoreOrder_(modelGet.DataPagingModel);
            IList <StoreOrderModelResult_> storeOrderModelResults = ModelConvertHelper <StoreOrderModelResult_> .ConvertToModel(dtStoreOrder.Tables[0]);

            //if (dtStoreOrder.Tables[0].Rows.Count > 0)
            //{
            //    string orderIds = string.Empty;
            //    foreach (var item in storeOrderModelResults)
            //    {
            //        orderIds += string.IsNullOrEmpty(orderIds) ? item.Id.ToString() : "," + item.Id;
            //    }
            //    DataTable dtPayDetail = _storeOrderDal.QueryPayDetail_(orderIds);
            //    IList<StoreOrderPayDetailModel> storeOrderPayDetailModels = ModelConvertHelper<StoreOrderPayDetailModel>.ConvertToModel(dtPayDetail);
            //    foreach (var item in storeOrderModelResults)
            //    {
            //        item.PayDetailModels = storeOrderPayDetailModels.Where(n => n.OrderNo == item.OrderNo).ToList();
            //    }
            //}
            return(Json(new ResultDataModel <IList <StoreOrderModelResult_> > {
                Data = storeOrderModelResults, DataPagingResult = new DataPagingModelResult()
                {
                    TotalCount = Convert.ToInt32(dtStoreOrder.Tables[1].Rows[0][0])
                }
            }));
        }
Esempio n. 2
0
        public IList <Department> GetDepComBox()
        {
            string    condition = string.Format("select * from [Department]");
            DataTable dt        = db.ExecuteDataTable(condition, null);

            return(ModelConvertHelper <Department> .ConvertToModel(dt));
        }
        //根据parentid获取SaleModule的数据
        public ActionResult Modules(string id)
        {
            var md = SqlAdapter.Create(sqlsel, schema).Par("@parentid", id)
                     .ExecuteModel();

            if (md.IsEmpty)
            {
                return(Content(error("模块不存在")));
            }
            var parentidmd         = SqlAdapter.Create(selectparentid, schema).ExecuteModel();
            var parentidArray      = parentidmd.DATA.AsEnumerable().Select(r => r["parentid"]);
            List <SaleModule> list = ModelConvertHelper <SaleModule> .ConvertToModel(md.DATA).ToList();

            for (int i = 0; i < list.Count; i++)
            {
                if (!parentidArray.Contains(list[i].id))
                {
                    list[i].state = "open";
                }
                else
                {
                    list[i].state = "closed";
                }
            }
            return(Content(list.ToJson().ToString()));
        }
Esempio n. 4
0
        public JsonResult GetList()
        {
            int    pageIndex = string.IsNullOrEmpty(Request.Form["page"]) ? 1 : int.Parse(Request.Form["page"]);
            int    pageSize  = string.IsNullOrEmpty(Request.Form["rows"]) ? 10 : int.Parse(Request.Form["rows"]);
            string Where     = string.IsNullOrEmpty(Request.Form["sqlSet"]) ? "1=1" : GetSql(Request.Form["sqlSet"]);
            ////字段排序
            String sortField = Request.Form["sort"];
            String sortOrder = Request.Form["order"];

            PageClass pc = new PageClass();

            pc.sys_Fields = "*";
            //pc.sys_Key = "id";
            pc.sys_PageIndex = pageIndex;
            pc.sys_PageSize  = pageSize;
            pc.sys_Table     = "rms_buttons";
            pc.sys_Where     = Where;
            if (!string.IsNullOrEmpty(sortField) && !string.IsNullOrEmpty(sortOrder))
            {
                pc.sys_Order = " order by " + " " + sortField + " " + sortOrder;
            }
            DataTable ds = RMS_ButtonsService.Instance.sqlToDataTablePage(pc);
            Dictionary <string, object> dic = new Dictionary <string, object>();

            dic.Add("rows", ModelConvertHelper <rms_buttons> .ConvertToModel(ds));
            dic.Add("total", pc.RCount);

            return(Json(dic));
        }
Esempio n. 5
0
        /// <summary>
        ///  获取投注赔率(分页)
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize">-1 取全部</param>
        /// <param name="condition">没有where</param>
        /// <returns></returns>
        public static List <MD_LotterySet> GetLotterySetList(int pageIndex, int pageSize, string condition = "")
        {
            DataTable            dt   = OWZX.Data.Lottery.GetLotterySetList(pageIndex, pageSize, condition);
            List <MD_LotterySet> list = (List <MD_LotterySet>) ModelConvertHelper <MD_LotterySet> .ConvertToModel(dt);

            return(list);
        }
Esempio n. 6
0
        public ActionResult MyBackMoney()
        {
            try
            {
                NameValueCollection parmas = WorkContext.postparms;
                int                   page = int.Parse(parmas["page"]);
                DataTable             dt   = News.GetUserBackList(10, page, "where addtime>'" + DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd") + " 00:00:00' and addtime<'" + DateTime.Now.ToString("yyyy-MM-dd") + " 23:59:59' and pid= (select uid from owzx_users where ltrim(rtrim(mobile))='" + parmas["account"] + "')");
                List <MD_UserBackRPT> list = (List <MD_UserBackRPT>) ModelConvertHelper <MD_UserBackRPT> .ConvertToModel(dt);

                if (list.Count > 0)
                {
                    JsonSerializerSettings jsetting = new JsonSerializerSettings();
                    jsetting.DateFormatString = "yyyy-MM-dd HH:mm:ss";
                    jsetting.ContractResolver = new JsonLimitOutPut(new string[] { "NickName", "Money", "BackRate", "Status" }, true);
                    string data = JsonConvert.SerializeObject(list, jsetting).ToLower();
                    return(APIResult("success", data, true));
                }
                else
                {
                    return(APIResult("success", "暂无下级佣金"));
                }
            }
            catch (Exception ex)
            {
                return(APIResult("error", "获取失败"));
            }
        }
Esempio n. 7
0
        /// <summary>
        /// 系统通知公告
        /// </summary>
        /// <returns></returns>
        public ActionResult SystemNotice()
        {
            try
            {
                DataTable          dt   = News.GetNewsList(1, 1, "where newstypeid=3 ");
                List <MD_NewsInfo> list = (List <MD_NewsInfo>) ModelConvertHelper <MD_NewsInfo> .ConvertToModel(dt);

                if (list.Count > 0)
                {
                    JsonSerializerSettings jsetting = new JsonSerializerSettings();
                    jsetting.DateFormatString = "yyyy-MM-dd HH:mm:ss";
                    jsetting.ContractResolver = new JsonLimitOutPut(new string[] { "Title", "Time", "Body" }, true);
                    string data = JsonConvert.SerializeObject(list[0], jsetting).ToLower();
                    return(APIResult("success", data, true));
                }
                else
                {
                    return(APIResult("success", "暂无通知公告"));
                }
            }
            catch (Exception ex)
            {
                return(APIResult("error", "获取失败"));
            }
        }
Esempio n. 8
0
        /// <summary>
        /// 通知公告
        /// </summary>
        /// <returns></returns>
        public ActionResult Notice()
        {
            try
            {
                NameValueCollection parmas = WorkContext.postparms;
                if (parmas.Count == 0)
                {
                    return(APIResult("error", "请求参数错误"));
                }
                int                page = int.Parse(parmas["page"]);
                DataTable          dt   = News.GetNewsList(10, page, "where newstypeid=2");
                List <MD_NewsInfo> list = (List <MD_NewsInfo>) ModelConvertHelper <MD_NewsInfo> .ConvertToModel(dt);

                if (list.Count > 0)
                {
                    list.ForEach((x) =>
                    {
                        x.Body = BSPConfig.ShopConfig.SiteUrl + "/hometice/" + x.NewsId.ToString();
                    });
                    JsonSerializerSettings jsetting = new JsonSerializerSettings();
                    jsetting.DateFormatString = "yyyy-MM-dd HH:mm:ss";
                    jsetting.ContractResolver = new JsonLimitOutPut(new string[] { "Title", "Time", "Body" }, true);
                    string data = JsonConvert.SerializeObject(list, jsetting).ToLower();
                    return(APIResult("success", data, true));
                }
                else
                {
                    return(APIResult("success", "暂无通知公告"));
                }
            }
            catch (Exception ex)
            {
                return(APIResult("error", "获取失败"));
            }
        }
Esempio n. 9
0
        /// <summary>
        ///获取彩票记录(分页)
        /// </summary>
        /// <param name="type">彩票类型</param>
        /// <returns></returns>
        public static List <MD_Lottery> LastLotteryList(int type)
        {
            DataTable         dt   = OWZX.Data.Lottery.LastLotteryList(type);
            List <MD_Lottery> list = (List <MD_Lottery>) ModelConvertHelper <MD_Lottery> .ConvertToModel(dt);

            return(list);
        }
        public IHttpActionResult UserLogin(UserLoginModelGet userLoginModelGet)
        {
            try
            {
                DataTable dtUserInfo = _userInfoDal.LoginUser(userLoginModelGet.Account, userLoginModelGet.PhoneAreaId, userLoginModelGet.Type, userLoginModelGet.Password);
                if (dtUserInfo.Rows.Count != 1)
                {
                    return(Json(new ResultDataModel <UserInfoModelResult> {
                        Code = -1, Messages = "用户名或密码错误"
                    }));
                }
                IList <UserInfoModelResult> list = ModelConvertHelper <UserInfoModelResult> .ConvertToModel(dtUserInfo);

                var model = list.First();
                model.Token    = ServerHelper.GetToken;
                model.RealRank = _userInfoDal.CheckUserVipRank(model.Id);
                WebCacheHelper.SetCache(model.Id + "_" + 1, model.Token);
                return(Json(new ResultDataModel <UserInfoModelResult> {
                    Data = model
                }));
            }
            catch (Exception exception)
            {
                LogHelper.error(exception.ToString());
                return(Json(new ResultDataModel <UserInfoModelResult> {
                    Code = 4001, Messages = "服务器繁忙,请稍后重试"
                }));
            }
        }
Esempio n. 11
0
        /// <summary>
        ///获取验证码记录(分页)
        /// </summary>
        /// <param name="pageNumber"></param>
        /// <param name="pageSize">-1 取全部</param>
        /// <param name="condition">没有where</param>
        /// <returns></returns>
        public static List <MD_SMSCode> GetSMSCodeList(int pageNumber, int pageSize, string condition = "")
        {
            DataTable         dt   = OWZX.Data.NewUser.GetSMSCodeList(pageNumber, pageSize, condition);
            List <MD_SMSCode> list = (List <MD_SMSCode>) ModelConvertHelper <MD_SMSCode> .ConvertToModel(dt);

            return(list);
        }
Esempio n. 12
0
        /// <summary>
        /// 获取意见列表
        /// </summary>
        /// <param name="pageSize"></param>
        /// <param name="pageNumber"></param>
        /// <param name="condition"></param>
        /// <returns></returns>
        public static List <AdviceInfoModel> GetUserAdvice(int pageSize, int pageNumber, string condition = "")
        {
            DataTable dt = OWZX.Data.Advice.GetUserAdvice(pageNumber, pageSize, condition);
            List <AdviceInfoModel> suitelist = (List <AdviceInfoModel>) ModelConvertHelper <AdviceInfoModel> .ConvertToModel(dt);

            return(suitelist);
        }
Esempio n. 13
0
        /// <summary>
        /// 获取访问IP统计
        /// </summary>
        /// <param name="pageNumber"></param>
        /// <param name="pageSize">-1 取全部</param>
        /// <param name="condition">没有where</param>
        /// <returns></returns>
        public static List <MD_VisitIP> GetWebFlow(int pageNumber, int pageSize, string condition = "")
        {
            DataTable         dt   = OWZX.Data.PVStats.GetWebFlow(pageNumber, pageSize, condition);
            List <MD_VisitIP> list = (List <MD_VisitIP>) ModelConvertHelper <MD_VisitIP> .ConvertToModel(dt);

            return(list);
        }
Esempio n. 14
0
        /// <summary>
        ///获取用户消息记录(分页)
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize">-1 取全部</param>
        /// <param name="condition">没有where</param>
        /// <returns></returns>
        public static List <MD_Message> GetMessageList(int pageIndex, int pageSize, string condition = "")
        {
            DataTable         dt   = OWZX.Data.NewUser.GetMessageList(pageIndex, pageSize, condition);
            List <MD_Message> list = (List <MD_Message>) ModelConvertHelper <MD_Message> .ConvertToModel(dt);

            return(list);
        }
Esempio n. 15
0
            public static IList <T> Select(string TableName, string[] Fields, string Where)
            {
                DataTable     dt       = new DataTable();
                StringBuilder sb_Sql   = new StringBuilder();
                StringBuilder sb_field = new StringBuilder();

                for (int i = 0; i < Fields.Length; i++)
                {
                    sb_field.Append(Fields[i]);
                    sb_field.Append(",");
                }
                sb_field.Remove(sb_field.Length - 1, 1);
                sb_Sql.Append("select ");
                sb_Sql.Append(sb_field.ToString());
                sb_Sql.Append(" from ");
                sb_Sql.Append(TableName);
                sb_Sql.Append(" ");
                sb_Sql.Append(Where);

                try
                {
                    MySqlDataAdapter da = new MySqlDataAdapter(sb_Sql.ToString(), new MySqlConnection()); //MySqlData.conn
                    da.Fill(dt);
                    da.Dispose();
                }
                catch (Exception ex)
                {
                    SystemError.SystemLog(ex.Message);
                    dt = null;
                }
                return(ModelConvertHelper <T> .ConvertToModel(dt));
            }
Esempio n. 16
0
        /// <summary>
        /// 用户登录
        /// </summary>
        /// <param name="mobile"></param>
        /// <param name="password"></param>
        /// <param name="ipAddress"></param>
        /// <returns></returns>
        public async Task <D_User> Login(string mobile, string password)
        {
            string salt = await GetSalt(mobile);

            if (string.IsNullOrEmpty(salt))
            {
                return(null);
            }

            string pwd = Utils.PasswordHashing(password, salt);

            var sql = "select * from [dbo].[EM_User] where Mobile = '" + mobile + "' and Pwd = '" + pwd + "' and IsDelete != 99";
            var db  = Repository.QueryByTablde(sql);

            if (db == null || db.Rows.Count <= 0)
            {
                return(null);
            }

            var list = await Task.Run(() =>
                                      ModelConvertHelper <D_User> .ConvertToModel(db)
                                      );

            return(list[0]);
        }
Esempio n. 17
0
        public IList <File> GetFilePersonlTree(int pid, int uid)
        {
            string    condition = string.Format("FilePID={0} and UserId={2} and FileExt {1}", pid, "is null", uid);
            string    sql       = string.Format("select a.FileID,a.FileName,a.FileExt,a.FileSize,a.FileCreateTime from [File] a where {0}", condition);
            DataTable dt        = db.ExecuteDataTable(sql, null);

            return(ModelConvertHelper <File> .ConvertToModel(dt));
        }
Esempio n. 18
0
        // GET api/<controller>/5
        public IHttpActionResult QueryEmployeeInfo()
        {
            DataTable dtEmployeeInfo = _employeeInfoDal.QueryEmployeeInfo();
            IList <EmployeeInfoModelResult> adminInfoModelResults = ModelConvertHelper <EmployeeInfoModelResult> .ConvertToModel(dtEmployeeInfo);

            return(Json(new ResultDataModel <IList <EmployeeInfoModelResult> > {
                Data = adminInfoModelResults
            }));
        }
Esempio n. 19
0
        /// <summary>
        /// 查询粉丝信息
        /// </summary>
        /// <param name="fansModelGet"></param>
        /// <returns></returns>
        public IHttpActionResult QueryFans(FansModelGet fansModelGet)
        {
            DataTable dtFans = _fansDal.QueryFans(fansModelGet.Id);
            IList <FansModelResult> fansModelGets = ModelConvertHelper <FansModelResult> .ConvertToModel(dtFans);

            return(Json(new ResultDataModel <IList <FansModelResult> > {
                Data = fansModelGets
            }));
        }
Esempio n. 20
0
        public IHttpActionResult QueryVersion(VersionModelGet modelGet)
        {
            DataTable dt = _appVersionDal.QueryAppVersion(modelGet.AppType);
            IList <VersionModelResult> versionModelResults = ModelConvertHelper <VersionModelResult> .ConvertToModel(dt);

            return(Json(new ResultDataModel <VersionModelResult> {
                Data = versionModelResults.FirstOrDefault()
            }));
        }
        public IHttpActionResult QueryWalletInfo(WalletInfoModelGet modelGet)
        {
            DataTable dt = _walletInfoDal.QueryWalletInfo(modelGet.UserId);
            IList <WalletInfoModelResult> currencyInfoModelResults = ModelConvertHelper <WalletInfoModelResult> .ConvertToModel(dt);

            return(Json(new ResultDataModel <IList <WalletInfoModelResult> > {
                Data = currencyInfoModelResults
            }));
        }
        public IHttpActionResult QueryAnnouncement(AnnouncementInfoModelGet announcementInfoModelGet)
        {
            DataTable dataTable = _announcementInfoDal.QueryAnnouncement();
            IList <AnnouncementInfoModelResult> list = ModelConvertHelper <AnnouncementInfoModelResult> .ConvertToModel(dataTable);

            return(Json(new ResultDataModel <IList <AnnouncementInfoModelResult> > {
                Data = list
            }));
        }
Esempio n. 23
0
        /// <summary>
        /// 查询通证列表
        /// </summary>
        /// <param name="currencyInfoModelGet"></param>
        /// <returns></returns>
        public IHttpActionResult QueryCurrency(CurrencyInfoModelGet currencyInfoModelGet)
        {
            DataTable dt = _currencyInfoDal.QueryCurrency();
            IList <CurrencyInfoModelResult> currencyInfoModelResults =
                ModelConvertHelper <CurrencyInfoModelResult> .ConvertToModel(dt);

            return(Json(new ResultDataModel <IList <CurrencyInfoModelResult> > {
                Data = currencyInfoModelResults
            }));
        }
        /// <summary>
        /// 查询银行收款信息
        /// </summary>
        /// <param name="bankCode"></param>
        /// <returns></returns>
        public IHttpActionResult QueryBankCodeInfo(BankCodeInfoModelGet bankCode)
        {
            DataTable dtBankCodeInfo = _receivablesInformationDal.QueryBankCodeInfo(bankCode.UserId);
            IList <BankCodeInfoModelResult> bankCodeInfoModelResults =
                ModelConvertHelper <BankCodeInfoModelResult> .ConvertToModel(dtBankCodeInfo);

            return(Json(new ResultDataModel <BankCodeInfoModelResult> {
                Data = bankCodeInfoModelResults.FirstOrDefault()
            }));
        }
        /// <summary>
        /// 查询第三方收款信息
        /// </summary>
        /// <param name="modelGet"></param>
        /// <returns></returns>
        public IHttpActionResult QueryThirdCollectionInfo(ThirdCollectionInfoModelGet modelGet)
        {
            DataTable dtBankCodeInfo = _receivablesInformationDal.QueryThirdCollectionInfo(modelGet.UserId, modelGet.AccountType);
            IList <ThirdCollectionInfoModelResult> thirdCollectionInfoModelResults =
                ModelConvertHelper <ThirdCollectionInfoModelResult> .ConvertToModel(dtBankCodeInfo);

            return(Json(new ResultDataModel <ThirdCollectionInfoModelResult> {
                Data = thirdCollectionInfoModelResults.FirstOrDefault()
            }));
        }
Esempio n. 26
0
        public IHttpActionResult QueryCommodityInfo(CommodityInfoModelGet commodityInfoModelGet)
        {
            DataTable dtDataTable = _commodityDal.QueryCommodityInfo(commodityInfoModelGet.State, commodityInfoModelGet.Type);
            IList <CommodityInfoModelResult> list =
                ModelConvertHelper <CommodityInfoModelResult> .ConvertToModel(dtDataTable);

            return(Json(new ResultDataModel <IList <CommodityInfoModelResult> > {
                Data = list
            }));
        }
Esempio n. 27
0
        /// <summary>
        /// 通过ID获取实名认证信息
        /// </summary>
        /// <param name="idCardCertificationModelGet"></param>
        /// <returns></returns>
        public IHttpActionResult QueryIdCardCertificationInfo(IdCardCertificationModelGet idCardCertificationModelGet)
        {
            DataTable dtDataTable = _idCardCertificationDal.QueryIdCardCertificationInfo(idCardCertificationModelGet.Id, idCardCertificationModelGet.UserId);
            IList <IdCardCertificationModelResult> list =
                ModelConvertHelper <IdCardCertificationModelResult> .ConvertToModel(dtDataTable);

            return(Json(new ResultDataModel <IdCardCertificationModelResult> {
                Data = list.FirstOrDefault()
            }));
        }
Esempio n. 28
0
        /// <summary>
        /// 查询实名认证信息
        /// </summary>
        /// <param name="idCardCertificationModelGet"></param>
        /// <returns></returns>

        public IHttpActionResult QueryIdCardCertification(IdCardCertificationModelGet idCardCertificationModelGet)
        {
            DataTable dtDataTable = _idCardCertificationDal.QueryIdCardCertification();
            IList <IdCardCertificationModelResult> list =
                ModelConvertHelper <IdCardCertificationModelResult> .ConvertToModel(dtDataTable);

            return(Json(new ResultDataModel <IList <IdCardCertificationModelResult> > {
                Data = list
            }));
        }
Esempio n. 29
0
        public IList <User> GetUserByPositionId(int PositionId)
        {
            String       sql = string.Format(@"select * from [User] u where u.UserID in  (
                                        select DISTINCT UserID from [dbo].[View_User_Department_Position]
	                                    where positionID =  {0})"    , PositionId);
            DataTable    dt  = db.ExecuteDataTable(sql, null);
            IList <User> lst = ModelConvertHelper <User> .ConvertToModel(dt);

            return(lst);
        }
Esempio n. 30
0
        public IHttpActionResult QueryCloudMiner()
        {
            DataTable dtDataTable = _cloudMinerDal.QueryCloudMiner();
            IList <CloudMinerInfoModelResult> list =
                ModelConvertHelper <CloudMinerInfoModelResult> .ConvertToModel(dtDataTable);

            return(Json(new ResultDataModel <IList <CloudMinerInfoModelResult> > {
                Data = list
            }));
        }