Exemplo n.º 1
0
 /// <summary>
 /// 获取通知公告信息列表
 /// </summary>
 /// <param name="_"></param>
 /// <returns></returns>
 private Negotiator NoticeList(dynamic _)
 {
     try
     {
         var  watch         = CommonHelper.TimerStart();
         var  recdata       = this.GetModule <ReceiveModule <PaginationModule> >();
         bool resValidation = this.DataValidation(recdata.userid, recdata.token);
         if (!resValidation)
         {
             return(this.SendData(ResponseType.Fail, "无登录信息"));
         }
         else
         {
             Pagination pagination = new Pagination {
                 page = recdata.data.page,
                 rows = recdata.data.rows,
                 sidx = recdata.data.sidx,
                 sord = recdata.data.sord
             };
             var data = noticebll.GetPageList(pagination, recdata.data.queryData);
             DataPageList <IEnumerable <NewsEntity> > dataPageList = new DataPageList <IEnumerable <NewsEntity> >
             {
                 rows     = data,
                 total    = pagination.total,
                 records  = pagination.records,
                 costtime = CommonHelper.TimerEnd(watch)
             };
             return(this.SendData <DataPageList <IEnumerable <NewsEntity> > >(dataPageList, recdata.userid, recdata.token, ResponseType.Success));
         }
     }
     catch (System.Exception)
     {
         return(this.SendData(ResponseType.Fail, "异常"));
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// 分页
        /// </summary>
        protected DataPageList <TEntity> GetEntitiesByPage <TEntity>(IQueryable query, int page, int size, DataContext context)
        {
            context.Log = FileLog.Out;
            var data = DataPageList <TEntity> .Create <TEntity>(query, page, size);

            WriteLog(FileLog.FileInfo.ToString());
            return(data);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 获取染整订单列表
        /// </summary>
        /// <param name="_"></param>
        /// <returns></returns>
        private Negotiator GetProRzOrderModuleList(dynamic _)
        {
            try
            {
                var  watch         = CommonHelper.TimerStart();
                var  recdata       = this.GetModule <ReceiveModule <PaginationModule> >();
                bool resValidation = this.DataValidation(recdata.userid, recdata.token);
                if (!resValidation)
                {
                    return(this.SendData(ResponseType.Fail, "后台无登录信息"));
                }
                else
                {
                    Pagination pagination = new Pagination
                    {
                        page = recdata.data.page,
                        rows = recdata.data.rows,
                        sidx = recdata.data.sidx,
                        sord = recdata.data.sord
                    };


                    Operator operator_ = this.ReadCache <Operator>(recdata.userid);
                    var      data      = proRzOrderbll.GetDataListByDt(pagination, recdata.data.queryData, operator_.Account);
                    IList <ProRzOrderEntity> listOrder = new List <ProRzOrderEntity>();

                    foreach (DataRow row in data.Rows)
                    {
                        ProRzOrderEntity proOrder = new ProRzOrderEntity();
                        Type             t        = proOrder.GetType();
                        PropertyInfo[]   pro2     = t.GetProperties();
                        foreach (PropertyInfo item in pro2)
                        {
                            item.SetValue(proOrder, ConvertEx.ToString(row[item.Name]));
                        }
                        listOrder.Add(proOrder);
                    }

                    DataPageList <IList <ProRzOrderEntity> > dataPageList = new DataPageList <IList <ProRzOrderEntity> >
                    {
                        rows     = listOrder,
                        total    = pagination.total,
                        page     = pagination.page,
                        records  = pagination.records,
                        costtime = CommonHelper.TimerEnd(watch)
                    };
                    return(this.SendData <DataPageList <IList <ProRzOrderEntity> > >(dataPageList, recdata.userid, recdata.token, ResponseType.Success));
                }
            }
            catch
            {
                return(this.SendData(ResponseType.Fail, "异常"));
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// 获取绒布库存详情
        /// </summary>
        /// <param name="_"></param>
        /// <returns></returns>
        private Negotiator GetProRbStockDetailsModuleList(dynamic _)
        {
            try
            {
                var  watch         = CommonHelper.TimerStart();
                var  recdata       = this.GetModule <ReceiveModule <PaginationModule> >();
                bool resValidation = this.DataValidation(recdata.userid, recdata.token);
                if (!resValidation)
                {
                    return(this.SendData(ResponseType.Fail, "后台无登录信息"));
                }
                else
                {
                    Pagination pagination = new Pagination
                    {
                        page = recdata.data.page,
                        rows = recdata.data.rows,
                        sidx = recdata.data.sidx,
                        sord = recdata.data.sord
                    };
                    var data = proRbStockDetailbll.GetPageList(pagination, recdata.data.queryData);
                    DataPageList <IEnumerable <ProRbStockDetailsEntity> > dataPageList = new DataPageList <IEnumerable <ProRbStockDetailsEntity> >
                    {
                        rows     = data,
                        total    = pagination.total,
                        page     = pagination.page,
                        records  = pagination.records,
                        costtime = CommonHelper.TimerEnd(watch)
                    };
                    return(this.SendData <DataPageList <IEnumerable <ProRbStockDetailsEntity> > >(dataPageList, recdata.userid, recdata.token, ResponseType.Success));
                }
            }
            catch
            {
                return(this.SendData(ResponseType.Fail, "异常"));
            }

            //var data = userCache.GetListToApp();
            //return this.SendData<Dictionary<string, appUserInfoModel>>(data, recdata.userid, recdata.token, ResponseType.Success);
        }
Exemplo n.º 5
0
        /// <summary>
        /// 发起流程列表
        /// </summary>
        /// <param name="_"></param>
        /// <returns></returns>
        private Negotiator DesignList(dynamic _)
        {
            try
            {
                var  res           = "";
                var  recdata       = this.GetModule <ReceiveModule <PaginationModule> >();
                bool resValidation = this.DataValidation(recdata.userid, recdata.token);
                if (!resValidation)
                {
                    return(this.SendData(ResponseType.Fail, "后台无登录信息"));
                }
                else
                {
                    var        watch      = CommonHelper.TimerStart();
                    Pagination pagination = new Pagination
                    {
                        page = recdata.data.page,
                        rows = recdata.data.rows,
                        sidx = recdata.data.sidx,
                        sord = recdata.data.sord
                    };
                    var data = wfFlowInfoBLL.GetPageList(pagination, recdata.data.queryData);

                    DataPageList <DataTable> dataPageList = new DataPageList <DataTable>
                    {
                        rows     = data,
                        total    = pagination.total,
                        page     = pagination.page,
                        records  = pagination.records,
                        costtime = CommonHelper.TimerEnd(watch)
                    };
                    res = JsonConvert.SerializeObject(dataPageList, new DataTableConverter());
                    return(this.SendData(res, recdata.userid, recdata.token, ResponseType.Success));
                }
            }
            catch (Exception ex)
            {
                return(this.SendData(ResponseType.Fail, ex.ToString()));
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// 获取绒布库存列表
        /// </summary>
        /// <param name="_"></param>
        /// <returns></returns>
        private Negotiator GetProRbStockModuleList(dynamic _)
        {
            try
            {
                var  watch         = CommonHelper.TimerStart();
                var  recdata       = this.GetModule <ReceiveModule <PaginationModule> >();
                bool resValidation = this.DataValidation(recdata.userid, recdata.token);
                if (!resValidation)
                {
                    return(this.SendData(ResponseType.Fail, "后台无登录信息"));
                }
                else
                {
                    Pagination pagination = new Pagination
                    {
                        page = recdata.data.page,
                        rows = recdata.data.rows,
                        sidx = recdata.data.sidx,
                        sord = recdata.data.sord
                    };
                    DataTable data = proRbStockbll.GetPageListByDt(pagination, recdata.data.queryData);
                    IList <ProRzStockEntity> proRzList = new List <ProRzStockEntity>();


                    foreach (DataRow row in data.Rows)
                    {
                        ProRzStockEntity proRz = new ProRzStockEntity
                        {
                            b_num          = row["b_num"].ToString().Trim(),
                            p_code         = row["p_code"].ToString().Trim(),
                            p_name         = row["p_name"].ToString().Trim(),
                            o_custName     = row["o_custName"].ToString().Trim(),
                            c_region       = row["c_region"].ToString().Trim(),
                            p_count        = row["p_count"].ToString().Trim(),
                            p_zhishu       = row["p_zhishu"].ToString().Trim(),
                            b_pinhao       = row["b_pinhao"].ToString().Trim(),
                            p_color        = row["p_color"].ToString().Trim(),
                            p_unit         = row["p_unit"].ToString().Trim(),
                            p_grade        = row["p_grade"].ToString().Trim(),
                            p_dateLastIn   = row["p_dateLastIn"].ToString().Trim(),
                            o_departName   = row["o_departName"].ToString().Trim(),
                            p_overstockDes = row["p_overstockDes"].ToString().Trim(),
                        };
                        proRzList.Add(proRz);
                    }


                    DataPageList <IList <ProRzStockEntity> > dataPageList = new DataPageList <IList <ProRzStockEntity> >
                    {
                        rows     = proRzList,
                        total    = pagination.total,
                        page     = pagination.page,
                        records  = pagination.records,
                        costtime = CommonHelper.TimerEnd(watch)
                    };
                    return(this.SendData <DataPageList <IList <ProRzStockEntity> > >(dataPageList, recdata.userid, recdata.token, ResponseType.Success));
                }
            }
            catch
            {
                return(this.SendData(ResponseType.Fail, "异常"));
            }

            //var data = userCache.GetListToApp();
            //return this.SendData<Dictionary<string, appUserInfoModel>>(data, recdata.userid, recdata.token, ResponseType.Success);
        }