/// <summary>
        /// 存储所需修改IssueReceiptD的数据集合的临时表
        /// </summary>
        private IDataEntityType CreateDTmpTable(IQueryService qrySrv)
        {
            string typeName = "Temp_UpdateSalesIssueD_" + DateTime.Now.ToString("HHmmssfff");// 临时表表名的处理
            DependencyObjectType defaultType = new DependencyObjectType(typeName, new Attribute[] { });
            IBusinessTypeService businessSrv = this.GetServiceForThisTypeKey <IBusinessTypeService>();

            #region 字段

            defaultType.RegisterSimpleProperty("item_no", businessSrv.SimpleItemCodeType, string.Empty, false, new Attribute[] { businessSrv.SimpleItemCode });

            defaultType.RegisterSimpleProperty("item_feature_no", businessSrv.SimpleItemFeatureType, string.Empty, false, new Attribute[] { businessSrv.SimpleItemFeature });

            defaultType.RegisterSimpleProperty("picking_unit_no", businessSrv.SimpleUnitCodeType, string.Empty, false, new Attribute[] { businessSrv.SimpleUnitCode });

            defaultType.RegisterSimpleProperty("doc_no", businessSrv.SimpleDocNoType, string.Empty, false, new Attribute[] { businessSrv.SimpleDocNo });

            SimplePropertyAttribute tempAttr = new SimplePropertyAttribute(GeneralDBType.Int32);
            defaultType.RegisterSimpleProperty("seq", typeof(Int32), 0, false, new Attribute[] { tempAttr });

            defaultType.RegisterSimpleProperty("warehouse_no", businessSrv.GetBusinessType("WarehouseCode"), string.Empty, false, new Attribute[] { businessSrv.GetSimplePropertyAttribute("WarehouseCode") });

            defaultType.RegisterSimpleProperty("storage_spaces_no", businessSrv.GetBusinessType("Bin"), string.Empty, false, new Attribute[] { businessSrv.GetSimplePropertyAttribute("Bin") });

            defaultType.RegisterSimpleProperty("lot_no", businessSrv.SimpleLotCodeType, string.Empty, false, new Attribute[] { businessSrv.SimpleLotCode });

            defaultType.RegisterSimpleProperty("picking_qty", businessSrv.SimpleQuantityType, 0M, false, new Attribute[] { businessSrv.SimpleQuantity });

            tempAttr = new SimplePropertyAttribute(GeneralDBType.String, 1000);
            defaultType.RegisterSimpleProperty("barcode_no", typeof(string), string.Empty, false, new Attribute[] { tempAttr });

            #endregion

            qrySrv.CreateTempTable(defaultType);
            return(defaultType);
        }
Exemplo n.º 2
0
        static Customer()
        {
            // DefaultType
            DefaultType = new DependencyObjectType("Customer", new Attribute[] {
                new DataEntityAttribute("ID"),
                new Digiwin.Common.Services.DatabaseDataEntityTypeAttribute()
            });
            // ID
            SimplePropertyAttribute simplePropertyAttribute0 = new SimplePropertyAttribute(GeneralDBType.Guid);

            simplePropertyAttribute0.Description = "PrimaryKey";
            IDProperty = DefaultType.RegisterSimpleProperty("ID", typeof(System.Guid), null, false, new Attribute[] {
                simplePropertyAttribute0
            });
            // CODE
            SimplePropertyAttribute simplePropertyAttribute1 = new SimplePropertyAttribute(GeneralDBType.String);

            simplePropertyAttribute1.Description = "单据类型编号";
            simplePropertyAttribute1.Size        = 10;
            CODEProperty = DefaultType.RegisterSimpleProperty("CODE", typeof(string), null, false, new Attribute[] {
                simplePropertyAttribute1
            });
            // NAME
            SimplePropertyAttribute simplePropertyAttribute2 = new SimplePropertyAttribute(GeneralDBType.String);

            simplePropertyAttribute2.Description = "单据类型名称";
            simplePropertyAttribute2.Size        = 20;
            NAMEProperty = DefaultType.RegisterSimpleProperty("NAME", typeof(string), null, false, new Attribute[] {
                simplePropertyAttribute2
            });
        }
        /// <summary>
        /// 创建临时表#Table_scan_detail
        /// </summary>
        /// <returns></returns>
        private void CreateTempTableScanDetail()
        {
            string tempName = "TEMP_SCAN_DETAIL" + "_" + DateTime.Now.ToString("HHmmssfff");
            DependencyObjectType    defaultType = new DependencyObjectType(tempName, new Attribute[] { });
            SimplePropertyAttribute tempAttr    = new SimplePropertyAttribute(GeneralDBType.String);

            #region 字段
            ////主键
            //defaultType.RegisterSimpleProperty("Table_scan_detail_ID", _businessTypeSrv.SimplePrimaryKeyType,
            //                                   Maths.GuidDefaultValue(), false,
            //                                   new Attribute[] { _businessTypeSrv.SimplePrimaryKey });
            //信息批号
            defaultType.RegisterSimpleProperty("info_lot_no", typeof(string),
                                               string.Empty, false, new Attribute[] { tempAttr });

            // 转入仓库
            defaultType.RegisterSimpleProperty("site_no", typeof(string),
                                               string.Empty, false, new Attribute[] { tempAttr });
            //条码编号
            defaultType.RegisterSimpleProperty("barcode_no", typeof(string),
                                               string.Empty, false, new Attribute[] { tempAttr });

            //料件编号
            defaultType.RegisterSimpleProperty("item_no", _businessTypeSrv.SimpleItemCodeType,
                                               string.Empty, false, new Attribute[] { _businessTypeSrv.SimpleItemCode });

            // 产品特征
            defaultType.RegisterSimpleProperty("item_feature_no", _businessTypeSrv.SimpleItemFeatureType,
                                               string.Empty, false, new Attribute[] { _businessTypeSrv.SimpleItemFeature });

            // 仓库
            defaultType.RegisterSimpleProperty("warehouse_no", typeof(string),
                                               string.Empty, false, new Attribute[] { tempAttr });
            //库位
            defaultType.RegisterSimpleProperty("storage_spaces_no", typeof(string),
                                               string.Empty, false, new Attribute[] { tempAttr });
            //批号
            defaultType.RegisterSimpleProperty("lot_no", _businessTypeSrv.SimpleLotCodeType,
                                               string.Empty, false, new Attribute[] { _businessTypeSrv.SimpleLotCode });
            //拣货数量
            defaultType.RegisterSimpleProperty("picking_qty", _businessTypeSrv.SimpleQuantityType,
                                               0m, false, new Attribute[] { _businessTypeSrv.SimpleQuantity });
            //拣货单位
            defaultType.RegisterSimpleProperty("picking_unit_no", typeof(string), string.Empty, false, new Attribute[] { tempAttr });

            //单号
            defaultType.RegisterSimpleProperty("doc_no", _businessTypeSrv.SimpleDocNoType, string.Empty, false, new Attribute[] { _businessTypeSrv.SimpleDocNo });

            //来源序号
            tempAttr = new SimplePropertyAttribute(GeneralDBType.Int32);
            defaultType.RegisterSimpleProperty("seq", typeof(int), 0, false, new Attribute[] { tempAttr });


            #endregion

            _TEMP_SCAN_DETAIL = defaultType;

            _querySrv.CreateTempTable(defaultType);
        }
