Ejemplo n.º 1
0
        public ActionResult AddCulture(MemberOrganization memberOrganization, Guid[] selectedCulture)
        {
            if (ModelState.IsValid)
            {
                ICollection<MemberOrgCulture> ImemberOrgCulture = new List<MemberOrgCulture>();
                foreach (Guid guid in selectedCulture)
                {
                    MemberOrgCulture item = new MemberOrgCulture();
                    item.OrgID = memberOrganization.Gid;
                    item.Ctype = (byte)ModelEnum.CultureType.LANGUAGE;
                    item.aCulture = guid;
                    ImemberOrgCulture.Add(item);
                }
                memberOrganization.Cultures = ImemberOrgCulture;
                dbEntity.MemberOrganizations.Add(memberOrganization);
                dbEntity.SaveChanges();

                //foreach(var culture in memberOrganization.Cultures)
                //memberOrgCulture.aCulture = memberOrganization.Cultures.Single

                //db.MemberOrgCultures.Add
                return RedirectToAction("AddOrgAttribute", new { id = memberOrganization.Gid });
            }
            return View();
        }
Ejemplo n.º 2
0
        public static void RunOnce()
        {
            try
            {
                // 创建数据库事务
                using (var scope = new TransactionScope())
                {
                    // 创建EF实体
                    using (var oLiveEntities = new LiveEntities(ConfigHelper.LiveConnection.Connection))
                    {
                        #region GeneralConfig配置参数
                        GeneralConfig oConfig_System = new GeneralConfig
                        {
                            // 系统配置参数
                            Code = "SYSTEM",
                            StrValue = "System",
                            Remark = "一级菜单(系统配置参数)",
                            ChildItems = new List<GeneralConfig>
                            {
                                // 系统启用日期
                                new GeneralConfig
                                {
                                    Code = "StartDate",
                                    Ctype = (byte)ModelEnum.ConfigParamType.DATETIME,
                                    DateValue = DateTimeOffset.Now,
                                    Remark = "二级菜单(系统启用日期)"
                                },
                                // 国家统计局最新行政区划
                                new GeneralConfig
                                {
                                    Code = "LastRegionDefine",
                                    Ctype = (byte)ModelEnum.ConfigParamType.DATETIME,
                                    DateValue = new DateTimeOffset(2010, 12, 31, 0, 0, 0, TimeZone.CurrentTimeZone.GetUtcOffset(DateTime.Now)),
                                    Remark = "最新县及县以上行政区划代码(截止2010年12月31日);http://www.stats.gov.cn/tjbz/xzqhdm/t20110726_402742468.htm"
                                },
                                // Session 名称
                                new GeneralConfig
                                {
                                    Code = "SessionName",
                                    StrValue = "ZhuchaoSession",
                                    Remark = "二级菜单(Session名称)"
                                },
                                // Cookie 名称
                                new GeneralConfig
                                {
                                    Code ="CookieName",
                                    StrValue = "ZhuchaoCookie",
                                    Remark = "二级菜单(Cookie名称)"
                                }
                            }
                        };
                        GeneralConfig oConfig_Code = new GeneralConfig
                        {
                            // 代码生成器参数
                            Code = "CODE",
                            StrValue = "Code",
                            Remark = "一级菜单(代码生成器参数)",
                            ChildItems = new List<GeneralConfig>
                            {
                                // 字符代码前缀
                                new GeneralConfig
                                {
                                    Code = "CodePrefix_C",
                                    Ctype = (byte)ModelEnum.ConfigParamType.STRING,
                                    StrValue = "C",
                                    Remark = "二级菜单(字符代码前缀,每个数据库不一样,中国C,美国U,欧洲E)"
                                },
                                // 数字代码前缀
                                new GeneralConfig
                                {
                                    Code = "CodePrefix_N",
                                    Ctype = (byte)ModelEnum.ConfigParamType.STRING,
                                    StrValue = "1",
                                    Remark = "二级菜单(数字代码前缀,每个数据库不一样,中国1,美国2,欧洲3)"
                                },
                                // 错误报告代码 GeneralErrorReport.Code
                                new GeneralConfig
                                {
                                    Code = "ErrorReportCode",
                                    Ctype = (byte)ModelEnum.ConfigParamType.INTEGER,
                                    IntValue = 0,
                                    Remark = "二级菜单(错误报告代码)"
                                },
                                // 待办事项代码 GeneralTodoList.Code
                                new GeneralConfig
                                {
                                    Code = "TodoListCode",
                                    Ctype = (byte)ModelEnum.ConfigParamType.INTEGER,
                                    IntValue = 0,
                                    Remark = "二级菜单(待办事项代码)"
                                },
                                // 采购单号 PurchaseInformation.Code
                                new GeneralConfig
                                {
                                    Code = "PurchaseCode",
                                    Ctype = (byte)ModelEnum.ConfigParamType.INTEGER,
                                    IntValue = 0,
                                    Remark = "二级菜单(采购单号,递增,不可跳号)"
                                },
                                // 质检单号 PurchaseInspection.Code
                                new GeneralConfig
                                {
                                    Code ="InspectionCode",
                                    Ctype = (byte)ModelEnum.ConfigParamType.INTEGER,
                                    IntValue = 0,
                                    Remark = "二级菜单(质检单号,递增,不可跳号)"
                                },
                                // 入库单号 WarehouseStockIn.Code
                                new GeneralConfig
                                {
                                    Code ="StockInCode",
                                    Ctype = (byte)ModelEnum.ConfigParamType.INTEGER,
                                    IntValue = 0,
                                    Remark = "二级菜单(入库单号,递增,不可跳号)"
                                },
                                // 出库单号 WarehouseStockOut.Code
                                new GeneralConfig
                                {
                                    Code ="StockOutCode",
                                    Ctype = (byte)ModelEnum.ConfigParamType.INTEGER,
                                    IntValue = 0,
                                    Remark = "二级菜单(出库单号,递增,不可跳号)"
                                },
                                // 移库单号 WarehouseMoving.Code
                                new GeneralConfig
                                {
                                    Code ="MovingCode",
                                    Ctype = (byte)ModelEnum.ConfigParamType.INTEGER,
                                    IntValue = 0,
                                    Remark = "二级菜单(移库单号,递增,不可跳号)"
                                },
                                // 盘点单号 WarehouseInventory.Code
                                new GeneralConfig
                                {
                                    Code ="InventoryCode",
                                    Ctype = (byte)ModelEnum.ConfigParamType.INTEGER,
                                    IntValue = 0,
                                    Remark = "二级菜单(盘点单号,递增,不可跳号)"
                                },
                                // 订单号 OrderInformation.Code
                                new GeneralConfig
                                {
                                    Code ="OrderCode",
                                    Ctype = (byte)ModelEnum.ConfigParamType.INTEGER,
                                    IntValue = 0,
                                    Remark = "二级菜单(订单号,递增,不可跳号)"
                                },
                                // 应付单号 FinancePayment.Code
                                new GeneralConfig
                                {
                                    Code ="PaymentCode",
                                    Ctype = (byte)ModelEnum.ConfigParamType.INTEGER,
                                    IntValue = 0,
                                    Remark = "二级菜单(应付号,递增,不可跳号)"
                                }
                            }
                        };
                        oLiveEntities.GeneralConfigs.Add(oConfig_System);
                        oLiveEntities.GeneralConfigs.Add(oConfig_Code);
                        oLiveEntities.SaveChanges();

                        Debug.WriteLine("LiveAzure.Models.General.InitialiseDatabase.RunOnce: GeneralConfig 配置参数");
                        #endregion

                        #region GeneralStandardCategory标准分类

                        #region 标准组织类别
                        GeneralStandardCategory oStandardOrganization = new GeneralStandardCategory
                        {
                            Ctype = (byte)ModelEnum.StandardCategoryType.ORGANIZATION,
                            Code = "Standard",
                            Remark = "标准组织类型",
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "标准组织",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Standard Organization" }
                                }
                            }
                        };
                        #endregion

                        #region 渠道类别
                        GeneralStandardCategory oChannelType01 = new GeneralStandardCategory
                        {
                            Ctype = (byte)ModelEnum.StandardCategoryType.CHANNEL,
                            Code = "OfficialWeb",
                            Remark = "官网",
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "正式官网",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Official Website" }
                                }
                            }
                        };
                        GeneralStandardCategory oChannelType02 = new GeneralStandardCategory
                        {
                            Ctype = (byte)ModelEnum.StandardCategoryType.CHANNEL,
                            Code = "Taobao",
                            Remark = "淘宝店,包括淘宝旗舰店和专营店等",
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "淘宝店",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Taobao" }
                                }
                            }
                        };
                        GeneralStandardCategory oChannelType03 = new GeneralStandardCategory
                        {
                            Ctype = (byte)ModelEnum.StandardCategoryType.CHANNEL,
                            Code = "Paipai",
                            Remark = "拍拍店",
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "拍拍店",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Paipai" }
                                }
                            }
                        };
                        GeneralStandardCategory oChannelType04 = new GeneralStandardCategory
                        {
                            Ctype = (byte)ModelEnum.StandardCategoryType.CHANNEL,
                            Code = "Sina",
                            Remark = "新浪商城",
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "新浪商城",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Sina Mall" }
                                }
                            }
                        };
                        GeneralStandardCategory oChannelType05 = new GeneralStandardCategory
                        {
                            Ctype = (byte)ModelEnum.StandardCategoryType.CHANNEL,
                            Code = "tg.com.cn",
                            Remark = "齐家网",
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "齐家网",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Qijia" }
                                }
                            }
                        };
                        GeneralStandardCategory oChannelType06 = new GeneralStandardCategory
                        {
                            Ctype = (byte)ModelEnum.StandardCategoryType.CHANNEL,
                            Code = "360buy",
                            Remark = "京东商城",
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "京东商城",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "360buy" }
                                }
                            }
                        };
                        GeneralStandardCategory oChannelType07 = new GeneralStandardCategory
                        {
                            Ctype = (byte)ModelEnum.StandardCategoryType.CHANNEL,
                            Code = "dangdang",
                            Remark = "当当网",
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "当当网",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "dangdang" }
                                }
                            }
                        };
                        #endregion

                        #region 入库类型
                        GeneralStandardCategory oStockInType01 = new GeneralStandardCategory
                        {
                            Ctype = (byte)ModelEnum.StandardCategoryType.STOCKIN,
                            Code = "PurchaseIn",
                            Remark = "大货入库类型",
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "大货入库",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Bulk In" }
                                }
                            }
                        };
                        GeneralStandardCategory oStockInType02 = new GeneralStandardCategory
                        {
                            Ctype = (byte)ModelEnum.StandardCategoryType.STOCKIN,
                            Code = "ReturnIn",
                            Remark = "退货入库类型",
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "退货入库",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Return In" }
                                }
                            }
                        };
                        GeneralStandardCategory oStockInType03 = new GeneralStandardCategory
                        {
                            Ctype = (byte)ModelEnum.StandardCategoryType.STOCKIN,
                            Code = "InventoryProfit",
                            Remark = "盘盈入库类型",
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "盘盈",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Inventory Profit" }
                                }
                            }
                        };
                        GeneralStandardCategory oStockInType04 = new GeneralStandardCategory
                        {
                            Ctype = (byte)ModelEnum.StandardCategoryType.STOCKIN,
                            Code = "AdjustStockIn",
                            Remark = "调整入库类型",
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "调整入库",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Adjust Stock In" }
                                }
                            }
                        };
                        GeneralStandardCategory oStockInType05 = new GeneralStandardCategory
                        {
                            Ctype = (byte)ModelEnum.StandardCategoryType.STOCKIN,
                            Code = "MoveIn",
                            Remark = "移入库类型",
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "移入库",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Move In" }
                                }
                            }
                        };
                        #endregion

                        #region 出库类型
                        GeneralStandardCategory oStockOutType01 = new GeneralStandardCategory
                        {
                            Ctype = (byte)ModelEnum.StandardCategoryType.STOCKOUT,
                            Code = "Sale",
                            Remark = "销售出库类型",
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "销售出库",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Sale" }
                                }
                            }
                        };
                        GeneralStandardCategory oStockOutType01b = new GeneralStandardCategory
                        {
                            Ctype = (byte)ModelEnum.StandardCategoryType.STOCKOUT,
                            Code = "Resend",
                            Remark = "销售补发货出库类型",
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "销售补发/换货",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Resend/Change" }
                                }
                            }
                        };
                        GeneralStandardCategory oStockOutType02 = new GeneralStandardCategory
                        {
                            Ctype = (byte)ModelEnum.StandardCategoryType.STOCKOUT,
                            Code = "ReturnSupplier",
                            Remark = "采购退货出库类型",
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "采购退货",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Return Supplier" }
                                }
                            }
                        };
                        GeneralStandardCategory oStockOutType03 = new GeneralStandardCategory
                        {
                            Ctype = (byte)ModelEnum.StandardCategoryType.STOCKOUT,
                            Code = "Discard",
                            Remark = "报废出库类型",
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "报废",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Discard" }
                                }
                            }
                        };
                        GeneralStandardCategory oStockOutType04 = new GeneralStandardCategory
                        {
                            Ctype = (byte)ModelEnum.StandardCategoryType.STOCKOUT,
                            Code = "InventoryLosses",
                            Remark = "盘亏出库类型",
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "盘亏",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Inventory Losses" }
                                }
                            }
                        };
                        GeneralStandardCategory oStockOutType05 = new GeneralStandardCategory
                        {
                            Ctype = (byte)ModelEnum.StandardCategoryType.STOCKOUT,
                            Code = "Adjust Stock Out",
                            Remark = "调整出库类型",
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "调整出库",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Adjust Stock Out" }
                                }
                            }
                        };
                        GeneralStandardCategory oStockOutType06 = new GeneralStandardCategory
                        {
                            Ctype = (byte)ModelEnum.StandardCategoryType.STOCKOUT,
                            Code = "MoveOut",
                            Remark = "移出库类型",
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "移出库",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Move Out" }
                                }
                            }
                        };
                        GeneralStandardCategory oStockOutType07 = new GeneralStandardCategory
                        {
                            Ctype = (byte)ModelEnum.StandardCategoryType.STOCKOUT,
                            Code = "InternalUse",
                            Remark = "内部领用出库类型",
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "内部领用出库",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Internal Use" }
                                }
                            }
                        };
                        #endregion

                        oLiveEntities.GeneralStandardCategorys.Add(oStandardOrganization);
                        oLiveEntities.GeneralStandardCategorys.Add(oChannelType01);
                        oLiveEntities.GeneralStandardCategorys.Add(oChannelType02);
                        oLiveEntities.GeneralStandardCategorys.Add(oChannelType03);
                        oLiveEntities.GeneralStandardCategorys.Add(oChannelType04);
                        oLiveEntities.GeneralStandardCategorys.Add(oChannelType05);
                        oLiveEntities.GeneralStandardCategorys.Add(oChannelType06);
                        oLiveEntities.GeneralStandardCategorys.Add(oChannelType07);
                        oLiveEntities.GeneralStandardCategorys.Add(oStockInType01);
                        oLiveEntities.GeneralStandardCategorys.Add(oStockInType02);
                        oLiveEntities.GeneralStandardCategorys.Add(oStockInType03);
                        oLiveEntities.GeneralStandardCategorys.Add(oStockInType04);
                        oLiveEntities.GeneralStandardCategorys.Add(oStockInType05);
                        oLiveEntities.GeneralStandardCategorys.Add(oStockOutType01);
                        oLiveEntities.GeneralStandardCategorys.Add(oStockOutType01b);
                        oLiveEntities.GeneralStandardCategorys.Add(oStockOutType02);
                        oLiveEntities.GeneralStandardCategorys.Add(oStockOutType03);
                        oLiveEntities.GeneralStandardCategorys.Add(oStockOutType04);
                        oLiveEntities.GeneralStandardCategorys.Add(oStockOutType05);
                        oLiveEntities.GeneralStandardCategorys.Add(oStockOutType06);
                        oLiveEntities.GeneralStandardCategorys.Add(oStockOutType07);
                        oLiveEntities.SaveChanges();

                        Debug.WriteLine("LiveAzure.Models.General.InitialiseDatabase.RunOnce: GeneralStandardCategory 标准分类");
                        #endregion

                        #region GeneralMeasureUnit 主要计量单位
                        GeneralMeasureUnit oUnitPiece = new GeneralMeasureUnit
                        {
                            Utype = (byte)ModelEnum.MeasureUnit.PIECE,
                            Code = "PCS",
                            Remark = "个/件",
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "个",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Piece" }
                                }
                            }
                        };
                        GeneralMeasureUnit oUnitKG = new GeneralMeasureUnit
                        {
                            Utype = (byte)ModelEnum.MeasureUnit.WEIGHT,
                            Code = "KG",
                            Remark = "千克/公斤",
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "千克",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "KG" }
                                }
                            }
                        };
                        GeneralMeasureUnit oUnitG = new GeneralMeasureUnit
                        {
                            Utype = (byte)ModelEnum.MeasureUnit.WEIGHT,
                            Code = "G",
                            Remark = "克",
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "克",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "G" }
                                }
                            }
                        };
                        GeneralMeasureUnit oUnitPound = new GeneralMeasureUnit
                        {
                            Utype = (byte)ModelEnum.MeasureUnit.WEIGHT,
                            Code = "Pound",
                            Remark = "英磅",
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "英磅",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Pound" }
                                }
                            }
                        };
                        GeneralMeasureUnit oUnitCube = new GeneralMeasureUnit
                        {
                            Utype = (byte)ModelEnum.MeasureUnit.VOLUME,
                            Code = "CUBE",
                            Remark = "平方米",
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "立方米",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Cube Meter" }
                                }
                            }
                        };
                        GeneralMeasureUnit oUnitLitre = new GeneralMeasureUnit
                        {
                            Utype = (byte)ModelEnum.MeasureUnit.FLUID,
                            Code = "Litre",
                            Remark = "升",
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "升",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Litre" }
                                }
                            }
                        };
                        GeneralMeasureUnit oUnitGallon = new GeneralMeasureUnit
                        {
                            Utype = (byte)ModelEnum.MeasureUnit.FLUID,
                            Code = "Gallon",
                            Remark = "加仑",
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "加仑",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Gallon" }
                                }
                            }
                        };
                        GeneralMeasureUnit oUnitSquare = new GeneralMeasureUnit
                        {
                            Utype = (byte)ModelEnum.MeasureUnit.AREA,
                            Code = "Square",
                            Remark = "平方米",
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "平方米",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Square Meter" }
                                }
                            }
                        };
                        GeneralMeasureUnit oUnitSF = new GeneralMeasureUnit
                        {
                            Utype = (byte)ModelEnum.MeasureUnit.AREA,
                            Code = "SF",
                            Remark = "平方英尺",
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "平方英尺",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Square Feet" }
                                }
                            }
                        };
                        GeneralMeasureUnit oUnitMeter = new GeneralMeasureUnit
                        {
                            Utype = (byte)ModelEnum.MeasureUnit.LINEAR,
                            Code = "Meter",
                            Remark = "米",
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "米",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Meter" }
                                }
                            }
                        };
                        GeneralMeasureUnit oUnitFeet = new GeneralMeasureUnit
                        {
                            Utype = (byte)ModelEnum.MeasureUnit.LINEAR,
                            Code = "Feet",
                            Remark = "英尺",
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "英尺",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Feet" }
                                }
                            }
                        };
                        GeneralMeasureUnit oUnitRMB = new GeneralMeasureUnit
                        {
                            Utype = (byte)ModelEnum.MeasureUnit.CURRENCY,
                            Code = (new CultureInfo("zh-CN")).NumberFormat.CurrencySymbol,
                            Remark = "人民币",
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "人民币",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "RMB" }
                                }
                            }
                        };
                        GeneralMeasureUnit oUnitUSD = new GeneralMeasureUnit
                        {
                            Utype = (byte)ModelEnum.MeasureUnit.CURRENCY,
                            Code = (new CultureInfo("en-US")).NumberFormat.CurrencySymbol,
                            Remark = "美元",
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "美元",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "USD" }
                                }
                            }
                        };
                        GeneralMeasureUnit oUnitEUR = new GeneralMeasureUnit
                        {
                            Utype = (byte)ModelEnum.MeasureUnit.CURRENCY,
                            Code = (new CultureInfo("fr-FR")).NumberFormat.CurrencySymbol,
                            Remark = "欧元",
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "欧元",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "EUR" }
                                }
                            }
                        };
                        GeneralMeasureUnit oUnitGRP = new GeneralMeasureUnit
                        {
                            Utype = (byte)ModelEnum.MeasureUnit.CURRENCY,
                            Code = (new CultureInfo("en-GB")).NumberFormat.CurrencySymbol,
                            Remark = "英镑",
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "英镑",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "GRP" }
                                }
                            }
                        };
                        oLiveEntities.GeneralMeasureUnits.Add(oUnitPiece);
                        oLiveEntities.GeneralMeasureUnits.Add(oUnitKG);
                        oLiveEntities.GeneralMeasureUnits.Add(oUnitG);
                        oLiveEntities.GeneralMeasureUnits.Add(oUnitPound);
                        oLiveEntities.GeneralMeasureUnits.Add(oUnitCube);
                        oLiveEntities.GeneralMeasureUnits.Add(oUnitLitre);
                        oLiveEntities.GeneralMeasureUnits.Add(oUnitGallon);
                        oLiveEntities.GeneralMeasureUnits.Add(oUnitSquare);
                        oLiveEntities.GeneralMeasureUnits.Add(oUnitSF);
                        oLiveEntities.GeneralMeasureUnits.Add(oUnitMeter);
                        oLiveEntities.GeneralMeasureUnits.Add(oUnitFeet);
                        oLiveEntities.GeneralMeasureUnits.Add(oUnitRMB);
                        oLiveEntities.GeneralMeasureUnits.Add(oUnitUSD);
                        oLiveEntities.GeneralMeasureUnits.Add(oUnitEUR);
                        oLiveEntities.GeneralMeasureUnits.Add(oUnitGRP);
                        oLiveEntities.SaveChanges();

                        Debug.WriteLine("LiveAzure.Models.General.InitialiseDatabase.RunOnce: GeneralMeasureUnit 主要计量单位");
                        #endregion

                        #region GeneralCultureUnit 默认语言和计量单位
                        GeneralCultureUnit oCultureZHCN = new GeneralCultureUnit
                        {
                            // 中文(中国)
                            Culture = 2052,  // zh-CN
                            Piece = oUnitPiece,
                            Weight = oUnitKG,
                            Volume = oUnitCube,
                            Fluid = oUnitLitre,
                            Area = oUnitSquare,
                            Linear = oUnitMeter,
                            Currency = oUnitRMB
                        };
                        GeneralCultureUnit oCultureENUS = new GeneralCultureUnit
                        {
                            // 英语(美国)
                            Culture = 1033,  // en-US
                            Piece = oUnitPiece,
                            Weight = oUnitPound,
                            Volume = oUnitCube,
                            Fluid = oUnitGallon,
                            Area = oUnitSF,
                            Linear = oUnitFeet,
                            Currency = oUnitUSD
                        };
                        GeneralCultureUnit oCultureENGB = new GeneralCultureUnit
                        {
                            // 英语(英国)
                            Culture = 2057,  // en-GB
                            Piece = oUnitPiece,
                            Weight = oUnitPound,
                            Volume = oUnitCube,
                            Fluid = oUnitGallon,
                            Area = oUnitSF,
                            Linear = oUnitFeet,
                            Currency = oUnitGRP
                        };
                        GeneralCultureUnit oCultureFRFR = new GeneralCultureUnit
                        {
                            // 法文(法国)
                            Culture = 1036,  // fr-FR
                            Piece = oUnitPiece,
                            Weight = oUnitKG,
                            Volume = oUnitCube,
                            Fluid = oUnitLitre,
                            Area = oUnitSquare,
                            Linear = oUnitMeter,
                            Currency = oUnitEUR
                        };
                        GeneralCultureUnit oCultureDEDE = new GeneralCultureUnit
                        {
                            // 德文(德国)
                            Culture = 1031,  // de-DE
                            Piece = oUnitPiece,
                            Weight = oUnitKG,
                            Volume = oUnitCube,
                            Fluid = oUnitLitre,
                            Area = oUnitSquare,
                            Linear = oUnitMeter,
                            Currency = oUnitEUR
                        };
                        oLiveEntities.GeneralCultureUnits.Add(oCultureZHCN);
                        oLiveEntities.GeneralCultureUnits.Add(oCultureENUS);
                        oLiveEntities.GeneralCultureUnits.Add(oCultureENGB);
                        oLiveEntities.GeneralCultureUnits.Add(oCultureFRFR);
                        oLiveEntities.GeneralCultureUnits.Add(oCultureDEDE);
                        oLiveEntities.SaveChanges();

                        Debug.WriteLine("LiveAzure.Models.General.InitialiseDatabase.RunOnce: GeneralCultureUnit 默认语言和计量单位");
                        #endregion

                        #region 预定义第一个组织、两个渠道、第一个仓库、两个角色由触发器生成
                        // 第一个组织
                        MemberOrganization oFirstOrgan = new MemberOrganization
                        {
                            Code = "Zhuchao",
                            Ostatus = (byte)ModelEnum.OrganizationStatus.VALID,
                            ExtendType = oStandardOrganization,  // 标准组织
                            Terminal = true,
                            FullName = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "上海筑巢信息科技有限公司",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Shanghai Zhuchao Information Technologo Co., Ltd." }
                                }
                            },
                            ShortName = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "筑巢",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Zhuchao" }
                                }
                            },
                            FullAddress = "上海市嘉定区马陆镇丰功路958号",
                            PostCode = "201801",
                            Contact = "伯鉴",
                            CellPhone = "13816626660",
                            WorkPhone = "(86)21-60831660",
                            WorkFax = "(86)21-60831657",
                            Email = "*****@*****.**",
                            HomeUrl = "http://www.zhuchao.com"
                        };
                        // 第一个官网渠道
                        MemberChannel oFirstChannel = new MemberChannel
                        {
                            Code = "ZCWEB001",
                            Ostatus = (byte)ModelEnum.OrganizationStatus.VALID,
                            ExtendType = oChannelType01,        // 官网
                            Terminal = true,
                            FullName = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "筑巢官网",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Zhuchao Website" }
                                }
                            },
                            ShortName = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "筑巢官网",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Zhuchao Website" }
                                }
                            },
                            FullAddress = "上海市嘉定区马陆镇丰功路958号",
                            PostCode = "201801",
                            Contact = "伯鉴",
                            CellPhone = "13816626660",
                            WorkPhone = "(86)21-60831660",
                            WorkFax = "(86)21-60831657",
                            Email = "*****@*****.**",
                            HomeUrl = "http://www.zhuchao.com"
                        };
                        // 第二个淘宝专营店渠道
                        MemberChannel oSecondChannel = new MemberChannel
                        {
                            Code = "ZCTB001",
                            Ostatus = (byte)ModelEnum.OrganizationStatus.VALID,
                            ExtendType = oChannelType02,        // 淘宝网
                            Terminal = true,
                            FullName = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "淘宝专营店",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Taobao 专营店" }
                                }
                            },
                            ShortName = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "淘宝专营店",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Taobao 专营店" }
                                }
                            },
                            FullAddress = "上海市嘉定区马陆镇丰功路958号",
                            PostCode = "201801",
                            Contact = "伯鉴",
                            CellPhone = "13816626660",
                            WorkPhone = "(86)21-60831660",
                            WorkFax = "(86)21-60831657",
                            Email = "*****@*****.**",
                            HomeUrl = "http://www.zhuchao.com.cn"
                        };
                        // 组织和渠道关联
                        MemberOrgChannel oOrganChannel1 = new MemberOrgChannel
                        {
                            Organization = oFirstOrgan,
                            Channel = oFirstChannel,
                            Cstatus = (byte)ModelEnum.GenericStatus.VALID
                        };
                        MemberOrgChannel oOrganChannel2 = new MemberOrgChannel
                        {
                            Organization = oFirstOrgan,
                            Channel = oSecondChannel,
                            Cstatus = (byte)ModelEnum.GenericStatus.VALID,
                            // RemoteUrl = "http://gw.api.tbsandbox.com/router/rest",         // 沙箱地址
                            RemoteUrl = "http://gw.api.taobao.com/router/rest",               // 正式地址
                            ConfigKey = "12176743",
                            SecretKey = "a9e366dde6816c2866e4f60af62162ca",
                            SessionKey = "23767603b359d0623b84b6963b5507db8f6b3_1"
                        };
                        // 组织支持的默认语言
                        MemberOrgCulture oOrganCulture01 = new MemberOrgCulture
                        {
                            Organization = oFirstOrgan,
                            Ctype = (byte)ModelEnum.CultureType.LANGUAGE,
                            Culture = oCultureZHCN
                        };
                        MemberOrgCulture oOrganCulture02 = new MemberOrgCulture
                        {
                            Organization = oFirstOrgan,
                            Ctype = (byte)ModelEnum.CultureType.LANGUAGE,
                            Culture = oCultureENUS
                        };
                        MemberOrgCulture oOrganCulture03 = new MemberOrgCulture
                        {
                            Organization = oFirstOrgan,
                            Ctype = (byte)ModelEnum.CultureType.CURRENCY,
                            Currency = oUnitRMB
                        };
                        // 第一个仓库及其支持的渠道
                        WarehouseInformation oWarehouse = new WarehouseInformation
                        {
                            Code = "ZCWH001",
                            Ostatus = (byte)ModelEnum.OrganizationStatus.VALID,
                            Parent = oFirstOrgan,
                            Terminal = true,
                            FullName = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "上海丰功路仓库",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Shanghai Fenggong Road" }
                                }
                            },
                            ShortName = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "上海丰功路仓库",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Shanghai Fenggong Road" }
                                }
                            },
                            FullAddress = "上海市嘉定区马陆镇丰功路958号",
                            PostCode = "201801",
                            Contact = "伯鉴",
                            CellPhone = "13816626660",
                            WorkPhone = "(86)21-60831660",
                            WorkFax = "(86)21-60831657",
                            Email = "*****@*****.**",
                            HomeUrl = "http://www.zhuchao.com",
                            Channels = new List<MemberOrgChannel>
                            {
                                new MemberOrgChannel
                                {
                                    Channel = oFirstChannel,
                                    Cstatus = (byte)ModelEnum.GenericStatus.VALID
                                }
                            }
                        };

                        oLiveEntities.MemberOrgChannels.Add(oOrganChannel1);
                        oLiveEntities.MemberOrgChannels.Add(oOrganChannel2);
                        oLiveEntities.MemberOrgCultures.Add(oOrganCulture01);
                        oLiveEntities.MemberOrgCultures.Add(oOrganCulture02);
                        oLiveEntities.MemberOrgCultures.Add(oOrganCulture03);
                        oLiveEntities.WarehouseInformations.Add(oWarehouse);
                        oLiveEntities.SaveChanges();

                        Debug.WriteLine("LiveAzure.Models.General.InitialiseDatabase.RunOnce: 预定义第一个组织、两个渠道、第一个仓库、角色由触发器生成");
                        #endregion

                        #region 管理员角色,第一个管理员用户,第一个测试用户
                        MemberRole oAdminRole = new MemberRole
                        {
                            Organization = oFirstOrgan,
                            Code = "Supervisor",               // 唯一的一个超级管理员角色,不需要任何权限
                            Parent = oLiveEntities.MemberRoles.Where(r => r.Code == "Internal" && r.OrgID == oFirstOrgan.Gid).FirstOrDefault(),
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "超级管理员",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Supervisor" }
                                }
                            },
                            Remark = "超级管理员"
                        };
                        // 第一个用户
                        MemberUser oAdminUser = new MemberUser
                        {
                            Organization = oFirstOrgan,
                            Role = oAdminRole,
                            Channel = oFirstChannel,
                            LoginName = "admin",
                            Ustatus = (byte)ModelEnum.UserStatus.VALID,
                            NickName = "admin",
                            FirstName = "System",
                            LastName = "Admin",
                            DisplayName = "System Admin",
                            Culture = oCultureENUS,//天佑
                            Passcode = "izhuchao.com"
                        };
                        //测试用户Tester 测试用
                        MemberUser oTester = new MemberUser
                        {
                            Organization = oFirstOrgan,
                            Role = oLiveEntities.MemberRoles.Single(r => (r.OrgID == oFirstOrgan.Gid && r.Code == "Internal")),
                            Channel = oFirstChannel,
                            LoginName = "test",
                            Ustatus = (byte)ModelEnum.UserStatus.VALID,
                            NickName = "test",
                            FirstName = "System",
                            LastName = "Tester",
                            DisplayName = "System Tester",
                            Culture = oCultureZHCN,
                            Passcode = "izhuchao.com"
                        };
                        oLiveEntities.MemberUsers.Add(oAdminUser);
                        oLiveEntities.MemberUsers.Add(oTester);
                        oLiveEntities.SaveChanges();

                        Debug.WriteLine("LiveAzure.Models.General.InitialiseDatabase.RunOnce: 预定义超级管理员角色,第一个管理员和测试用户");
                        #endregion

                        #region GeneralProgram 程序定义

                        #region 首页
                        GeneralProgram oProgramHome = new GeneralProgram
                        {
                            Code = "HomeHomePage",
                            Parent = null,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "首页",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Home" }
                                }
                            },
                            ProgUrl = "/Home/HomePage"
                        };
                        #endregion

                        #region 系统菜单
                        GeneralProgram oProgramSys = new GeneralProgram
                        {
                            Code = "System",
                            Parent = null,
                            Terminal = false,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "系统",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "System" }
                                }
                            },
                            ProgUrl = ""
                        };
                        GeneralProgram oProgramSys01 = new GeneralProgram
                        {
                            Code = "ConfigIndex",
                            Parent = oProgramSys,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "配置参数",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Config Parameters" }
                                }
                            },
                            ProgUrl = "/Config/Index",
                            ProgramNodes = new List<GeneralProgNode>
                            {
                                new GeneralProgNode
                                {
                                    Code = "EnableEdit",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许编辑",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Edit" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                }
                            }
                        };
                        GeneralProgram oProgramSys02 = new GeneralProgram
                        {
                            Code = "ProgramIndex",
                            Parent = oProgramSys,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "程序定义",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Program Define" }
                                }
                            },
                            ProgUrl = "/Program/Index",
                            ProgramNodes = new List<GeneralProgNode>
                            {
                                new GeneralProgNode
                                {
                                    Code = "EnableEdit",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许编辑",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Edit" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                }
                            }
                        };
                        GeneralProgram oProgramSys03 = new GeneralProgram
                        {
                            Code = "RegionIndex",
                            Parent = oProgramSys,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "地区维护",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Region Define" }
                                }
                            },
                            ProgUrl = "/Region/Index",
                            ProgramNodes = new List<GeneralProgNode>
                            {
                                new GeneralProgNode
                                {
                                    Code = "EnableEdit",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许编辑",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Edit" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                }
                            }
                        };
                        GeneralProgram oProgramSys04 = new GeneralProgram
                        {
                            Code = "CategoryIndex",
                            Parent = oProgramSys,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "分类管理",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Category Define" }
                                }
                            },
                            ProgUrl = "/Category/Index",
                            ProgramNodes = new List<GeneralProgNode>
                            {
                                new GeneralProgNode
                                {
                                    Code = "EnableEditPrivate",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许编辑私有分类",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Edit Private" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                },
                                new GeneralProgNode
                                {
                                    Code = "EnableEditStandard",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许编辑标准分类",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Edit Standard" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                }
                            }
                        };
                        GeneralProgram oProgramSys05 = new GeneralProgram
                        {
                            Code = "OptionalIndex",
                            Parent = oProgramSys,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "属性管理",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Attribute Manage" }
                                }
                            },
                            ProgUrl = "/Optional/Index",
                            ProgramNodes = new List<GeneralProgNode>
                            {
                                new GeneralProgNode
                                {
                                    Code = "EnableEdit",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许编辑",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Edit" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                }
                            }
                        };
                        GeneralProgram oProgramSys06 = new GeneralProgram
                        {
                            Code = "ConfigUnit",
                            Parent = oProgramSys,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "计量单位",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Measure Unit" }
                                }
                            },
                            ProgUrl = "/Config/MeasureUnit",
                            ProgramNodes = new List<GeneralProgNode>
                            {
                                new GeneralProgNode
                                {
                                    Code = "EnableEdit",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许编辑",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Edit" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                }
                            }
                        };
                        GeneralProgram oProgramSys07 = new GeneralProgram
                        {
                            Code = "ConfigCulture",
                            Parent = oProgramSys,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "语言文化",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Culture Manage" }
                                }
                            },
                            ProgUrl = "/Config/Culture",
                            ProgramNodes = new List<GeneralProgNode>
                            {
                                new GeneralProgNode
                                {
                                    Code = "EnableEdit",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许编辑",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Edit" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                }
                            }
                        };
                        GeneralProgram oProgramSys08 = new GeneralProgram
                        {
                            Code = "ConfigMessage",
                            Parent = oProgramSys,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "消息队列",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Message" }
                                }
                            },
                            ProgUrl = "/Config/Message",
                            ProgramNodes = new List<GeneralProgNode>
                            {
                                new GeneralProgNode
                                {
                                    Code = "EnableSend",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许发短信",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Send" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                }
                            }
                        };
                        GeneralProgram oProgramSys11 = new GeneralProgram
                        {
                            Code = "ConfigErrorReport",
                            Parent = oProgramSys,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "错误报告",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Error Report" }
                                }
                            },
                            ProgUrl = "/Config/ErrorReport"
                        };
                        GeneralProgram oProgramSys12 = new GeneralProgram
                        {
                            Code = "ConfigAction",
                            Parent = oProgramSys,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "事件日志",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Action Event" }
                                }
                            },
                            ProgUrl = "/Config/Action"
                        };
                        GeneralProgram oProgramSys13 = new GeneralProgram
                        {
                            Code = "ConfigShortcut",
                            Parent = oProgramSys,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "快捷方式",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Shortcut" }
                                }
                            },
                            ProgUrl = "/Config/Shortcut"
                        };
                        #endregion

                        #region 会员菜单
                        GeneralProgram oProgramMem = new GeneralProgram
                        {
                            Code = "Member",
                            Parent = null,
                            Terminal = false,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "会员",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Member" }
                                }
                            },
                            ProgUrl = ""
                        };
                        GeneralProgram oProgramMem01 = new GeneralProgram
                        {
                            Code = "OrganizationIndex",
                            Parent = oProgramMem,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "组织管理",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Organization Manage" }
                                }
                            },
                            ProgUrl = "/Organization/Index",
                            ProgramNodes = new List<GeneralProgNode>
                            {
                                new GeneralProgNode
                                {
                                    Code = "EnableEdit",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许编辑",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Edit" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                }
                            }
                        };
                        GeneralProgram oProgramMem02 = new GeneralProgram
                        {
                            Code = "OrganizationChannel",
                            Parent = oProgramMem,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "渠道管理",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Channel Manage" }
                                }
                            },
                            ProgUrl = "/Organization/ChannelIndex",
                            ProgramNodes = new List<GeneralProgNode>
                            {
                                new GeneralProgNode
                                {
                                    Code = "EnableEdit",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许编辑",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Edit" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                }
                            }
                        };
                        GeneralProgram oProgramMem03 = new GeneralProgram
                        {
                            Code = "MemberRole",
                            Parent = oProgramMem,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "角色管理",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Role Manage" }
                                }
                            },
                            ProgUrl = "/User/MemberRole",
                            ProgramNodes = new List<GeneralProgNode>
                            {
                                new GeneralProgNode
                                {
                                    Code = "EnableEdit",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许编辑",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Edit" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                }
                            }
                        };
                        GeneralProgram oProgramMem04 = new GeneralProgram
                        {
                            Code = "UserIndex",
                            Parent = oProgramMem,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "用户管理",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "User Manage" }
                                }
                            },
                            ProgUrl = "/User/Index",
                            ProgramNodes = new List<GeneralProgNode>
                            {
                                new GeneralProgNode
                                {
                                    Code = "EnableEdit",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许编辑",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Edit" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                }
                            }
                        };
                        GeneralProgram oProgramMem05 = new GeneralProgram
                        {
                            Code = "UserPrivilege",
                            Parent = oProgramMem,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "用户授权",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "User Privilege" }
                                }
                            },
                            ProgUrl = "/Privilege/Index",
                            ProgramNodes = new List<GeneralProgNode>
                            {
                                new GeneralProgNode
                                {
                                    Code = "EnableEdit",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许编辑",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Edit" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                }
                            }
                        };
                        GeneralProgram oProgramMem06 = new GeneralProgram
                        {
                            Code = "UserPoint",
                            Parent = oProgramMem,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "用户积分",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "User Point" }
                                }
                            },
                            ProgUrl = "/User/Point"
                        };
                        GeneralProgram oProgramMem07 = new GeneralProgram
                        {
                            Code = "UserLevel",
                            Parent = oProgramMem,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "用户级别",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "User Level" }
                                }
                            },
                            ProgUrl = "/User/Level"
                        };
                        #endregion

                        #region 商品菜单
                        GeneralProgram oProgramProd = new GeneralProgram
                        {
                            Code = "Product",
                            Parent = null,
                            Terminal = false,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "商品",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Product" }
                                }
                            },
                            ProgUrl = ""
                        };
                        GeneralProgram oProgramProd01 = new GeneralProgram
                        {
                            Code = "ProductIndex",
                            Parent = oProgramProd,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "商品列表",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Product List" }
                                }
                            },
                            ProgUrl = "/Product/Index",
                            ProgramNodes = new List<GeneralProgNode>
                            {
                                new GeneralProgNode
                                {
                                    Code = "EnableEdit",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许编辑",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Edit" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                }
                            }
                        };
                        GeneralProgram oProgramProd02 = new GeneralProgram
                        {
                            Code = "ProductGallery",
                            Parent = oProgramProd,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "图片处理",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Product Gallery" }
                                }
                            },
                            ProgUrl = "/Product/Gallery",
                            ProgramNodes = new List<GeneralProgNode>
                            {
                                new GeneralProgNode
                                {
                                    Code = "EnableEdit",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许编辑",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Edit" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                }
                            }
                        };
                        GeneralProgram oProgramProd03 = new GeneralProgram
                        {
                            Code = "ProductImport",
                            Parent = oProgramProd,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "批量导入",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Product Import" }
                                }
                            },
                            ProgUrl = "/Product/Import"
                        };
                        GeneralProgram oProgramProd04 = new GeneralProgram
                        {
                            Code = "ProductValidation",
                            Parent = oProgramProd,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "数据验证",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Product Validation" }
                                }
                            },
                            ProgUrl = "/Product/Validation"
                        };
                        GeneralProgram oProgramProd05 = new GeneralProgram
                        {
                            Code = "OnSaleIndex",
                            Parent = oProgramProd,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "商品上架",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Product On Sale" }
                                }
                            },
                            ProgUrl = "/Product/OnSaleIndex",
                            ProgramNodes = new List<GeneralProgNode>
                            {
                                new GeneralProgNode
                                {
                                    Code = "EnablePrepare",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许制表(编辑)",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Prepare (Edit)" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                },
                                new GeneralProgNode
                                {
                                    Code = "EnableApprove",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许确认(上架)",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Confirm (On Sale)" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                }
                            }
                        };
                        GeneralProgram oProgramProd06 = new GeneralProgram
                        {
                            Code = "OnSaleTemplate",
                            Parent = oProgramProd,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "上架模板",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "On Sale Template" }
                                }
                            },
                            ProgUrl = "/Product/OnSaleTemplate",
                            ProgramNodes = new List<GeneralProgNode>
                            {
                                new GeneralProgNode
                                {
                                    Code = "EnableEdit",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许编辑",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Edit" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                }
                            }
                        };
                        GeneralProgram oProgramProd07 = new GeneralProgram
                        {
                            Code = "ProductCodePolicy",
                            Parent = oProgramProd,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "代码规则",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Code Policy" }
                                }
                            },
                            ProgUrl = "/Product/CodePolicy",
                            ProgramNodes = new List<GeneralProgNode>
                            {
                                new GeneralProgNode
                                {
                                    Code = "EnableEdit",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许编辑",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Edit" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                }
                            }
                        };
                        #endregion

                        #region 采购菜单
                        GeneralProgram oProgramPur = new GeneralProgram
                        {
                            Code = "Purchase",
                            Parent = null,
                            Terminal = false,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "采购",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Purchase" }
                                }
                            },
                            ProgUrl = ""
                        };
                        GeneralProgram oProgramPur01 = new GeneralProgram
                        {
                            Code = "PurchaseIndex",
                            Parent = oProgramPur,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "采购单据",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Purchase List" }
                                }
                            },
                            ProgUrl = "/Purchase/Index",
                            ProgramNodes = new List<GeneralProgNode>
                            {
                                new GeneralProgNode
                                {
                                    Code = "EnablePrepare",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许制表(编辑)",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Prepare (Edit)" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                },
                                new GeneralProgNode
                                {
                                    Code = "EnableApprove",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许确认",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Confirm" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                },
                                new GeneralProgNode
                                {
                                    Code = "EnableClose",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许结算",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Close" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                }
                            }
                        };
                        GeneralProgram oProgramPur02 = new GeneralProgram
                        {
                            Code = "PurchaseQuality",
                            Parent = oProgramPur,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "质量检查",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Quality Control" }
                                }
                            },
                            ProgUrl = "/Purchase/Quality",
                            ProgramNodes = new List<GeneralProgNode>
                            {
                                new GeneralProgNode
                                {
                                    Code = "EnableEdit",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许编辑",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Edit" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                }
                            }
                        };
                        GeneralProgram oProgramPur03 = new GeneralProgram
                        {
                            Code = "OrganizationSupplier",
                            Parent = oProgramPur,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "供应商",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Supplier" }
                                }
                            },
                            ProgUrl = "/Organization/SupplierIndex",
                            ProgramNodes = new List<GeneralProgNode>
                            {
                                new GeneralProgNode
                                {
                                    Code = "EnableEdit",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许编辑",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Edit" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                }
                            }
                        };
                        #endregion

                        #region 仓库菜单
                        GeneralProgram oProgramWh = new GeneralProgram
                        {
                            Code = "Warehouse",
                            Parent = null,
                            Terminal = false,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "仓库",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Warehouse" }
                                }
                            },
                            ProgUrl = ""
                        };
                        GeneralProgram oProgramWh01 = new GeneralProgram
                        {
                            Code = "OrganizationWarehouse",
                            Parent = oProgramWh,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "仓库列表",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Warehouse List" }
                                }
                            },
                            ProgUrl = "/Organization/WarehouseIndex",
                            ProgramNodes = new List<GeneralProgNode>
                            {
                                new GeneralProgNode
                                {
                                    Code = "EnableEdit",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许编辑",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Edit" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                }
                            }
                        };
                        GeneralProgram oProgramWh02 = new GeneralProgram
                        {
                            Code = "WarehouseIndex",
                            Parent = oProgramWh,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "库存总账",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Warehouse Ledger" }
                                }
                            },
                            ProgUrl = "/Warehouse/Index",
                            ProgramNodes = new List<GeneralProgNode>
                            {
                                new GeneralProgNode
                                {
                                    Code = "EnableEdit",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许编辑(冻结)",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Edit (Lock)" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                }
                            }
                        };
                        GeneralProgram oProgramWh03 = new GeneralProgram
                        {
                            Code = "WarehouseStockIn",
                            Parent = oProgramWh,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "入库记录",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Stock In" }
                                }
                            },
                            ProgUrl = "/Warehouse/StockIn",
                            ProgramNodes = new List<GeneralProgNode>
                            {
                                new GeneralProgNode
                                {
                                    Code = "EnablePrint",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许打印",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Print" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                },
                                new GeneralProgNode
                                {
                                    Code = "EnablePrepare",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许制表(编辑)",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Prepare (Edit)" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                },
                                new GeneralProgNode
                                {
                                    Code = "EnableApprove",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许确认",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Confirm" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                }
                            }
                        };
                        GeneralProgram oProgramWh04 = new GeneralProgram
                        {
                            Code = "WarehouseStockOut",
                            Parent = oProgramWh,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "出库记录",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Stock Out" }
                                }
                            },
                            ProgUrl = "/Warehouse/StockOut",
                            ProgramNodes = new List<GeneralProgNode>
                            {
                                new GeneralProgNode
                                {
                                    Code = "EnablePrint",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许打印",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Print" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                },
                                new GeneralProgNode
                                {
                                    Code = "EnablePrepare",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许制表(编辑)",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Prepare (Edit)" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                },
                                new GeneralProgNode
                                {
                                    Code = "EnableApprove",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许确认(扫描/发货)",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Confirm (Scan/Delivery)" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                },
                                new GeneralProgNode
                                {
                                    Code = "EnableSignFor",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许签收",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow SignFor" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                }
                            }
                        };
                        GeneralProgram oProgramWh05 = new GeneralProgram
                        {
                            Code = "WarehouseMoving",
                            Parent = oProgramWh,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "移库申请",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Moving" }
                                }
                            },
                            ProgUrl = "/Warehouse/Moving",
                            ProgramNodes = new List<GeneralProgNode>
                            {
                                new GeneralProgNode
                                {
                                    Code = "EnablePrepare",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许制表(编辑)",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Prepare (Edit)" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                },
                                new GeneralProgNode
                                {
                                    Code = "EnableApprove",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许确认",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Confirm" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                }
                            }
                        };
                        GeneralProgram oProgramWh06 = new GeneralProgram
                        {
                            Code = "WarehouseInventory",
                            Parent = oProgramWh,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "盘点记录",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Inventory" }
                                }
                            },
                            ProgUrl = "/Warehouse/Inventory",
                            ProgramNodes = new List<GeneralProgNode>
                            {
                                new GeneralProgNode
                                {
                                    Code = "EnablePrepare",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许制表(编辑)",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Prepare (Edit)" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                },
                                new GeneralProgNode
                                {
                                    Code = "EnableApprove",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许确认",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Confirm" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                },
                                new GeneralProgNode
                                {
                                    Code = "EnableSnapshot",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许仓库快照",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Snapshot" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                }
                            }
                        };
                        GeneralProgram oProgramWh07 = new GeneralProgram
                        {
                            Code = "WarehouseShelf",
                            Parent = oProgramWh,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "货架管理",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Warehouse Shelf" }
                                }
                            },
                            ProgUrl = "/Warehouse/Shelf",
                            ProgramNodes = new List<GeneralProgNode>
                            {
                                new GeneralProgNode
                                {
                                    Code = "EnableEditShelf",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许定义货架",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Edit Shelf" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                },
                                new GeneralProgNode
                                {
                                    Code = "EnableEditLock",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许编辑冻结",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Edit Lock" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                }
                            },
                            Remark = "包括WarehouseSkuShelf"
                        };
                        GeneralProgram oProgramWh08 = new GeneralProgram
                        {
                            Code = "WarehouseRegion",
                            Parent = oProgramWh,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "送达地区",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Support Region" }
                                }
                            },
                            ProgUrl = "/Warehouse/Region",
                            ProgramNodes = new List<GeneralProgNode>
                            {
                                new GeneralProgNode
                                {
                                    Code = "EnableEdit",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许编辑",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Edit" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                }
                            }
                        };
                        GeneralProgram oProgramWh09 = new GeneralProgram
                        {
                            Code = "WarehouseShipping",
                            Parent = oProgramWh,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "承运商",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Support Shipping" }
                                }
                            },
                            ProgUrl = "/Warehouse/Shipping",
                            ProgramNodes = new List<GeneralProgNode>
                            {
                                new GeneralProgNode
                                {
                                    Code = "EnableEdit",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许编辑",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Edit" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                }
                            }
                        };
                        #endregion

                        #region 订单菜单
                        GeneralProgram oProgramOrd = new GeneralProgram
                        {
                            Code = "Order",
                            Parent = null,
                            Terminal = false,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "订单",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Order" }
                                }
                            },
                            ProgUrl = ""
                        };
                        GeneralProgram oProgramOrd01 = new GeneralProgram
                        {
                            Code = "OrderIndex",
                            Parent = oProgramOrd,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "订单列表",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Order List" }
                                }
                            },
                            ProgUrl = "/Order/Index",
                            ProgramNodes = new List<GeneralProgNode>
                            {
                                new GeneralProgNode
                                {
                                    Code = "EnableNew",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许新建订单",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow New Order" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                },
                                new GeneralProgNode
                                {
                                    Code = "EnableConfig",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许确认订单",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Confirm Order" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                },
                                new GeneralProgNode
                                {
                                    Code = "EnableArrange",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许排单",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Arrange" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                },
                                new GeneralProgNode
                                {
                                    Code = "EnableClose",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许结算",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Close" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                },
                                new GeneralProgNode
                                {
                                    Code = "EnableCancel",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许取消",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Cancel" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                },
                                new GeneralProgNode
                                {
                                    Code = "EnablePayment",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许收/付款",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Payment" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                },
                                new GeneralProgNode
                                {
                                    Code = "EnableEditAddress",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许编辑地址",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Edit Address" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                },
                                new GeneralProgNode
                                {
                                    Code = "EnableEditPrice",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许编辑价格",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Edit Price" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                }
                            }
                        };
                        GeneralProgram oProgramOrd02 = new GeneralProgram
                        {
                            Code = "OrderConfirm",
                            Parent = oProgramOrd,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "订单确认",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Order Confirm" }
                                }
                            },
                            ProgUrl = "/Order/Confirm",
                            Remark = "跳转到/Order/Index?Confirm=待确认,使用OrderIndex的权限"
                        };
                        GeneralProgram oProgramOrd03 = new GeneralProgram
                        {
                            Code = "OrderPolicy",
                            Parent = oProgramOrd,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "订单策略",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Order Policy" }
                                }
                            },
                            ProgUrl = "/Order/Policy",
                            ProgramNodes = new List<GeneralProgNode>
                            {
                                new GeneralProgNode
                                {
                                    Code = "EnableEdit",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许编辑",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Edit" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                }
                            },
                            Remark = "包括拆单,自动处理等策略"
                        };
                        GeneralProgram oProgramOrd04 = new GeneralProgram
                        {
                            Code = "PromotionIndex",
                            Parent = oProgramOrd,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "促销管理",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Promotion" }
                                }
                            },
                            ProgUrl = "/Promotion/Index"
                        };
                        #endregion

                        #region 承运菜单
                        GeneralProgram oProgramShip = new GeneralProgram
                        {
                            Code = "Shipping",
                            Parent = null,
                            Terminal = false,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "承运",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Shipping" }
                                }
                            },
                            ProgUrl = ""
                        };
                        GeneralProgram oProgramShip01 = new GeneralProgram
                        {
                            Code = "OrganizationShipper",
                            Parent = oProgramShip,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "承运商列表",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Shipper List" }
                                }
                            },
                            ProgUrl = "/Organization/ShippingIndex",
                            ProgramNodes = new List<GeneralProgNode>
                            {
                                new GeneralProgNode
                                {
                                    Code = "EnableEdit",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许编辑",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Edit" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                }
                            }
                        };
                        GeneralProgram oProgramShip02 = new GeneralProgram
                        {
                            Code = "ShippingRegion",
                            Parent = oProgramShip,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "承运商地区",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Shipper Region" }
                                }
                            },
                            ProgUrl = "/Shipping/ShipperRegion",
                            ProgramNodes = new List<GeneralProgNode>
                            {
                                new GeneralProgNode
                                {
                                    Code = "EnableEdit",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许编辑",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Edit" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                }
                            }
                        };
                        GeneralProgram oProgramShip03 = new GeneralProgram
                        {
                            Code = "ShippingIndex",
                            Parent = oProgramShip,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "面单管理",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Shipper Envelope" }
                                }
                            },
                            ProgUrl = "/Shipping/Index",
                            ProgramNodes = new List<GeneralProgNode>
                            {
                                new GeneralProgNode
                                {
                                    Code = "EnableEdit",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许编辑",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Edit" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                }
                            }
                        };
                        #endregion

                        #region 财务菜单
                        GeneralProgram oProgramFin = new GeneralProgram
                        {
                            Code = "Finance",
                            Parent = null,
                            Terminal = false,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "财务",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Finance" }
                                }
                            },
                            ProgUrl = ""
                        };
                        GeneralProgram oProgramFin01 = new GeneralProgram
                        {
                            Code = "FinanceIndex",
                            Parent = oProgramFin,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "付款方式",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Payment Type" }
                                }
                            },
                            ProgUrl = "/Finance/Index",
                            ProgramNodes = new List<GeneralProgNode>
                            {
                                new GeneralProgNode
                                {
                                    Code = "EnableEdit",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许编辑",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Edit" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                }
                            }
                        };
                        GeneralProgram oProgramFin02 = new GeneralProgram
                        {
                            Code = "FinanceInvoice",
                            Parent = oProgramFin,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "发票管理",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Invoice" }
                                }
                            },
                            ProgUrl = "/Finance/Invoice",
                            ProgramNodes = new List<GeneralProgNode>
                            {
                                new GeneralProgNode
                                {
                                    Code = "EnableEdit",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许编辑",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Edit" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                }
                            }
                        };
                        GeneralProgram oProgramFin03 = new GeneralProgram
                        {
                            Code = "FinancePayable",
                            Parent = oProgramFin,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "应付款",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Account Payable" }
                                }
                            },
                            ProgUrl = "/Finance/Payable",
                            ProgramNodes = new List<GeneralProgNode>
                            {
                                new GeneralProgNode
                                {
                                    Code = "EnableEdit",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许编辑",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Edit" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                }
                            }
                        };
                        #endregion

                        #region 商城管理
                        GeneralProgram oProgramMall = new GeneralProgram
                        {
                            Code = "Mall",
                            Parent = null,
                            Terminal = false,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "商城",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Mall" }
                                }
                            },
                            ProgUrl = ""
                        };
                        GeneralProgram oProgramMall01 = new GeneralProgram
                        {
                            Code = "MallIndex",
                            Parent = oProgramMall,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "内容管理",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Mall Content" }
                                }
                            },
                            ProgUrl = "/Mall/Index",
                            Remark = "包括发布",
                            ProgramNodes = new List<GeneralProgNode>
                            {
                                new GeneralProgNode
                                {
                                    Code = "EnableEdit",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许编辑",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Edit" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                }
                            }
                        };
                        GeneralProgram oProgramMall02 = new GeneralProgram
                        {
                            Code = "MallPosition",
                            Parent = oProgramMall,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "位置定义",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Art Position" }
                                }
                            },
                            ProgUrl = "/Mall/Position",
                            ProgramNodes = new List<GeneralProgNode>
                            {
                                new GeneralProgNode
                                {
                                    Code = "EnableEdit",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许编辑",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Edit" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                }
                            }
                        };
                        GeneralProgram oProgramMall03 = new GeneralProgram
                        {
                            Code = "MallSetting",
                            Parent = oProgramMall,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "商城配置",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Mall Setting" }
                                }
                            },
                            ProgUrl = "/Mall/Setting",
                            ProgramNodes = new List<GeneralProgNode>
                            {
                                new GeneralProgNode
                                {
                                    Code = "EnableEdit",
                                    Name = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "允许编辑",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "Allow Edit" }
                                        }
                                    },
                                    InputMode = (byte)ModelEnum.OptionalInputMode.COMBOBOX,
                                    Optional = new GeneralResource
                                    {
                                        Culture = 2052, Matter = "0|否,1|是",
                                        ResourceItems = new List<GeneralResItem>
                                        {
                                            new GeneralResItem { Culture = 1033, Matter = "0|No,1|Yes" }
                                        }
                                    }
                                }
                            },
                            Remark = "包括热门关键词,商品收藏,关注,友情链接,敏感词,黑名单等"
                        };
                        GeneralProgram oProgramMall04 = new GeneralProgram
                        {
                            Code = "MallClick",
                            Parent = oProgramMall,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "点击统计",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Click Statistics" }
                                }
                            },
                            ProgUrl = "/Mall/Click"
                        };
                        #endregion

                        #region 知识
                        GeneralProgram oProgramKnow = new GeneralProgram
                        {
                            Code = "Knowledge",
                            Parent = null,
                            Terminal = false,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "知识",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Knowledge" }
                                }
                            },
                            ProgUrl = ""
                        };
                        #endregion

                        #region 报表集合
                        GeneralProgram oProgramRpt = new GeneralProgram
                        {
                            Code = "Report",
                            Parent = null,
                            Terminal = false,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "报表",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Report" }
                                }
                            },
                            ProgUrl = ""
                        };
                        GeneralProgram oProgramRpt01 = new GeneralProgram
                        {
                            Code = "ReportSales",
                            Parent = oProgramRpt,
                            Terminal = false,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "销售报表",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Sales Report" }
                                }
                            },
                            ProgUrl = ""
                        };
                        GeneralProgram oProgramRpt0101 = new GeneralProgram
                        {
                            Code = "ReportSalesDaily",
                            Parent = oProgramRpt01,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "日销售报表",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Sales Daily Report" }
                                }
                            },
                            ProgUrl = "/Report/Sales/Daily"
                        };
                        GeneralProgram oProgramRpt02 = new GeneralProgram
                        {
                            Code = "ReportWarehouse",
                            Parent = oProgramRpt,
                            Terminal = false,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "库存报表",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Warehouse Report" }
                                }
                            },
                            ProgUrl = "/Report/Warehouse/Analysis"
                        };
                        GeneralProgram oProgramRpt0201 = new GeneralProgram
                        {
                            Code = "ReportWarehouseStock",
                            Parent = oProgramRpt02,
                            Terminal = true,
                            Name = new GeneralResource
                            {
                                Culture = 2052,
                                Matter = "库存分析表",
                                ResourceItems = new List<GeneralResItem>
                                {
                                    new GeneralResItem { Culture = 1033, Matter = "Warehouse Stock" }
                                }
                            },
                            ProgUrl = "/Report/Warehouse/Analysis"
                        };
                        #endregion

                        oLiveEntities.GeneralPrograms.Add(oProgramHome);
                        oLiveEntities.GeneralPrograms.Add(oProgramSys01);
                        oLiveEntities.GeneralPrograms.Add(oProgramSys02);
                        oLiveEntities.GeneralPrograms.Add(oProgramSys03);
                        oLiveEntities.GeneralPrograms.Add(oProgramSys04);
                        oLiveEntities.GeneralPrograms.Add(oProgramSys05);
                        oLiveEntities.GeneralPrograms.Add(oProgramSys06);
                        oLiveEntities.GeneralPrograms.Add(oProgramSys07);
                        oLiveEntities.GeneralPrograms.Add(oProgramSys08);
                        oLiveEntities.GeneralPrograms.Add(oProgramSys11);
                        oLiveEntities.GeneralPrograms.Add(oProgramSys12);
                        oLiveEntities.GeneralPrograms.Add(oProgramSys13);
                        oLiveEntities.GeneralPrograms.Add(oProgramMem01);
                        oLiveEntities.GeneralPrograms.Add(oProgramMem02);
                        oLiveEntities.GeneralPrograms.Add(oProgramMem03);
                        oLiveEntities.GeneralPrograms.Add(oProgramMem04);
                        oLiveEntities.GeneralPrograms.Add(oProgramMem05);
                        oLiveEntities.GeneralPrograms.Add(oProgramMem06);
                        oLiveEntities.GeneralPrograms.Add(oProgramMem07);
                        oLiveEntities.GeneralPrograms.Add(oProgramProd01);
                        oLiveEntities.GeneralPrograms.Add(oProgramProd02);
                        oLiveEntities.GeneralPrograms.Add(oProgramProd03);
                        oLiveEntities.GeneralPrograms.Add(oProgramProd04);
                        oLiveEntities.GeneralPrograms.Add(oProgramProd05);
                        oLiveEntities.GeneralPrograms.Add(oProgramProd06);
                        oLiveEntities.GeneralPrograms.Add(oProgramProd07);
                        oLiveEntities.GeneralPrograms.Add(oProgramPur01);
                        oLiveEntities.GeneralPrograms.Add(oProgramPur02);
                        oLiveEntities.GeneralPrograms.Add(oProgramPur03);
                        oLiveEntities.GeneralPrograms.Add(oProgramWh01);
                        oLiveEntities.GeneralPrograms.Add(oProgramWh02);
                        oLiveEntities.GeneralPrograms.Add(oProgramWh03);
                        oLiveEntities.GeneralPrograms.Add(oProgramWh04);
                        oLiveEntities.GeneralPrograms.Add(oProgramWh05);
                        oLiveEntities.GeneralPrograms.Add(oProgramWh06);
                        oLiveEntities.GeneralPrograms.Add(oProgramWh07);
                        oLiveEntities.GeneralPrograms.Add(oProgramWh08);
                        oLiveEntities.GeneralPrograms.Add(oProgramWh09);
                        oLiveEntities.GeneralPrograms.Add(oProgramOrd01);
                        oLiveEntities.GeneralPrograms.Add(oProgramOrd02);
                        oLiveEntities.GeneralPrograms.Add(oProgramOrd03);
                        oLiveEntities.GeneralPrograms.Add(oProgramOrd04);
                        oLiveEntities.GeneralPrograms.Add(oProgramShip01);
                        oLiveEntities.GeneralPrograms.Add(oProgramShip02);
                        oLiveEntities.GeneralPrograms.Add(oProgramShip03);
                        oLiveEntities.GeneralPrograms.Add(oProgramFin01);
                        oLiveEntities.GeneralPrograms.Add(oProgramFin02);
                        oLiveEntities.GeneralPrograms.Add(oProgramFin03);
                        oLiveEntities.GeneralPrograms.Add(oProgramMall01);
                        oLiveEntities.GeneralPrograms.Add(oProgramMall02);
                        oLiveEntities.GeneralPrograms.Add(oProgramMall03);
                        oLiveEntities.GeneralPrograms.Add(oProgramMall04);
                        oLiveEntities.GeneralPrograms.Add(oProgramKnow);
                        oLiveEntities.GeneralPrograms.Add(oProgramRpt0101);
                        oLiveEntities.GeneralPrograms.Add(oProgramRpt0201);
                        oLiveEntities.SaveChanges();

                        Debug.WriteLine("LiveAzure.Models.General.InitialiseDatabase.RunOnce: GeneralProgram 程序定义");
                        #endregion

                        #region MemberPrivilege 权限(测试用)
                        //用户1程序权限
                        MemberPrivilege oMemberPrivilegeProgram = new MemberPrivilege
                        {
                            User = oTester,
                            Ptype = 0,// 0: 程序
                            PrivilegeItems = new List<MemberPrivItem>
                            {
                                new MemberPrivItem { RefID = oProgramHome.Gid },
                                new MemberPrivItem { RefID = oProgramSys01.Gid },
                                new MemberPrivItem { RefID = oProgramSys02.Gid }
                            }
                        };
                        oLiveEntities.MemberPrivileges.Add(oMemberPrivilegeProgram);
                        oLiveEntities.SaveChanges();

                        Debug.WriteLine("LiveAzure.Models.General.InitialiseDatabase.RunOnce: MemberPrivilege 权限(测试用)");
                        #endregion
                    }
                    // 提交事务,数据库物理写入
                    scope.Complete();
                }
            }
            catch (TransactionAbortedException ex)
            {
                Debug.WriteLine("LiveAzure.Models.General.InitialiseDatabase: TransactionAbortedException Message: {0}", ex.Message);
            }
            catch (ApplicationException ex)
            {
                Debug.WriteLine("LiveAzure.Models.General.InitialiseDatabase: ApplicationException Message: {0}", ex.Message);
            }

            GC.Collect();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 导入组织支持的语言
        /// </summary>
        /// <param name="sExcelFile">Excel文件名</param>
        /// <param name="sSheetName">Sheet名</param>
        public void ImportOrganCultures(string sExcelFile, string sSheetName)
        {
            try
            {
                ExcelData oExcel = new ExcelData(sExcelFile, sSheetName);
                DataColumn colOrgan = oExcel.ExcelTable.Columns["组织"];
                DataColumn colType = oExcel.ExcelTable.Columns["类型"];
                DataColumn colCulture = oExcel.ExcelTable.Columns["语言"];
                DataColumn colCurrency = oExcel.ExcelTable.Columns["货币"];
                DataColumn colRemark = oExcel.ExcelTable.Columns["备注"];
                foreach (DataRow row in oExcel.ExcelTable.Rows)
                {
                    string sOrgan = row[colOrgan].ToString();
                    var oOrgan = (from o in dbEntity.MemberOrganizations
                                  where o.Code == sOrgan && o.Otype == (byte)ModelEnum.OrganizationType.CORPORATION
                                  select o).FirstOrDefault();
                    byte nType;
                    Byte.TryParse(row[colType].ToString(), out nType);
                    Guid gCultureID = Guid.Empty;
                    if (!String.IsNullOrEmpty(row[colCulture].ToString()))
                    {
                        int nCulture = 0;
                        if (Int32.TryParse(row[colCulture].ToString(), out nCulture))
                        {
                            var oCulture = (from u in dbEntity.GeneralCultureUnits
                                            where u.Culture == nCulture
                                            select u).FirstOrDefault();
                            if (oCulture != null) gCultureID = oCulture.Gid;
                        }
                    }
                    Guid gCurrencyID = Guid.Empty;
                    if (!String.IsNullOrEmpty(row[colCurrency].ToString()))
                    {
                        string sCurrency = row[colCurrency].ToString();
                        var oCurrency = (from u in dbEntity.GeneralMeasureUnits
                                         where u.Utype == (byte)ModelEnum.MeasureUnit.CURRENCY && u.Code == sCurrency
                                         select u).FirstOrDefault();
                        if (oCurrency != null) gCurrencyID = oCurrency.Gid;
                    }
                    string sRemark = row[colRemark].ToString();

                    switch ((ModelEnum.CultureType)nType)
                    {
                        case ModelEnum.CultureType.LANGUAGE:
                            var oOrgCulture = (from o in dbEntity.MemberOrgCultures
                                   where o.OrgID == oOrgan.Gid && o.Ctype == nType && o.aCulture == gCultureID
                                   select o).FirstOrDefault();
                            if (oOrgCulture == null)
                            {
                                oOrgCulture = new MemberOrgCulture
                                {
                                    Organization = oOrgan,
                                    Ctype = nType,
                                    aCulture = gCultureID
                                };
                                dbEntity.MemberOrgCultures.Add(oOrgCulture);
                            }
                            oOrgCulture.Remark = sRemark;
                            dbEntity.SaveChanges();
                            break;
                        case ModelEnum.CultureType.CURRENCY:
                            var oOrgCurrency = (from o in dbEntity.MemberOrgCultures
                                   where o.OrgID == oOrgan.Gid && o.Ctype == nType && o.aCurrency == gCurrencyID
                                   select o).FirstOrDefault();
                            if (oOrgCurrency == null)
                            {
                                oOrgCurrency = new MemberOrgCulture
                                {
                                    Organization = oOrgan,
                                    Ctype = nType,
                                    aCurrency = gCurrencyID
                                };
                                dbEntity.MemberOrgCultures.Add(oOrgCurrency);
                            }
                            oOrgCurrency.Remark = sRemark;
                            dbEntity.SaveChanges();
                            break;
                    }
                    if (Utility.ConfigHelper.GlobalConst.IsDebug)
                        Debug.WriteLine("{0} {1} {2} {3}", this.ToString(), sOrgan, nType, sRemark);
                }
                oEventBLL.WriteEvent(String.Format("导入MemberOrgCulture成功: {0} {1}", sExcelFile, sSheetName),
                    ModelEnum.ActionLevel.GENERIC, ModelEnum.ActionSource.SYSTEM, this.ToString());
            }
            catch (Exception ex)
            {
                oEventBLL.WriteEvent(String.Format("导入MemberOrgCulture错误: {0} {1} {2}", sExcelFile, sSheetName, ex.Message),
                    ModelEnum.ActionLevel.ERROR, ModelEnum.ActionSource.SYSTEM, this.ToString());
            }
        }
