示例#1
0
        public void OnInit()
        {
            ChoiceBoxProvider.Register();
            SubSystem.RegisterSubSystem(new SubSystem("B3Butchery", "屠宰分割")
            {
                IconUrl            = "~/Images/ChildSystemIcons/B3Butchery.png",
                NotSelectedIconUrl = "~/Images/ChildSystemIcons/B3Butchery_NotSelected.png",
                DisplayOrder       = -500
            });
            HippoUtil.Register();

            MultiViewSwitcher.Register("存货编辑", "屠宰分割", "~/B3Butchery/BaseInfos/ButcheryGoods_/ButcheryGoodsEdit.aspx", new string[] {
                "B3Butchery.存货.访问"
            });
            MultiViewSwitcher.Register("存货新建", "屠宰分割", "~/B3Butchery/BaseInfos/ButcheryGoods_/ButcheryGoodsEdit.aspx", new string[] {
                "B3Butchery.存货.新建"
            });
        }
示例#2
0
        public static ListData Query(ListData data)
        {
            var queryobj = (ProductInStoreQueryObj)data.QueryObject;
            var query    = new DQueryDom(new JoinAlias(typeof(ProductInStore)));

            query.Columns.Add(DQSelectColumn.Field("ID"));
            query.Columns.Add(DQSelectColumn.Field("BillState"));
            query.Columns.Add(DQSelectColumn.Field("AccountingUnit_Name"));
            query.Columns.Add(DQSelectColumn.Field("Department_Name"));
            query.Columns.Add(DQSelectColumn.Field("Employee_Name"));
            query.Columns.Add(DQSelectColumn.Field("Store_Name"));
            query.Columns.Add(DQSelectColumn.Field("InStoreType_Name"));
            query.Columns.Add(DQSelectColumn.Field("InStoreDate"));
            query.Columns.Add(DQSelectColumn.Field("CheckEmployee_Name"));
            query.Columns.Add(DQSelectColumn.Field("CheckDate"));
            query.Columns.Add(DQSelectColumn.Field("ProductInStoreTemplate_Name"));
            query.OrderBy.Expressions.Add(DQOrderByExpression.Create("ID", true));
            HippoUtil.AddEQ(query, "ID", queryobj.ID);
            HippoUtil.AddEQ(query, "BillState", queryobj.BillState);
            HippoUtil.AddEQ(query, "AccountingUnit_ID", queryobj.AccountingUnit_ID);
            HippoUtil.AddEQ(query, "Department_ID", queryobj.Department_ID);
            HippoUtil.AddEQ(query, "Employee_ID", queryobj.Employee_ID);
            HippoUtil.AddEQ(query, "Store_ID", queryobj.Store_ID);
            HippoUtil.AddEQ(query, "InStoreType_ID", queryobj.InStoreType_ID);
            HippoUtil.AddEQ(query, "ProductPlan_ID", queryobj.ProductPlan_ID);
            if (queryobj.MinInStoreDate.HasValue)
            {
                query.Where.Conditions.Add(DQCondition.GreaterThanOrEqual("InStoreDate", queryobj.MinInStoreDate.Value));
            }
            if (queryobj.MaxInStoreDate.HasValue)
            {
                query.Where.Conditions.Add(DQCondition.LessThanOrEqual("InStoreDate", queryobj.MaxInStoreDate.Value));
            }
            query.Where.Conditions.Add(DQCondition.EQ("Domain_ID", DomainContext.Current.ID));
            query.Range = new SelectRange(data.Start, data.Count);
            OrganizationUtil.AddOrganizationLimit(query, typeof(ProductInStore));
            var pagedData = new DFDataAdapter(new LoadArguments(query)).PagedFill();

            data.Start = 0;
            data.Count = (int)pagedData.TotalCount;
            data.Data  = pagedData.Data;
            return(data);
        }