Exemplo n.º 4
0
            static BD_ACCOUNTPERIOD()
            {
                object[] attributes = new object[1];
                SimplePropertyAttribute attribute = new SimplePropertyAttribute {
                    Alias = "FMONTH"
                };

                attributes[0] = attribute;
                MONTHProperty = BudgetCalendar.BD_ACCOUNTPERIODType.RegisterSimpleProperty("MONTH", typeof(long), null, false, attributes);
                object[] objArray2 = new object[1];
                SimplePropertyAttribute attribute2 = new SimplePropertyAttribute {
                    Alias = "FPERIOD"
                };

                objArray2[0]   = attribute2;
                PERIODProperty = BudgetCalendar.BD_ACCOUNTPERIODType.RegisterSimpleProperty("PERIOD", typeof(long), null, false, objArray2);
                object[] objArray3 = new object[1];
                SimplePropertyAttribute attribute3 = new SimplePropertyAttribute {
                    Alias = "FPERIODENDDATE"
                };

                objArray3[0]          = attribute3;
                PERIODENDDATEProperty = BudgetCalendar.BD_ACCOUNTPERIODType.RegisterSimpleProperty("PERIODENDDATE", typeof(DateTime?), null, false, objArray3);
                object[] objArray4 = new object[1];
                SimplePropertyAttribute attribute4 = new SimplePropertyAttribute {
                    Alias = "FPERIODSTARTDATE"
                };

                objArray4[0]            = attribute4;
                PERIODSTARTDATEProperty = BudgetCalendar.BD_ACCOUNTPERIODType.RegisterSimpleProperty("PERIODSTARTDATE", typeof(DateTime?), null, false, objArray4);
                object[] objArray5 = new object[1];
                SimplePropertyAttribute attribute5 = new SimplePropertyAttribute {
                    Alias = "FQUARTER"
                };

                objArray5[0]    = attribute5;
                QUARTERProperty = BudgetCalendar.BD_ACCOUNTPERIODType.RegisterSimpleProperty("QUARTER", typeof(long), null, false, objArray5);
                object[] objArray6 = new object[1];
                SimplePropertyAttribute attribute6 = new SimplePropertyAttribute {
                    Alias = "FENTRYSEQ"
                };

                objArray6[0] = attribute6;
                SeqProperty  = BudgetCalendar.BD_ACCOUNTPERIODType.RegisterSimpleProperty("Seq", typeof(int), null, false, objArray6);
                object[] objArray7 = new object[1];
                SimplePropertyAttribute attribute7 = new SimplePropertyAttribute {
                    Alias = "FWEEK"
                };

                objArray7[0] = attribute7;
                WEEKProperty = BudgetCalendar.BD_ACCOUNTPERIODType.RegisterSimpleProperty("WEEK", typeof(long), null, false, objArray7);
                object[] objArray8 = new object[1];
                SimplePropertyAttribute attribute8 = new SimplePropertyAttribute {
                    Alias = "FYEAR"
                };

                objArray8[0] = attribute8;
                YEARProperty = BudgetCalendar.BD_ACCOUNTPERIODType.RegisterSimpleProperty("YEAR", typeof(long), null, false, objArray8);
            }
        /// <summary>
        /// 创建存储传入参数集合的临时表
        /// </summary>
        private void CreateTemp()
        {
            IBusinessTypeService businessSrv = this.GetServiceForThisTypeKey <IBusinessTypeService>();

            string typeName = "Temp_Scan" + DateTime.Now.ToString("HHmmssfff");// 临时表表名的处理
            DependencyObjectType defaultType = new DependencyObjectType(typeName, new Attribute[] { });

            #region 单头
            defaultType.RegisterSimpleProperty("ID", businessSrv.SimplePrimaryKeyType, Maths.GuidDefaultValue(), false, new Attribute[] { businessSrv.SimplePrimaryKey });
            //人员
            defaultType.RegisterSimpleProperty("employee_no", businessSrv.GetBusinessType("BusinessCode"), string.Empty, false, new Attribute[] { businessSrv.GetSimplePropertyAttribute("BusinessCode") });
            SimplePropertyAttribute tempAttr = new SimplePropertyAttribute(GeneralDBType.String);
            tempAttr.Size = 10;
            //部门
            defaultType.RegisterSimpleProperty("picking_department_no", typeof(string), string.Empty, false, new Attribute[] { tempAttr });
            //工厂编号
            defaultType.RegisterSimpleProperty("site_no", businessSrv.GetBusinessType("Factory"), string.Empty, false, new Attribute[] { businessSrv.GetSimplePropertyAttribute("Factory") });
            //信息批号
            tempAttr.Size = 30;
            defaultType.RegisterSimpleProperty("info_lot_no", typeof(string), string.Empty, false, new Attribute[] { tempAttr });
            _tempScan = defaultType;
            _qurService.CreateTempTable(_tempScan);
            #endregion

            typeName    = "Temp_ScanDetail" + DateTime.Now.ToString("HHmmssfff");// 临时表表名的处理
            defaultType = new DependencyObjectType(typeName, new Attribute[] { });
            #region 单身
            defaultType.RegisterSimpleProperty("ID", businessSrv.SimplePrimaryKeyType, Maths.GuidDefaultValue(), false, new Attribute[] { businessSrv.SimplePrimaryKey });
            //信息批号
            tempAttr.Size = 30;
            defaultType.RegisterSimpleProperty("info_lot_no", typeof(string), string.Empty, false, new Attribute[] { tempAttr });
            //序号
            tempAttr = new SimplePropertyAttribute(GeneralDBType.Int32);
            defaultType.RegisterSimpleProperty("SequenceNumber", typeof(Int32), 0, false, new Attribute[] { tempAttr });
            //品号
            defaultType.RegisterSimpleProperty("item_no", businessSrv.GetBusinessType("ItemCode"), string.Empty, false, new Attribute[] { businessSrv.GetSimplePropertyAttribute("ItemCode") });
            //特征码
            defaultType.RegisterSimpleProperty("item_feature_no", businessSrv.GetBusinessType("ItemFeature"), string.Empty, false, new Attribute[] { businessSrv.GetSimplePropertyAttribute("ItemFeature") });
            //单位
            defaultType.RegisterSimpleProperty("picking_unit_no", businessSrv.GetBusinessType("UnitCode"), string.Empty, false, new Attribute[] { businessSrv.GetSimplePropertyAttribute("UnitCode") });
            //仓库
            defaultType.RegisterSimpleProperty("warehouse_no", businessSrv.GetBusinessType("WarehouseCode"), string.Empty, false, new Attribute[] { businessSrv.GetSimplePropertyAttribute("WarehouseCode") });
            //库位
            defaultType.RegisterSimpleProperty("storage_spaces_no", businessSrv.GetBusinessType("Bin"), string.Empty, false, new Attribute[] { businessSrv.GetSimplePropertyAttribute("Bin") });
            //批号
            defaultType.RegisterSimpleProperty("lot_no", businessSrv.GetBusinessType("LotCode"), string.Empty, false, new Attribute[] { businessSrv.GetSimplePropertyAttribute("LotCode") });
            //拣货数量
            defaultType.RegisterSimpleProperty("picking_qty", businessSrv.GetBusinessType("Quantity"), 0M, false, new Attribute[] { businessSrv.GetSimplePropertyAttribute("Quantity") });
            //条码编号
            tempAttr      = new SimplePropertyAttribute(GeneralDBType.String);
            tempAttr.Size = 1000;
            defaultType.RegisterSimpleProperty("barcode_no", typeof(string), string.Empty, false, new Attribute[] { tempAttr });
            _tempScanDetail = defaultType;
            _qurService.CreateTempTable(_tempScanDetail);
            #endregion
        }
