Пример #1
0
        public BOM Copy()
        {
            var model = new BOM();

            model.ID                     = this.ID;
            model.mouldID                = this.mouldID;
            model.partID                 = this.partID;
            model.partName               = this.partName;
            model.partType               = this.partType;
            model.specifications         = this.specifications;
            model.material               = this.material;
            model.number                 = this.number;
            model.unit                   = this.unit;
            model.state                  = this.state;
            model.orderID                = this.orderID;
            model.taskID                 = this.taskID;
            model.outStoreNums           = this.outStoreNums;
            model.createTime             = this.createTime;
            model.modifyTime             = this.modifyTime;
            model.orderState             = this.orderState;
            model.remark                 = this.remark;
            model.rawSpecifications      = this.rawSpecifications;
            model.modifyTimeOfDeal       = this.modifyTimeOfDeal;
            model.dealState              = this.dealState;
            model.isElectrodeImport      = this.isElectrodeImport;
            model.materialID             = this.materialID;
            model.version                = this.version;
            model.isSubmit               = this.isSubmit;
            model.verifyID               = this.verifyID;
            model.attribute1             = this.attribute1;
            model.attribute2             = this.attribute2;
            model.attribute3             = this.attribute3;
            model.attribute4             = this.attribute4;
            model.attribute5             = this.attribute5;
            model.attribute6             = this.attribute6;
            model.attribute7             = this.attribute7;
            model.attribute8             = this.attribute8;
            model.attribute9             = this.attribute9;
            model.attribute10            = this.attribute10;
            model.isImport               = this.isImport;
            model.modifyNumber           = this.modifyNumber;
            model.modifyState            = this.modifyState;
            model.orderDealState         = this.orderDealState;
            model.actualNumber           = this.actualNumber;
            model.bomState               = this.bomState;
            model.rejectReason           = this.rejectReason;
            model.mark                   = this.mark;
            model.spareNumber            = this.spareNumber;
            model.associatedFileID       = this.associatedFileID;
            model.bomAlteration          = this.bomAlteration;
            model.isAlterationInAnalyse  = this.isAlterationInAnalyse;
            model.auditTime              = this.auditTime;
            model.standardNumber         = this.standardNumber;
            model.dataFrom               = this.dataFrom;
            model.inventorysplyTime      = this.inventorysplyTime;
            model.createMan              = this.createMan;
            model.mouldframe             = this.mouldframe;
            model.outsideSupplier        = this.outsideSupplier;
            model.outsideStartTime       = this.outsideStartTime;
            model.requiredCompleteTime   = this.requiredCompleteTime;
            model.expectedCompletionTime = this.expectedCompletionTime;
            model.machiningAttribute     = this.machiningAttribute;
            model.contentsOutsourcing    = this.contentsOutsourcing;
            model.singleWeight           = this.singleWeight;
            model.totalWeight            = this.totalWeight;
            model.certainMaterialID      = this.certainMaterialID;
            model.brandID                = this.brandID;
            model.preCount               = this.preCount;
            model.preHumanID             = this.preHumanID;
            model.preTime                = this.preTime;
            model.preReMark              = this.preReMark;
            model.groupNodeID            = this.groupNodeID;
            model.changesProcurement     = this.changesProcurement;
            model.CenterOrder            = this.CenterOrder;
            model.techStatus             = this.techStatus;
            model.materialStatus         = this.materialStatus;
            model.hasFile                = this.hasFile;
            model.splitOrMerged          = this.splitOrMerged;
            model.uniqueDeleteID         = this.uniqueDeleteID;
            model.dealAlterState         = this.dealAlterState;
            model.referenceProcess       = this.referenceProcess;
            model.spareNum               = this.spareNum;
            return(model);
        }
Пример #2
0
        /// <summary>
        /// 插入BOM
        /// </summary>
        public static void InsertBOM(
            System.Data.IDbConnection conn
            , System.Data.IDbTransaction tran
            , List <EACT_CUPRUM> CupRumList
            , Eman_Mould mouldInfo
            , Human human
            , List <DataAccess.Model.BOM> vil
            )
        {
            int bomOrderID = vil.Count();

            foreach (var item in CupRumList)
            {
                var vi = vil.FirstOrDefault(u => u.verifyID == item.CUPRUMSN);
                if (vi == null)
                {
                    var model = new DataAccess.Model.BOM();
                    model.mouldID           = mouldInfo.mouldID;
                    model.partID            = item.StandardPartNodeID;
                    model.partName          = item.verifyIDName;
                    model.partType          = item.MaterialClass;
                    model.specifications    = item.EDMCONDITIONSN.Replace('x', 'X');
                    model.material          = item.MaterialID;
                    model.unit              = item.StandardStore_Unit;
                    model.number            = item.CUPRUMCOUNT;
                    model.state             = "planStock";
                    model.orderID           = ++bomOrderID;
                    model.createTime        = DateTime.Now;
                    model.orderState        = "needOrderd";
                    model.isElectrodeImport = 1;
                    model.materialID        = item.McfMaterialID;
                    model.isSubmit          = false;
                    model.verifyID          = item.CUPRUMSN;
                    model.dataFrom          = "eact";
                    model.createMan         = human.humanID;
                    model.certainMaterialID = item.CertainMaterialID;
                    model.brandID           = 0;
                    StringBuilder queryParameters = new StringBuilder();
                    queryParameters.Append("@mouldID");
                    queryParameters.Append(", ");
                    queryParameters.Append("@partID");
                    queryParameters.Append(", ");
                    queryParameters.Append("@partName");
                    queryParameters.Append(", ");
                    queryParameters.Append("@partType");
                    queryParameters.Append(", ");
                    queryParameters.Append("@specifications");
                    queryParameters.Append(", ");
                    queryParameters.Append("@material");
                    queryParameters.Append(", ");
                    queryParameters.Append("@number");
                    queryParameters.Append(", ");
                    queryParameters.Append("@unit");
                    queryParameters.Append(", ");
                    queryParameters.Append("@state");
                    queryParameters.Append(", ");
                    queryParameters.Append("@orderID");
                    queryParameters.Append(", ");
                    queryParameters.Append("@createTime");
                    queryParameters.Append(", ");
                    queryParameters.Append("@orderState");
                    queryParameters.Append(", ");
                    queryParameters.Append("@isElectrodeImport");
                    queryParameters.Append(", ");
                    queryParameters.Append("@materialID");
                    queryParameters.Append(", ");
                    queryParameters.Append("@isSubmit");
                    queryParameters.Append(", ");
                    queryParameters.Append("@verifyID");
                    queryParameters.Append(", ");
                    queryParameters.Append("@dataFrom");
                    queryParameters.Append(", ");
                    queryParameters.Append("@createMan");
                    queryParameters.Append(", ");
                    queryParameters.Append("@certainMaterialID");
                    queryParameters.Append(", ");
                    queryParameters.Append("@brandID");

                    string query = String.Format("Insert Into BOM ({0}) Values ({1})", queryParameters.ToString().Replace("@", ""), queryParameters.ToString());
                    conn.Execute(query, model, tran);
                }
            }
        }