示例#3
0
        public static FormData FormActions(string action, FormData data)
        {
            var productInput = (ProductNotice)data.MainObject;
            var bl           = BIFactory.Create <IProductNoticeBL>();

            switch (action)
            {
            case FormActionNames.Load:
                var dom = bl.Load(productInput.ID);
                data.MainObject = dom;
                break;

            case FormActionNames.Save:
                BeforeSave(productInput);
                if (productInput.ID == 0)
                {
                    bl.InitNewDmo(productInput);
                    UpdateDetail(productInput);
                    bl.Insert(productInput);
                    data.MainObject = productInput;
                    return(FormActions(FormActionNames.Load, data));
                }
                UpdateDetail(productInput);
                bl.Update(productInput);
                return(FormActions(FormActionNames.Load, data));

            case FormActionNames.Check:
                bl.Check(productInput);
                data.MainObject = productInput;
                break;

            case FormActionNames.New:
                var dmo = new ProductNotice();
                data.MainObject = dmo;
                break;

            case FormActionNames.Prev:
                var prevDmo = GetPrevOrNext(productInput.ID);
                if (prevDmo == null)
                {
                    throw new IndexOutOfRangeException("Current is first");
                }
                data.MainObject = prevDmo;
                break;

            case FormActionNames.Next:
                var nextDmo = GetPrevOrNext(productInput.ID, false);
                if (nextDmo == null)
                {
                    throw new IndexOutOfRangeException("Current is last");
                }
                data.MainObject = nextDmo;
                break;

            case "LoadDetail":
                LoadDetail(productInput);
                break;

            case "ReferToCreate":
                data.MainObject = HippoUtil.ReferenceToCreate(productInput);
                break;

            case "Predict":
                LoadPredictDetail(productInput);
                UpdateDetail(productInput);
                break;

            default:
                throw new ArgumentException("Unknown action: " + action);
            }
            return(data);
        }
示例#4
0
        public static FormData FormActions(string action, FormData data)
        {
            var productOutput = (ProduceOutput)data.MainObject;
            var bl            = BIFactory.Create <IProduceOutputBL>();

            switch (action)
            {
            case FormActionNames.Load:
                var dom = bl.Load(productOutput.ID);
                data.MainObject = dom;
                break;

            case FormActionNames.Save:
                if (productOutput.Details.Count <= 0)
                {
                    LoadDetail(productOutput);
                    //在 save 的 FormAction 里,向客户端返回脚本: "scrollToCollection(0)", 也就是: "0 ()scrollToCollection "
                    data.Codes = "0 ()scrollToCollection ";
                }
                if (productOutput.ID == 0)
                {
                    bl.InitNewDmo(productOutput);
                    bl.Insert(productOutput);
                    data.MainObject = productOutput;
                    //在 save 的 FormAction 里,向客户端返回脚本: "scrollToCollection(0)", 也就是: "0 ()scrollToCollection "
                    data.Codes = "0 ()scrollToCollection ";
                    return(FormActions(FormActionNames.Load, data));
                }
                bl.Update(productOutput);
                return(FormActions(FormActionNames.Load, data));

            case FormActionNames.New:
                var dmo = new ProduceOutput();
                data.MainObject = dmo;
                dmo.Time        = DateTime.Now;
                bl.InitNewDmo(dmo);
                var productPlan = GetProductPlan(dmo.AccountingUnit_ID, dmo.Department_ID, Convert.ToDateTime(Convert.ToDateTime(dmo.Time).ToShortDateString()));
                if (productPlan != null)
                {
                    dmo.PlanNumber_ID   = productPlan.Item1;
                    dmo.PlanNumber_Name = productPlan.Item2;
                }
                break;

            case FormActionNames.Prev:
                var prevDmo = GetPrevOrNext(productOutput.ID);
                if (prevDmo == null)
                {
                    throw new IndexOutOfRangeException("Current is first");
                }
                data.MainObject = prevDmo;
                break;

            case FormActionNames.Next:
                var nextDmo = GetPrevOrNext(productOutput.ID, false);
                if (nextDmo == null)
                {
                    throw new IndexOutOfRangeException("Current is last");
                }
                data.MainObject = nextDmo;
                break;

            case "LoadDetail":
                LoadDetail(productOutput);
                bl.Update(productOutput);
                break;

            case "ReferToCreate":
                data.MainObject = HippoUtil.ReferenceToCreate <ProduceOutput>(productOutput);
                break;

            default:
                throw new ArgumentException("Unknown action: " + action);
            }
            return(data);
        }