Exemplo n.º 6
0
        private void CreateTempTable()
        {
            IBusinessTypeService businessTypeSrv = GetServiceForThisTypeKey <IBusinessTypeService>();

            #region 单头临时表
            string tempName = "Table_scan" + "_" + DateTime.Now.ToString("HHmmssfff");
            DependencyObjectType    defaultType = new DependencyObjectType(tempName, new Attribute[] { null });
            SimplePropertyAttribute tempAttr    = new SimplePropertyAttribute(GeneralDBType.String);
            #region 字段
            //营运据点
            defaultType.RegisterSimpleProperty("site_no", typeof(string),
                                               string.Empty, false, new Attribute[] { tempAttr });
            //条码编号
            defaultType.RegisterSimpleProperty("barcode_no", typeof(string),
                                               string.Empty, false, new Attribute[] { tempAttr });
            //料件编号
            defaultType.RegisterSimpleProperty("item_no", businessTypeSrv.GetBusinessType("ItemCode"),
                                               string.Empty, false, new Attribute[] { businessTypeSrv.GetSimplePropertyAttribute("ItemCode") });
            //产品特征
            defaultType.RegisterSimpleProperty("item_feature_no", businessTypeSrv.GetBusinessType("ItemFeature"),
                                               string.Empty, false, new Attribute[] { businessTypeSrv.GetSimplePropertyAttribute("ItemFeature") });
            //库位编号
            defaultType.RegisterSimpleProperty("warehouse_no", businessTypeSrv.GetBusinessType("WarehouseCode"),
                                               string.Empty, false, new Attribute[] { businessTypeSrv.GetSimplePropertyAttribute("WarehouseCode") });
            //储位编号
            defaultType.RegisterSimpleProperty("storage_spaces_no", businessTypeSrv.GetBusinessType("Bin"),
                                               string.Empty, false, new Attribute[] { businessTypeSrv.GetSimplePropertyAttribute("Bin") });
            //批号
            defaultType.RegisterSimpleProperty("lot_no", businessTypeSrv.GetBusinessType("LotCode"),
                                               string.Empty, false, new Attribute[] { businessTypeSrv.GetSimplePropertyAttribute("LotCode") });
            //盘点数量
            defaultType.RegisterSimpleProperty("qty", businessTypeSrv.GetBusinessType("Quantity"),
                                               0M, false, new Attribute[] { businessTypeSrv.GetSimplePropertyAttribute("Quantity") });
            //盘点人员
            defaultType.RegisterSimpleProperty("employee_no", businessTypeSrv.GetBusinessType("BusinessCode"),
                                               string.Empty, false, new Attribute[] { businessTypeSrv.GetSimplePropertyAttribute("BusinessCode") });
            //盘点日期
            defaultType.RegisterSimpleProperty("complete_date", typeof(DateTime),
                                               OrmDataOption.EmptyDateTime, false, new Attribute[] { new SimplePropertyAttribute(GeneralDBType.Date) });
            //交易对象类型
            defaultType.RegisterSimpleProperty("transaction_type", typeof(string),
                                               string.Empty, false, new Attribute[] { tempAttr });
            tempAttr.Size = 10;
            //交易对象编号
            defaultType.RegisterSimpleProperty("transaction_no", typeof(string),
                                               string.Empty, false, new Attribute[] { tempAttr });
            #endregion
            _Table_scan = defaultType;
            _qurService.CreateTempTable(_Table_scan);
            #endregion
        }
