コード例 #1
0
ファイル: AgentOrderBusiness.cs プロジェクト: GitMr/YXERP
        public List <AgentOrderEntity> GetAgentOrders(string searchagentid, EnumOrderStatus status, EnumSendStatus sendstatus, EnumReturnStatus returnstatus, string keywords, string begintime, string endtime, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string agentid, string clientid)
        {
            DataSet ds = AgentOrderDAL.BaseProvider.GetAgentOrders(searchagentid, (int)status, (int)sendstatus, (int)returnstatus, keywords, begintime, endtime, pageSize, pageIndex, ref totalCount, ref pageCount, agentid, clientid);

            List <AgentOrderEntity> list = new List <AgentOrderEntity>();

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                AgentOrderEntity model = new AgentOrderEntity();
                model.FillData(dr);

                model.StatusStr = CommonBusiness.GetEnumDesc((EnumOrderStatus)model.Status);

                model.SendStatusStr = CommonBusiness.GetEnumDesc((EnumSendStatus)model.SendStatus);

                model.ExpressTypeStr = CommonBusiness.GetEnumDesc((EnumExpressType)model.ExpressType);

                if (!string.IsNullOrEmpty(model.ExpressID))
                {
                    model.ExpressCompany = Manage.ExpressCompanyBusiness.GetExpressCompanyDetail(model.ExpressID);
                }

                model.City = CommonBusiness.GetCityByCode(model.CityCode);
                if (model.City != null)
                {
                    model.Address = model.City.Province + model.City.City + model.City.Counties + model.Address;
                }

                list.Add(model);
            }
            return(list);
        }
コード例 #2
0
ファイル: AgentOrderBusiness.cs プロジェクト: GitMr/YXERP
        public AgentOrderEntity GetAgentOrderByID(string orderid, string agentid, string clientid)
        {
            DataSet          ds    = AgentOrderDAL.BaseProvider.GetAgentOrderByID(orderid, agentid, clientid);
            AgentOrderEntity model = new AgentOrderEntity();

            if (ds.Tables["Order"].Rows.Count > 0)
            {
                model.FillData(ds.Tables["Order"].Rows[0]);

                model.StatusStr = CommonBusiness.GetEnumDesc((EnumOrderStatus)model.Status);

                model.ExpressTypeStr = CommonBusiness.GetEnumDesc((EnumExpressType)model.ExpressType);

                model.City = CommonBusiness.GetCityByCode(model.CityCode);
                if (model.City != null)
                {
                    model.Address = model.City.Province + model.City.City + model.City.Counties + model.Address;
                }

                model.Details = new List <AgentOrderDetail>();
                if (ds.Tables["Details"].Rows.Count > 0)
                {
                    foreach (DataRow dr in ds.Tables["Details"].Rows)
                    {
                        AgentOrderDetail detail = new AgentOrderDetail();
                        detail.FillData(dr);
                        model.Details.Add(detail);
                    }
                }
            }
            return(model);
        }
コード例 #3
0
ファイル: OrdersBusiness.cs プロジェクト: GitMr/YXERP
        public OrderEntity GetOrderByID(string orderid, string agentid, string clientid)
        {
            DataSet     ds    = OrdersDAL.BaseProvider.GetOrderByID(orderid, agentid, clientid);
            OrderEntity model = new OrderEntity();

            if (ds.Tables["Order"].Rows.Count > 0)
            {
                model.FillData(ds.Tables["Order"].Rows[0]);
                model.OrderType  = SystemBusiness.BaseBusiness.GetOrderTypeByID(model.TypeID, model.AgentID, model.ClientID);
                model.Owner      = OrganizationBusiness.GetUserByUserID(model.OwnerID, model.AgentID);
                model.CreateUser = OrganizationBusiness.GetUserByUserID(model.CreateUserID, model.AgentID);

                model.StatusStr      = CommonBusiness.GetEnumDesc((EnumOrderStatus)model.Status);
                model.ExpressTypeStr = CommonBusiness.GetEnumDesc((EnumExpressType)model.ExpressType);

                if (model.Status == 2)
                {
                    model.SendStatusStr = CommonBusiness.GetEnumDesc((EnumSendStatus)model.SendStatus);
                }
                else if (model.Status < 2)
                {
                    model.SendStatusStr = "--";
                }

                model.City = CommonBusiness.GetCityByCode(model.CityCode);

                if (ds.Tables["Customer"].Rows.Count > 0)
                {
                    model.Customer = new CustomerEntity();
                    model.Customer.FillData(ds.Tables["Customer"].Rows[0]);
                }
                model.Details = new List <OrderDetail>();
                if (ds.Tables["Details"].Rows.Count > 0)
                {
                    foreach (DataRow dr in ds.Tables["Details"].Rows)
                    {
                        OrderDetail detail = new OrderDetail();
                        detail.FillData(dr);
                        model.Details.Add(detail);
                    }
                }
            }
            return(model);
        }