Exemple #1
0
        public static GoodsDoc GetGoodsDocDetail(string docid, string clientid)
        {
            DataSet  ds    = StockDAL.GetGoodsDocDetail(docid, clientid);
            GoodsDoc model = new GoodsDoc();

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

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

                if (!string.IsNullOrEmpty(model.ExpressID))
                {
                    model.Express = ExpressCompanyBusiness.GetExpressCompanyDetail(model.ExpressID);
                }
                model.Details = new List <GoodsDocDetail>();
                foreach (DataRow item in ds.Tables["Details"].Rows)
                {
                    GoodsDocDetail details = new GoodsDocDetail();
                    details.FillData(item);

                    model.Details.Add(details);
                }
            }

            return(model);
        }
        public List <Products> GetProductList(string categoryid, string prodiverid, string beginprice, string endprice, string keyWords, string orderby, bool isasc, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string clientID)
        {
            var     dal = new ProductsDAL();
            DataSet ds  = dal.GetProductList(categoryid, prodiverid, beginprice, endprice, keyWords, orderby, isasc ? 1 : 0, pageSize, pageIndex, ref totalCount, ref pageCount, clientID);

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

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                Products model = new Products();
                model.FillData(dr);
                if (!string.IsNullOrEmpty(model.CategoryID))
                {
                    model.CategoryName = GetCategoryByID(model.CategoryID).CategoryName;
                }

                if (!string.IsNullOrEmpty(model.UnitID))
                {
                    model.UnitName = GetUnitByID(model.UnitID).UnitName;
                }

                model.IsPublicStr = CommonBusiness.GetEnumDesc((EnumProductPublicStatus)model.IsPublic);

                list.Add(model);
            }
            return(list);
        }
Exemple #3
0
        public bool UpdateCustomerStatus(string customerid, EnumCustomStatus status, string operateid, string ip, 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(), clientid);
            }
            return(bl);
        }
Exemple #4
0
        public List <BillingPay> GetOrderPays(string orderid)
        {
            List <BillingPay> list = new List <BillingPay>();
            DataTable         dt   = FinanceDAL.BaseProvider.GetOrderPays(orderid);

            foreach (DataRow dr in dt.Rows)
            {
                BillingPay model = new BillingPay();
                model.FillData(dr);
                model.PayTypeStr = CommonBusiness.GetEnumDesc <EnumOrderPayType>((EnumOrderPayType)model.PayType);
                model.CreateUser = OrganizationBusiness.GetUserByUserID(model.CreateUserID, model.ClientID);
                list.Add(model);
            }

            return(list);
        }
Exemple #5
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);

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

                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);
                    if (!string.IsNullOrEmpty(details.UnitID))
                    {
                        details.UnitName = new ProductsBusiness().GetUnitByID(details.UnitID).UnitName;
                    }
                    if (!string.IsNullOrEmpty(details.ProviderID))
                    {
                        details.Providers = new ProvidersBusiness().GetProviderByID(details.ProviderID);
                    }
                    model.Details.Add(details);
                }
            }

            return(model);
        }
Exemple #6
0
        public Task <bool> SendWeiXinMPPush(WeiXinMPPushType pushType, string guid, string operateName = "")
        {
            string result = string.Empty;

            if (pushType == WeiXinMPPushType.SendTaskFinishPush)
            {
                TaskEntity task = TaskBusiness.GetPushTaskForFinishTask(guid);
                if (!string.IsNullOrEmpty(task.OpenID))
                {
                    string content = GetPushContent(pushType, task.OpenID, task.Title,
                                                    task.GoodsName, task.OrderType,
                                                    task.PreTitle, task.Owner.Name, null, task.TaskID, operateName);
                    result = SendPush(content);

                    ApiCloudPush.BasePush.SendPush("您的" + task.Title + "上级任务:" + task.PreTitle + "标记完成", task.OwnerID);
                }
                if (task.Order != null)
                {
                    var order = task.Order;
                    if (!string.IsNullOrEmpty(order.OpenID))
                    {
                        pushType = WeiXinMPPushType.SendAllTaskFinishPush;
                        string content = GetPushContent(pushType, order.OpenID, order.OrderCode,
                                                        task.GoodsName, task.OrderType,
                                                        string.Empty, CommonBusiness.GetEnumDesc((EnumOrderStageStatus)order.Status));
                        result = SendPush(content);
                    }

                    ApiCloudPush.BasePush.SendPush("您的" + task.GoodsName + "所有任务已完成", order.OwnerID);
                }
            }
            else if (pushType == WeiXinMPPushType.SendNewTaskPush)
            {
                List <TaskEntity> tasks = TaskBusiness.GetPushTasksForNewOrder(guid);
                if (tasks.Count > 0)
                {
                    foreach (var task in tasks)
                    {
                        if (!string.IsNullOrEmpty(task.OpenID))
                        {
                            string content = GetPushContent(pushType, task.OpenID, task.Title,
                                                            task.GoodsName, task.OrderType,
                                                            "", "", task.EndTime, task.TaskID);
                            result = SendPush(content);
                        }

                        ApiCloudPush.BasePush.SendPush("您收到了一个新任务:" + task.Title, task.OwnerID);
                    }
                }
            }
            else if (pushType == WeiXinMPPushType.SendChangeOrderOwnerPush)
            {
                TaskEntity task = TaskBusiness.GetPushTaskForChangeOrderOwner(guid);
                if (task != null)
                {
                    if (!string.IsNullOrEmpty(task.OpenID))
                    {
                        string content = GetPushContent(pushType, task.OpenID, task.Title,
                                                        task.GoodsName, task.OrderType,
                                                        "", "", task.EndTime, "", operateName);
                        result = SendPush(content);
                    }

                    ApiCloudPush.BasePush.SendPush(operateName + "将您设为订单:" + task.GoodsName + "的负责人!", task.OwnerID);
                }
            }
            else if (pushType == WeiXinMPPushType.SendChangeTaskOwnerPush)
            {
                TaskEntity task = TaskBusiness.GetPushTaskForChangeTaskOwner(guid);
                if (task != null)
                {
                    if (!string.IsNullOrEmpty(task.OpenID))
                    {
                        string content = GetPushContent(pushType, task.OpenID, task.Title,
                                                        task.GoodsName, task.OrderType,
                                                        "", "", task.EndTime, guid, operateName);
                        result = SendPush(content);
                    }

                    ApiCloudPush.BasePush.SendPush(operateName + "将您设为任务:" + task.Title + "的负责人!", task.OwnerID);
                }
            }

            return(Task.Run(() => { return !string.IsNullOrEmpty(result); }));
        }