Exemplo n.º 7
0
            static User()
            {
                object[] attributes = new object[1];
                SimplePropertyAttribute attribute = new SimplePropertyAttribute {
                    Alias = "FNAME"
                };

                attributes[0] = attribute;
                NameProperty  = BudgetCalendar.UserType.RegisterSimpleProperty("Name", typeof(string), null, false, attributes);
                object[] objArray2 = new object[1];
                SimplePropertyAttribute attribute2 = new SimplePropertyAttribute {
                    Alias = "FUSERACCOUNT"
                };

                objArray2[0]        = attribute2;
                UserAccountProperty = BudgetCalendar.UserType.RegisterSimpleProperty("UserAccount", typeof(string), null, false, objArray2);
            }
Exemplo n.º 8
0
        /// <summary>
        /// 存储所需修改IssueReceiptD的数据集合的临时表
        /// </summary>
        private IDataEntityType CreateIssueReceiptDTmpTable(IQueryService qrySrv)
        {
            string typeName = "Temp_UpdateIssueReceiptD_" + DateTime.Now.ToString("HHmmssfff");// 临时表表名的处理
            DependencyObjectType defaultType = new DependencyObjectType(typeName, new Attribute[] { });

            IBusinessTypeService    businessSrv        = this.GetServiceForThisTypeKey <IBusinessTypeService>();
            SimplePropertyAttribute simplePrimaryAttri = businessSrv.SimplePrimaryKey;
            SimplePropertyAttribute qtyAttri           = businessSrv.SimpleQuantity;
            SimplePropertyAttribute tempAttr;

            #region 字段
            //单号
            tempAttr = new SimplePropertyAttribute(GeneralDBType.String);
            defaultType.RegisterSimpleProperty("DOC_NO", typeof(string), string.Empty, false, new Attribute[] { tempAttr });
            //序号
            tempAttr = new SimplePropertyAttribute(GeneralDBType.Int32);
            defaultType.RegisterSimpleProperty("SequenceNumber", typeof(int), 0, false, new Attribute[] { tempAttr });
            //拣货数量  //该数量等价于规格中的picking_qty
            defaultType.RegisterSimpleProperty("ISSUE_RECEIPT_QTY", businessSrv.SimpleQuantityType, 0m, false, new Attribute[] { qtyAttri });
            //工厂编号
            tempAttr = new SimplePropertyAttribute(GeneralDBType.String);
            defaultType.RegisterSimpleProperty("PLANT_CODE", typeof(string), string.Empty, false, new Attribute[] { tempAttr });
            //品号
            defaultType.RegisterSimpleProperty("ITEM_CODE", businessSrv.SimpleItemCodeType, "", false, new Attribute[] { businessSrv.SimpleItemCode });
            //特征码
            defaultType.RegisterSimpleProperty("ITEM_FEATURE_CODE", businessSrv.SimpleItemFeatureType, "", false, new Attribute[] { businessSrv.SimpleItemFeature });
            tempAttr = new SimplePropertyAttribute(GeneralDBType.String);
            //单位编号
            defaultType.RegisterSimpleProperty("UNIT_CODE", typeof(string), "", false, new Attribute[] { tempAttr });
            //仓库编号
            defaultType.RegisterSimpleProperty("WAREHOUSE_CODE", typeof(string), "", false, new Attribute[] { tempAttr });
            //库位编号
            defaultType.RegisterSimpleProperty("BIN_CODE", typeof(string), "", false, new Attribute[] { tempAttr });
            //批号
            defaultType.RegisterSimpleProperty("LOT_CODE", businessSrv.SimpleLotCodeType, "", false, new Attribute[] { businessSrv.SimpleLotCode });
            //条码
            defaultType.RegisterSimpleProperty("BARCODE_NO", typeof(string), "", false, new Attribute[] { tempAttr });
            #endregion

            qrySrv.CreateTempTable(defaultType);

            return(defaultType);
        }
Exemplo n.º 9
0
            static ORMBD_ACCOUN()
            {
                object[] attributes = new object[1];
                SimplePropertyAttribute attribute = new SimplePropertyAttribute {
                    Alias = "FENDDATE"
                };

                attributes[0]   = attribute;
                ENDDATEProperty = BudgetCalendar.ORMBD_ACCOUNType.RegisterSimpleProperty("ENDDATE", typeof(DateTime?), null, false, attributes);
                object[] objArray2 = new object[1];
                SimplePropertyAttribute attribute2 = new SimplePropertyAttribute(true)
                {
                    Alias = "FID"
                };

                objArray2[0] = attribute2;
                IdProperty   = BudgetCalendar.ORMBD_ACCOUNType.RegisterSimpleProperty("Id", typeof(long), null, false, objArray2);
                object[] objArray3 = new object[1];
                SimplePropertyAttribute attribute3 = new SimplePropertyAttribute {
                    Alias = "FPERIODCOUNT"
                };

                objArray3[0]        = attribute3;
                PeriodCountProperty = BudgetCalendar.ORMBD_ACCOUNType.RegisterSimpleProperty("PeriodCount", typeof(long), null, false, objArray3);
                object[] objArray4 = new object[1];
                SimplePropertyAttribute attribute4 = new SimplePropertyAttribute {
                    Alias = "FPERIODTYPE"
                };

                objArray4[0]       = attribute4;
                PERIODTYPEProperty = BudgetCalendar.ORMBD_ACCOUNType.RegisterSimpleProperty("PERIODTYPE", typeof(string), null, false, objArray4);
                object[] objArray5 = new object[1];
                SimplePropertyAttribute attribute5 = new SimplePropertyAttribute {
                    Alias = "FSTARTDATE"
                };

                objArray5[0]      = attribute5;
                STARTDATEProperty = BudgetCalendar.ORMBD_ACCOUNType.RegisterSimpleProperty("STARTDATE", typeof(DateTime?), null, false, objArray5);
            }
