コード例 #1
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);
        }
コード例 #2
0
        public static StorageDoc GetStorageDetail(string docid, string clientid)
        {
            DataSet    ds    = StockDAL.GetStorageDetail(docid, clientid);
            StorageDoc model = new StorageDoc();

            if (ds.Tables.Contains("Doc") && ds.Tables["Doc"].Rows.Count > 0)
            {
                model.FillData(ds.Tables["Doc"].Rows[0]);
                model.CreateUser = OrganizationBusiness.GetUserByUserID(model.CreateUserID, clientid);
                model.StatusStr  = GetDocStatusStr(model.DocType, model.Status);

                model.DocTypeStr = CommonBusiness.GetEnumDesc <EnumDocType>((EnumDocType)model.DocType);

                model.WareHouse = SystemBusiness.BaseBusiness.GetWareByID(model.WareID, model.ClientID);
                model.Details   = new List <StorageDetail>();
                foreach (DataRow item in ds.Tables["Details"].Rows)
                {
                    StorageDetail details = new StorageDetail();
                    details.FillData(item);
                    model.Details.Add(details);
                }
            }

            return(model);
        }
コード例 #3
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);
        }
コード例 #4
0
ファイル: OrdersBusiness.cs プロジェクト: GitMr/YXERP
        public List <OrderEntity> GetOrders(EnumSearchType searchtype, string typeid, int status, int paystatus, int invoicestatus, int returnstatus, string searchuserid, string searchteamid, string searchagentid,
                                            string begintime, string endtime, string keyWords, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string userid, string agentid, string clientid)
        {
            List <OrderEntity> list = new List <OrderEntity>();
            DataSet            ds   = OrdersDAL.BaseProvider.GetOrders((int)searchtype, typeid, status, paystatus, invoicestatus, returnstatus, searchuserid, searchteamid, searchagentid, begintime, endtime, keyWords, pageSize, pageIndex, ref totalCount, ref pageCount, userid, agentid, clientid);

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                OrderEntity model = new OrderEntity();
                model.FillData(dr);
                model.OrderType = SystemBusiness.BaseBusiness.GetOrderTypeByID(model.TypeID, model.AgentID, model.ClientID);
                model.Owner     = OrganizationBusiness.GetUserByUserID(model.OwnerID, model.AgentID);

                model.StatusStr = CommonBusiness.GetEnumDesc((EnumOrderStatus)model.Status);
                if (model.Status == 2)
                {
                    model.SendStatusStr = CommonBusiness.GetEnumDesc((EnumSendStatus)model.SendStatus);
                }
                else if (model.Status < 2)
                {
                    model.SendStatusStr = "--";
                }
                list.Add(model);
            }
            return(list);
        }
コード例 #5
0
ファイル: ProductsBusiness.cs プロジェクト: GitMr/YXERP
        public bool UpdateBrandStatus(string brandID, EnumStatus status, string operateIP, string operateID)
        {
            bool bl = CommonBusiness.Update("Brand", "Status", ((int)status).ToString(), " BrandID='" + brandID + "'");

            if (bl)
            {
                string message = "编辑品牌状态为:" + CommonBusiness.GetEnumDesc(status);
                LogBusiness.AddOperateLog(operateID, "ProductsBusiness.UpdateBrandStatus", EnumLogType.Update, EnumLogModules.Stock, EnumLogEntity.Brand, brandID, message, operateIP);
            }

            return(bl);
        }
コード例 #6
0
ファイル: CustomBusiness.cs プロジェクト: GitMr/YXERP
        public bool UpdateCustomerStatus(string customerid, EnumCustomStatus status, string operateid, string ip, string agentid, string clientid)
        {
            bool bl = CommonBusiness.Update("Customer", "Status", (int)status, "CustomerID='" + customerid + "'");

            if (bl)
            {
                var    model = CommonBusiness.GetEnumDesc(status);
                string msg   = "客户状态更换为:" + model;
                LogBusiness.AddLog(customerid, EnumLogObjectType.Customer, msg, operateid, ip, status.ToString(), agentid, clientid);
            }
            return(bl);
        }
コード例 #7
0
        public List <ReportCommonEntity> GetCustomerStageRate(string begintime, string endtime, string agentid, string clientid)
        {
            List <ReportCommonEntity> list = new List <ReportCommonEntity>();
            DataSet ds = CustomerRPTDAL.BaseProvider.GetCustomerStageRate(begintime, endtime, agentid, clientid);

            var stages = SystemBusiness.BaseBusiness.GetCustomStages(agentid, clientid);
            int total = 0, prev = 0;

            foreach (var stage in stages)
            {
                ReportCommonEntity model = new ReportCommonEntity();

                model.name   = stage.StageName;
                model.iValue = 0;
                model.desc   = "";

                foreach (DataRow dr in ds.Tables["Data"].Select("StageID='" + stage.StageID + "'"))
                {
                    model.desc += CommonBusiness.GetEnumDesc((EnumCustomStatus)Convert.ToInt32(dr["Status"])) + ":" + dr["Value"].ToString();

                    model.iValue += Convert.ToInt32(dr["Value"]);
                }
                total += model.iValue;

                list.Add(model);
            }


            if (total > 0)
            {
                for (int i = list.Count - 1; i >= 0; i--)
                {
                    list[i].iValue += prev;
                    prev            = list[i].iValue;

                    list[i].value = (Convert.ToDecimal(list[i].iValue) / total * 100).ToString("f2");
                    list[i].name += list[i].iValue;
                    if (list[i].desc.Length > 0)
                    {
                        list[i].name += " (" + list[i].desc + ") ";
                    }
                }
            }
            return(list);
        }
コード例 #8
0
ファイル: OrdersBusiness.cs プロジェクト: GitMr/YXERP
        public List <OrderEntity> GetOrdersByCustomerID(string customerid, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string userid, string agentid, string clientid)
        {
            List <OrderEntity> list = new List <OrderEntity>();
            DataTable          dt   = CommonBusiness.GetPagerData("Orders", "*", "CustomerID='" + customerid + "' and Status between 1 and 3", "AutoID", pageSize, pageIndex, out totalCount, out pageCount, false);

            foreach (DataRow dr in dt.Rows)
            {
                OrderEntity model = new OrderEntity();
                model.FillData(dr);
                model.OrderType = SystemBusiness.BaseBusiness.GetOrderTypeByID(model.TypeID, model.AgentID, model.ClientID);
                model.Owner     = OrganizationBusiness.GetUserByUserID(model.OwnerID, model.AgentID);

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

                list.Add(model);
            }
            return(list);
        }
コード例 #9
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);
        }