Ejemplo n.º 4
0
 /// <summary>
 /// 组织的文化/货币 添加页面
 /// </summary>
 /// <param name="ctype"></param>
 /// <returns></returns>
 public ActionResult AddOrgCulturePage(byte ctype)
 {
     if (ctype == (byte)ModelEnum.CultureType.CURRENCY)
     {
         ViewBag.selectList = GetOrgUnitList();
         ViewBag.culturetype = 1;
     }
     else
     {
         ViewBag.selectList = GetOrgCultureList();
         ViewBag.culturetype = 0;
     }
     MemberOrgCulture oOrgCulture = new MemberOrgCulture
     {
         Ctype = ctype
     };
     return PartialView(oOrgCulture);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// 编辑组织文化
 /// </summary>
 /// <param name="oCultureGid"></param>
 /// <returns></returns>
 public ActionResult EditOrgCulturePage(Guid? oCultureGid, Guid? aCulture, Guid? aCurrency)
 {
     MemberOrgCulture oCulture = new MemberOrgCulture();
     if (_isAdding)//添加时 保存到缓存区
     {
         if (aCulture != null)
         {
             oCulture = _listOrganizationCulture.Where(c => c.aCulture == aCulture).FirstOrDefault();
             ViewBag.editCultureName = dbEntity.GeneralCultureUnits.Find(aCulture).CultureName;
         }
         else
         {
             oCulture = _listOrganizationCulture.Where(c => c.aCurrency == aCurrency).FirstOrDefault();
             ViewBag.editCultureName = dbEntity.GeneralMeasureUnits.Find(aCurrency).Name.GetResource(CurrentSession.Culture);
         }
     }
     else
     {
         oCulture = dbEntity.MemberOrgCultures.Include("Culture").Include("Currency").Where(c => c.Gid == oCultureGid).Single();
         ViewBag.editCultureType = oCulture.Ctype;
         if (oCulture.Ctype == (byte)ModelEnum.CultureType.LANGUAGE)
             ViewBag.editCultureName = oCulture.Culture.CultureName;
         else
             ViewBag.editCultureName = oCulture.Currency.Name.GetResource(CurrentSession.Culture);
     }
     return PartialView(oCulture);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// 保存文化/货币到缓存区
 /// </summary>
 /// <param name="oOrgCulture"></param>
 public void SaveNewOrgCulture(MemberOrgCulture oOrgCulture)
 {
     if (_isAdding)//添加时 保存到缓存区
     {
         MemberOrgCulture oOldOrgCulture = null;
         if (oOrgCulture.aCulture != null && oOrgCulture.aCurrency == null)//添加的是语言
             oOldOrgCulture = _listOrganizationCulture.Where(c => c.aCulture == oOrgCulture.aCulture && c.Ctype == oOrgCulture.Ctype).FirstOrDefault();
         else if (oOrgCulture.aCulture == null && oOrgCulture.aCurrency != null)//添加的是货币
             oOldOrgCulture = _listOrganizationCulture.Where(c => c.aCurrency == oOrgCulture.aCurrency && c.Ctype == oOrgCulture.Ctype).FirstOrDefault();
         if (oOldOrgCulture != null)
         {
             oOldOrgCulture.Sorting = oOrgCulture.Sorting;
             oOldOrgCulture.Remark = oOrgCulture.Remark;
         }
         else
         {
             _listOrganizationCulture.Add(oOrgCulture);
         }
     }
     else//编辑时 直接保存到数据库
     {
         MemberOrganization oOrganization = dbEntity.MemberOrganizations.Where(o => o.Gid == gOrgId).Single();
         oOrgCulture.Organization = oOrganization;
         dbEntity.MemberOrgCultures.Add(oOrgCulture);
         dbEntity.SaveChanges();
     }
 }
Ejemplo n.º 7
0
 /// <summary>
 /// 保存所编辑的文化/语言
 /// </summary>
 /// <param name="oOrgCulture"></param>
 public void SaveEditOrgCulture(MemberOrgCulture oOrgCulture)
 {
     MemberOrgCulture oldCulture = new MemberOrgCulture();
     if (_isAdding)
     {
         if (oOrgCulture.aCulture != null)
         {
             oldCulture = _listOrganizationCulture.Where(c => c.aCulture == oOrgCulture.aCulture).FirstOrDefault();
         }
         else
         {
             oldCulture = _listOrganizationCulture.Where(c => c.aCurrency == oOrgCulture.aCurrency).FirstOrDefault();
         }
         if (oldCulture != null)
         {
             oldCulture.Sorting = oOrgCulture.Sorting;
             oldCulture.Remark = oOrgCulture.Remark;
         }
     }
     else
     {
         oldCulture = dbEntity.MemberOrgCultures.Include("Culture").Include("Currency").Where(c => c.Gid == oOrgCulture.Gid).Single();
         if (oldCulture.Ctype == (byte)ModelEnum.CultureType.CURRENCY)
             oldCulture.Culture = oOrgCulture.Culture;
         else
             oldCulture.Currency = oOrgCulture.Currency;
         oldCulture.Sorting = oOrgCulture.Sorting;
         oldCulture.Remark = oOrgCulture.Remark;
         if (ModelState.IsValid)
         {
             dbEntity.Entry(oldCulture).State = EntityState.Modified;
             dbEntity.SaveChanges();
         }
     }
 }
Ejemplo n.º 8
0
 /// <summary>
 /// 删除文化 语言/货币
 /// </summary>
 /// <param name="oCultureGid"></param>
 public void RemoveOrgCulture(Guid? oCultureGid, Guid? aCulture, Guid? aCurrency)
 {
     MemberOrgCulture oOrgCulture = new MemberOrgCulture();
     if (_isAdding)//添加时
     {
         if (aCulture != null)
         {
             oOrgCulture = _listOrganizationCulture.Where(c => c.aCulture == aCulture).FirstOrDefault();
             _listOrganizationCulture.Remove(oOrgCulture);
         }
         else
         {
             oOrgCulture = _listOrganizationCulture.Where(c => c.aCurrency == aCurrency).FirstOrDefault();
             _listOrganizationCulture.Remove(oOrgCulture);
         }
     }
     else//编辑时
     {
         oOrgCulture = dbEntity.MemberOrgCultures.Where(c => c.Gid == oCultureGid).Single();
         oOrgCulture.Deleted = true;
         if (ModelState.IsValid)
         {
             dbEntity.Entry(oOrgCulture).State = EntityState.Modified;
             dbEntity.SaveChanges();
         }
     }
 }