Exemplo n.º 10
0
            static BudgetPeriodEntity()
            {
                object[] attributes = new object[1];
                SimplePropertyAttribute attribute = new SimplePropertyAttribute {
                    Alias = "FPERIOD"
                };

                attributes[0]  = attribute;
                PeriodProperty = BudgetCalendar.BudgetPeriodEntityType.RegisterSimpleProperty("Period", typeof(long), null, false, attributes);
                object[] objArray2 = new object[1];
                SimplePropertyAttribute attribute2 = new SimplePropertyAttribute {
                    Alias = "FPERIODENDDATE"
                };

                objArray2[0]          = attribute2;
                PeriodEndDateProperty = BudgetCalendar.BudgetPeriodEntityType.RegisterSimpleProperty("PeriodEndDate", typeof(DateTime?), null, false, objArray2);
                object[] objArray3 = new object[2];
                SimplePropertyAttribute attribute3 = new SimplePropertyAttribute {
                    Alias = "FPERIODNAME"
                };

                objArray3[0]       = attribute3;
                objArray3[1]       = new DbIgnoreAttribute();
                PeriodNameProperty = BudgetCalendar.BudgetPeriodEntityType.RegisterSimpleProperty("PeriodName", typeof(LocaleValue), null, false, objArray3);
                object[] objArray4 = new object[1];
                SimplePropertyAttribute attribute4 = new SimplePropertyAttribute {
                    Alias = "FPERIODNUMBER"
                };

                objArray4[0]         = attribute4;
                PeriodNumberProperty = BudgetCalendar.BudgetPeriodEntityType.RegisterSimpleProperty("PeriodNumber", typeof(string), null, false, objArray4);
                object[] objArray5 = new object[1];
                SimplePropertyAttribute attribute5 = new SimplePropertyAttribute {
                    Alias = "FPERIODSTARTDATE"
                };

                objArray5[0]            = attribute5;
                PeriodStartDateProperty = BudgetCalendar.BudgetPeriodEntityType.RegisterSimpleProperty("PeriodStartDate", typeof(DateTime?), null, false, objArray5);
                object[] objArray6 = new object[1];
                SimplePropertyAttribute attribute6 = new SimplePropertyAttribute {
                    Alias = "FPERIODTYPE"
                };

                objArray6[0]       = attribute6;
                PeriodTypeProperty = BudgetCalendar.BudgetPeriodEntityType.RegisterSimpleProperty("PeriodType", typeof(string), null, false, objArray6);
                object[] objArray7 = new object[1];
                SimplePropertyAttribute attribute7 = new SimplePropertyAttribute {
                    Alias = "FPERIODYEAR"
                };

                objArray7[0]       = attribute7;
                PeriodYearProperty = BudgetCalendar.BudgetPeriodEntityType.RegisterSimpleProperty("PeriodYear", typeof(long), null, false, objArray7);
                object[] objArray8 = new object[1];
                SimplePropertyAttribute attribute8 = new SimplePropertyAttribute {
                    Alias = "FROWID"
                };

                objArray8[0]  = attribute8;
                RowIDProperty = BudgetCalendar.BudgetPeriodEntityType.RegisterSimpleProperty("RowID", typeof(string), null, false, objArray8);
                object[] objArray9 = new object[1];
                SimplePropertyAttribute attribute9 = new SimplePropertyAttribute {
                    Alias = "FROWPARENTID"
                };

                objArray9[0]        = attribute9;
                RowParentIdProperty = BudgetCalendar.BudgetPeriodEntityType.RegisterSimpleProperty("RowParentId", typeof(string), null, false, objArray9);
                object[] objArray10 = new object[1];
                SimplePropertyAttribute attribute10 = new SimplePropertyAttribute {
                    Alias = "FROWTYPE"
                };

                objArray10[0]   = attribute10;
                RowTypeProperty = BudgetCalendar.BudgetPeriodEntityType.RegisterSimpleProperty("RowType", typeof(string), null, false, objArray10);
            }
Exemplo n.º 11
0
        static BudgetCalendar()
        {
            object[] attributes = new object[1];
            DataEntityTypeAttribute attribute = new DataEntityTypeAttribute {
                Alias = "T_BM_BUDGETCALENDAR"
            };

            attributes[0]         = attribute;
            BM_BUDGETCALENDARType = new DynamicObjectType("BM_BUDGETCALENDAR", NameNumberView.NameNumberViewType, null, DataEntityTypeFlag.Class, attributes);
            object[] objArray2 = new object[1];
            DataEntityTypeAttribute attribute2 = new DataEntityTypeAttribute {
                Alias = "T_BD_ACCOUNTPERIOD"
            };

            objArray2[0]         = attribute2;
            BD_ACCOUNTPERIODType = new DynamicObjectType("BD_ACCOUNTPERIOD", IdView.IdViewType, null, DataEntityTypeFlag.Class, objArray2);
            object[] objArray3 = new object[1];
            DataEntityTypeAttribute attribute3 = new DataEntityTypeAttribute {
                Alias = "T_BM_BUDGETPERIOD"
            };

            objArray3[0]           = attribute3;
            BudgetPeriodEntityType = new DynamicObjectType("BudgetPeriodEntity", IdView.IdViewType, null, DataEntityTypeFlag.Class, objArray3);
            object[] objArray4 = new object[1];
            DataEntityTypeAttribute attribute4 = new DataEntityTypeAttribute {
                Alias = "T_BD_ACCOUNTCALENDAR"
            };

            objArray4[0]     = attribute4;
            ORMBD_ACCOUNType = new DynamicObjectType("ORMBD_ACCOUN", NameNumberMasterIdView.NameNumberMasterIdViewType, null, DataEntityTypeFlag.Class, objArray4);
            object[] objArray5 = new object[1];
            DataEntityTypeAttribute attribute5 = new DataEntityTypeAttribute {
                Alias = "T_SEC_user"
            };

            objArray5[0] = attribute5;
            UserType     = new DynamicObjectType("User", IdView.IdViewType, null, DataEntityTypeFlag.Class, objArray5);
            ACIdProperty = BM_BUDGETCALENDARType.RegisterComplexProperty("ACId", ORMBD_ACCOUNType, false, new object[] { new DbIgnoreAttribute() });
            object[] objArray7 = new object[1];
            SimplePropertyAttribute attribute6 = new SimplePropertyAttribute {
                Alias = "FACID"
            };

            objArray7[0]       = attribute6;
            ACId_IdProperty    = BM_BUDGETCALENDARType.RegisterSimpleProperty("ACId_Id", typeof(long), null, false, objArray7);
            AouditorIdProperty = BM_BUDGETCALENDARType.RegisterComplexProperty("AouditorId", UserType, false, new object[] { new DbIgnoreAttribute() });
            object[] objArray9 = new object[1];
            SimplePropertyAttribute attribute7 = new SimplePropertyAttribute {
                Alias = "FAUDITORID"
            };

            objArray9[0]          = attribute7;
            AouditorId_IdProperty = BM_BUDGETCALENDARType.RegisterSimpleProperty("AouditorId_Id", typeof(long), null, false, objArray9);
            object[] objArray10 = new object[1];
            SimplePropertyAttribute attribute8 = new SimplePropertyAttribute {
                Alias = "FAUDITDATE"
            };

            objArray10[0]     = attribute8;
            AuditDateProperty = BM_BUDGETCALENDARType.RegisterSimpleProperty("AuditDate", typeof(DateTime?), null, false, objArray10);
            object[] objArray11 = new object[1];
            SimplePropertyAttribute attribute9 = new SimplePropertyAttribute {
                Alias = "FBUDGETCALENDARTYPE"
            };

            objArray11[0] = attribute9;
            BudgetCalendarTypeProperty     = BM_BUDGETCALENDARType.RegisterSimpleProperty("BudgetCalendarType", typeof(string), null, false, objArray11);
            BudgetPeriodEntityListProperty = BM_BUDGETCALENDARType.RegisterCollectionProperty("BudgetPeriodEntity", BudgetPeriodEntityType, null, new object[0]);
            object[] objArray12 = new object[1];
            SimplePropertyAttribute attribute10 = new SimplePropertyAttribute {
                Alias = "FCREATEDATE"
            };

            objArray12[0]      = attribute10;
            CreateDateProperty = BM_BUDGETCALENDARType.RegisterSimpleProperty("CreateDate", typeof(DateTime?), null, false, objArray12);
            CreatorIdProperty  = BM_BUDGETCALENDARType.RegisterComplexProperty("CreatorId", UserType, false, new object[] { new DbIgnoreAttribute() });
            object[] objArray14 = new object[1];
            SimplePropertyAttribute attribute11 = new SimplePropertyAttribute {
                Alias = "FCREATORID"
            };

            objArray14[0]        = attribute11;
            CreatorId_IdProperty = BM_BUDGETCALENDARType.RegisterSimpleProperty("CreatorId_Id", typeof(long), null, false, objArray14);
            object[] objArray15 = new object[1];
            SimplePropertyAttribute attribute12 = new SimplePropertyAttribute {
                Alias = "FCYCLESELECTTYPE"
            };

            objArray15[0]           = attribute12;
            CycleSelectTypeProperty = BM_BUDGETCALENDARType.RegisterSimpleProperty("CycleSelectType", typeof(string), null, false, objArray15);
            object[] objArray16 = new object[1];
            SimplePropertyAttribute attribute13 = new SimplePropertyAttribute {
                Alias  = "FDAYS",
                DbType = DbType.StringFixedLength
            };

            objArray16[0] = attribute13;
            DAYSProperty  = BM_BUDGETCALENDARType.RegisterSimpleProperty("DAYS", typeof(bool), null, false, objArray16);
            object[] objArray17 = new object[2];
            SimplePropertyAttribute attribute14 = new SimplePropertyAttribute {
                Alias = "FDESCRIPTION"
            };

            objArray17[0]       = attribute14;
            objArray17[1]       = new DbIgnoreAttribute();
            DescriptionProperty = BM_BUDGETCALENDARType.RegisterSimpleProperty("Description", typeof(LocaleValue), null, false, objArray17);
            object[] objArray18 = new object[1];
            SimplePropertyAttribute attribute15 = new SimplePropertyAttribute {
                Alias = "FDOCUMENTSTATUS"
            };

            objArray18[0]          = attribute15;
            DocumentStatusProperty = BM_BUDGETCALENDARType.RegisterSimpleProperty("DocumentStatus", typeof(string), null, false, objArray18);
            object[] objArray19 = new object[1];
            SimplePropertyAttribute attribute16 = new SimplePropertyAttribute {
                Alias = "FENDDATE"
            };

            objArray19[0]   = attribute16;
            EndDateProperty = BM_BUDGETCALENDARType.RegisterSimpleProperty("EndDate", typeof(DateTime?), null, false, objArray19);
            object[] objArray20 = new object[1];
            SimplePropertyAttribute attribute17 = new SimplePropertyAttribute {
                Alias = "FMODIFYDATE"
            };

            objArray20[0]       = attribute17;
            FModifyDateProperty = BM_BUDGETCALENDARType.RegisterSimpleProperty("FModifyDate", typeof(DateTime?), null, false, objArray20);
            object[] objArray21 = new object[1];
            SimplePropertyAttribute attribute18 = new SimplePropertyAttribute {
                Alias = "FFORBIDDATE"
            };

            objArray21[0]       = attribute18;
            ForbidDateProperty  = BM_BUDGETCALENDARType.RegisterSimpleProperty("ForbidDate", typeof(DateTime?), null, false, objArray21);
            ForbidderIdProperty = BM_BUDGETCALENDARType.RegisterComplexProperty("ForbidderId", UserType, false, new object[] { new DbIgnoreAttribute() });
            object[] objArray23 = new object[1];
            SimplePropertyAttribute attribute19 = new SimplePropertyAttribute {
                Alias = "FFORBIDDERID"
            };

            objArray23[0]          = attribute19;
            ForbidderId_IdProperty = BM_BUDGETCALENDARType.RegisterSimpleProperty("ForbidderId_Id", typeof(long), null, false, objArray23);
            object[] objArray24 = new object[1];
            SimplePropertyAttribute attribute20 = new SimplePropertyAttribute {
                Alias = "FFORBIDSTATUS"
            };

            objArray24[0]        = attribute20;
            ForbidStatusProperty = BM_BUDGETCALENDARType.RegisterSimpleProperty("ForbidStatus", typeof(string), null, false, objArray24);
            object[] objArray25 = new object[1];
            SimplePropertyAttribute attribute21 = new SimplePropertyAttribute {
                Alias  = "FHALFOFYEAR",
                DbType = DbType.StringFixedLength
            };

            objArray25[0]      = attribute21;
            HALFOFYEARProperty = BM_BUDGETCALENDARType.RegisterSimpleProperty("HALFOFYEAR", typeof(bool), null, false, objArray25);
            object[] objArray26 = new object[1];
            SimplePropertyAttribute attribute22 = new SimplePropertyAttribute(true)
            {
                Alias = "FID"
            };

            objArray26[0]      = attribute22;
            IdProperty         = BM_BUDGETCALENDARType.RegisterSimpleProperty("Id", typeof(long), null, false, objArray26);
            ModifierIdProperty = BM_BUDGETCALENDARType.RegisterComplexProperty("ModifierId", UserType, false, new object[] { new DbIgnoreAttribute() });
            object[] objArray28 = new object[1];
            SimplePropertyAttribute attribute23 = new SimplePropertyAttribute {
                Alias = "FMODIFIERID"
            };

            objArray28[0]         = attribute23;
            ModifierId_IdProperty = BM_BUDGETCALENDARType.RegisterSimpleProperty("ModifierId_Id", typeof(long), null, false, objArray28);
            object[] objArray29 = new object[1];
            SimplePropertyAttribute attribute24 = new SimplePropertyAttribute {
                Alias  = "FMONTH",
                DbType = DbType.StringFixedLength
            };

            objArray29[0] = attribute24;
            MONTHProperty = BM_BUDGETCALENDARType.RegisterSimpleProperty("MONTH", typeof(bool), null, false, objArray29);
            object[] objArray30 = new object[1];
            SimplePropertyAttribute attribute25 = new SimplePropertyAttribute {
                Alias  = "FSEASON",
                DbType = DbType.StringFixedLength
            };

            objArray30[0]  = attribute25;
            SEASONProperty = BM_BUDGETCALENDARType.RegisterSimpleProperty("SEASON", typeof(bool), null, false, objArray30);
            object[] objArray31 = new object[1];
            SimplePropertyAttribute attribute26 = new SimplePropertyAttribute {
                Alias = "FSTARTDATE"
            };

            objArray31[0]     = attribute26;
            StartDateProperty = BM_BUDGETCALENDARType.RegisterSimpleProperty("StartDate", typeof(DateTime?), null, false, objArray31);
            object[] objArray32 = new object[1];
            SimplePropertyAttribute attribute27 = new SimplePropertyAttribute {
                Alias  = "FTENDAYS",
                DbType = DbType.StringFixedLength
            };

            objArray32[0]   = attribute27;
            TENDAYSProperty = BM_BUDGETCALENDARType.RegisterSimpleProperty("TENDAYS", typeof(bool), null, false, objArray32);
            attributes      = new object[1];
            SimplePropertyAttribute attribute28 = new SimplePropertyAttribute {
                Alias  = "FWEEKS",
                DbType = DbType.StringFixedLength
            };

            attributes[0] = attribute28;
            WEEKSProperty = BM_BUDGETCALENDARType.RegisterSimpleProperty("WEEKS", typeof(bool), null, false, attributes);
            attributes    = new object[1];
            SimplePropertyAttribute attribute29 = new SimplePropertyAttribute {
                Alias  = "FYEAR",
                DbType = DbType.StringFixedLength
            };

            attributes[0] = attribute29;
            YearProperty  = BM_BUDGETCALENDARType.RegisterSimpleProperty("Year", typeof(bool), null, false, attributes);
        }
Exemplo n.º 12
0
Arquivo: Tools.cs Projeto: Ocun/VSTool
        /// <summary>
        /// 手动指定列名、类型 注册临时表
        /// </summary>
        /// <param name="businessTypeSrv"></param>
        /// <param name="formType"></param>
        /// <param name="targetType"></param>
        /// <returns></returns>
        public DependencyObjectType RegiesterType(
            List <RegiesterTypeParameter> formType, DependencyObjectType targetType)
        {
            if (targetType == null)
            {
                string tempTableName = "tmpYC_" + DateTime.Now.ToString("yyyyMMddHHmmssfff");
                targetType = new DependencyObjectType(tempTableName, new Attribute[] {});
            }
            IBusinessTypeService businessTypeSrv =
                Provider.GetService(typeof(IBusinessTypeService), CallContext.TypeKey) as IBusinessTypeService;
            SimplePropertyAttribute stringAttr = new SimplePropertyAttribute(GeneralDBType.String);
            SimplePropertyAttribute dtAttr     = new SimplePropertyAttribute(GeneralDBType.DateTime);
            SimplePropertyAttribute IntAttr    = new SimplePropertyAttribute(GeneralDBType.Int32);

            if (formType == null)
            {
                return(null);
            }

            formType.ToList().ForEach(prop => {
                Type prop_type = prop.Type;
                var prop_names = prop.Properties;
                foreach (var prop_name in prop_names)
                {
                    string typeName = prop_type.ToString();
                    var isExist     = targetType.Properties.FirstOrDefault(p => p.Name.Equals(prop_name));
                    if (isExist != null)
                    {
                        continue;
                    }
                    if (prop_name.EndsWith("_ID"))
                    {
                        targetType.RegisterSimpleProperty(prop_name, businessTypeSrv.SimplePrimaryKeyType,
                                                          Guid.Empty, false, new Attribute[] {
                            businessTypeSrv.SimplePrimaryKey
                        });
                    }
                    else if (prop_name.Equals("REMARK"))
                    {
                        targetType.RegisterSimpleProperty(prop_name, businessTypeSrv.SimpleRemarkType,
                                                          string.Empty, false, new Attribute[] {
                            businessTypeSrv.SimpleRemark
                        });
                    }
                    else
                    {
                        switch (typeName)
                        {
                        case "System.String":
                            targetType.RegisterSimpleProperty(prop_name, prop_type,
                                                              string.Empty, false, new Attribute[] { stringAttr });
                            break;

                        case "System.DateTime":
                            targetType.RegisterSimpleProperty(prop_name, prop_type,
                                                              OrmDataOption.EmptyDateTime, false, new Attribute[] { dtAttr });
                            break;

                        case "System.Int16":     //整型
                        case "System.Int32":
                        case "System.Int64":
                            targetType.RegisterSimpleProperty(prop_name, prop_type,
                                                              0, false, new Attribute[] { IntAttr });
                            break;

                        case "System.Decimal":     //浮点型
                        case "System.Double":
                            targetType.RegisterSimpleProperty(prop_name, businessTypeSrv.SimpleQuantityType,
                                                              0m, false, new Attribute[] { businessTypeSrv.SimpleQuantity });
                            break;

                        default:
                            targetType.RegisterSimpleProperty(prop_name, prop_type,
                                                              null, false, new Attribute[] {});
                            break;
                        }
                    }
                }
                ;
            });

            return(targetType);
        }
Exemplo n.º 13
0
Arquivo: Tools.cs Projeto: Ocun/VSTool
        //参考标准MO
        /// <summary>
        ///  根据DependencyObjectType创建簡單临时表结构
        /// </summary>
        /// <param name="formType">DependencyObject屬性</param>
        /// <param name="targetType"></param>
        /// <returns></returns>
        public DependencyObjectType RegiesterType(
            DependencyObjectType formType, DependencyObjectType targetType)
        {
            IBusinessTypeService businessTypeSrv =
                Provider.GetService(typeof(IBusinessTypeService), CallContext.TypeKey) as IBusinessTypeService;
            SimplePropertyAttribute stringAttr = new SimplePropertyAttribute(GeneralDBType.String);
            SimplePropertyAttribute dtAttr     = new SimplePropertyAttribute(GeneralDBType.DateTime);
            SimplePropertyAttribute IntAttr    = new SimplePropertyAttribute(GeneralDBType.Int32);

            if (targetType == null)
            {
                string tempTableName = "tmpYC_" + DateTime.Now.ToString("yyyyMMddHHmmssfff");
                targetType = new DependencyObjectType(tempTableName, new Attribute[] {});
            }

            if (formType == null)
            {
                return(null);
            }
            foreach (var prop in formType.Properties)
            {
                //临时表字段名不可大于30个字符,不是处理方式,后续补充
                string prop_name = prop.Name.Length > 30 ? prop.Name.Substring(0, 29) : prop.Name;


                var isExist = targetType.Properties.FirstOrDefault(p => p.Name.Equals(prop_name));
                if (isExist != null)
                {
                    continue;
                }
                //過濾管理字段 //批量插入有影响
                string[] cnames =
                {
                    "Version",
                    "CreateDate",    "LastModifiedDate",  "ModifiedDate",  "CreateBy",
                    "LastModifiedBy","ModifiedBy",        "ApproveStatus", "ApproveDate", "ApproveBy"
                };
                if (cnames.Contains(prop_name))
                {
                    continue;
                }

                Type prop_type = prop.PropertyType;

                if (prop_type == typeof(DependencyObject) ||
                    prop_type == typeof(DependencyObjectCollection))
                {
                    // 本次个案需要
                    try {
                        var flag = prop is IComplexProperty;
                        if (flag)
                        {
                            if (((IComplexProperty)(prop)).DataEntityType.Name == "ReferToEntity")
                            {
                                var cpropies = ((IComplexProperty)(prop)).DataEntityType.SimpleProperties;

                                if (cpropies != null)
                                {
                                    var existRTK =
                                        cpropies.ToList()
                                        .FirstOrDefault(
                                            cprop => cprop.Name.Equals("ROid") || cprop.Name.Equals("RTK"));
                                    if (existRTK != null)
                                    {
                                        string rtk_name  = prop_name + "_RTK";
                                        string roid_name = prop_name + "_ROid";
                                        targetType.RegisterSimpleProperty(rtk_name, typeof(string),
                                                                          string.Empty, false, new Attribute[] {
                                            stringAttr
                                        });

                                        targetType.RegisterSimpleProperty(roid_name,
                                                                          businessTypeSrv.SimplePrimaryKeyType,
                                                                          null, false, new Attribute[] {
                                            businessTypeSrv.SimplePrimaryKey
                                        });
                                    }
                                }
                            }
                        }
                    }
                    catch {
                    }
                }

                else if (prop_name.StartsWith("UDF"))
                {
                    continue;
                }

                else
                {
                    object DEFv = prop.DefaultValue;

                    if (prop_name.EndsWith("_ID"))
                    {
                        targetType.RegisterSimpleProperty(prop_name, businessTypeSrv.SimplePrimaryKeyType,
                                                          DEFv, false, new Attribute[] {
                            businessTypeSrv.SimplePrimaryKey
                        });
                    }
                    else if (prop_name.Equals("REMARK"))
                    {
                        targetType.RegisterSimpleProperty(prop_name, businessTypeSrv.SimpleRemarkType,
                                                          DEFv, false, new Attribute[] {
                            businessTypeSrv.SimpleRemark
                        });
                    }
                    else
                    {
                        string typeName = prop_type.ToString();
                        switch (typeName)
                        {
                        case "System.String":
                            targetType.RegisterSimpleProperty(prop_name, prop_type,
                                                              DEFv, false, new Attribute[] { stringAttr });
                            break;

                        case "System.DateTime":
                            targetType.RegisterSimpleProperty(prop_name, prop_type,
                                                              DEFv, false, new Attribute[] { dtAttr });
                            break;

                        case "System.Int16":     //整型
                        case "System.Int32":
                        case "System.Int64":
                            targetType.RegisterSimpleProperty(prop_name, prop_type,
                                                              DEFv, false, new Attribute[] { IntAttr });
                            break;

                        case "System.Decimal":     //浮点型
                        case "System.Double":
                            targetType.RegisterSimpleProperty(prop_name, businessTypeSrv.SimpleQuantityType,
                                                              DEFv, false, new Attribute[] { businessTypeSrv.SimpleQuantity });
                            break;

                        default:
                            targetType.RegisterSimpleProperty(prop_name, prop_type,
                                                              DEFv, false, new Attribute[] {});
                            break;
                        }
                    }
                }
            }
            return(targetType);
        }