private static Part CreatePart() { Part part = new Part { PartCode = "001", Available = true, CycleCountLevel = new CycleCountLevel { LevelID = 1 }, CycleCountTimes = 0, PartCategory = new PartCategory { CategoryID = 1 }, PartChineseName = "测试零件", PartEnglishName = "test part", PartGroup = new PartGroup { GroupID = 1 }, PartStatus = new PartStatus { StatusID = 6 }, Plant = new Plant { PlantID = 6 }, Supplier = new Supplier { SupplierID = 2 }, WorkLocation = "test location" }; PartSegment ps = new PartSegment { Segment = new Segment { SegmentID = 2 //, //SegmentCode = "Chassis", //SegmentName = "总装底盘工段", //Available = true }, Part = part }; PartSegment ps1 = new PartSegment { Segment = new Segment { SegmentID = 3 //, //SegmentCode = "T/C", //SegmentName = "总装内饰/底盘工段", //Available = true }, Part = part }; part.PartSegments.Add(ps); part.PartSegments.Add(ps1); return(part); }
public void AddRelationTest() { PartSegmentBLL target = new PartSegmentBLL(); // TODO: Initialize to an appropriate value PartSegment relation = null; // TODO: Initialize to an appropriate value ECountContext outerContext = null; // TODO: Initialize to an appropriate value bool saveChanges = false; // TODO: Initialize to an appropriate value target.AddRelation(relation, saveChanges); Assert.Inconclusive("A method that does not return a value cannot be verified."); }
private Part getPartFilter() { Part model = new Part(); if (!string.IsNullOrEmpty(this.txtPartCode.Text)) { model.PartCode = this.txtPartCode.Text.Trim(); } if (!string.IsNullOrEmpty(this.txtPartChineseName.Text)) { model.PartChineseName = this.txtPartChineseName.Text.Trim(); } //if (!string.IsNullOrEmpty(this.txtUpdateBy.Text)) //{ // model.UpdateBy = int.Parse(this.txtUpdateBy.Text.Trim());//get user id by userName //} if (!string.IsNullOrEmpty(this.txtSpecs.Text)) { model.Specs = this.txtSpecs.Text.Trim(); } if (!string.IsNullOrEmpty(this.txtWorkLocation.Text)) { model.WorkLocation = this.txtWorkLocation.Text.Trim(); } if (!string.IsNullOrEmpty(this.txtFollowUp.Text)) { model.FollowUp = this.txtFollowUp.Text.Trim(); } if (!string.IsNullOrEmpty(this.ddlPlantID.SelectedValue)) { model.Plant = new Plant(); model.Plant.PlantID = int.Parse(this.ddlPlantID.SelectedValue); //model.Plant.PlantCode = this.ddlPlantID.SelectedItem.Text; } PartSegment ps = new PartSegment(); if (this.ddlWorkshopID.SelectedValue.Length > 0) { ps.Segment = new Segment(); ps.Segment.Workshop = new Workshop(); ps.Segment.Workshop.WorkshopID = int.Parse(this.ddlWorkshopID.SelectedValue); } if (this.ddlSegmentID.SelectedValue.Length > 0) { if (ps.Segment == null) { ps.Segment = new Segment(); } ps.Segment.SegmentID = int.Parse(this.ddlSegmentID.SelectedValue); } //if (this.ddlSegmentID.SelectedValue.Length > 0 || this.ddlWorkshopID.SelectedValue.Length > 0) //{ // model.PartSegments.Add(ps); //} model.PartStatus = new PartStatus(); if (this.ddlPartStatus.SelectedValue.Length > 0) { model.PartStatus.StatusID = int.Parse(this.ddlPartStatus.SelectedValue); //model.PartStatus.StatusName = this.ddlPartStatus.SelectedItem.Text; } else { model.PartStatus = null; } model.Supplier = new Supplier(); if (!string.IsNullOrEmpty(this.txtDUNS.Text)) { model.Supplier.DUNS = this.txtDUNS.Text.Trim(); } else { model.Supplier = null; } model.PartCategory = new PartCategory(); if (!string.IsNullOrEmpty(this.ddlCategoryID.SelectedValue)) { model.PartCategory.CategoryID = int.Parse(this.ddlCategoryID.SelectedValue.Trim()); } else { model.PartCategory = null; } model.CycleCountLevel = new CycleCountLevel(); if (!string.IsNullOrEmpty(this.ddlCycleCountLevel.SelectedValue)) { model.CycleCountLevel.LevelID = int.Parse(this.ddlCycleCountLevel.SelectedValue.Trim()); } else { model.CycleCountLevel = null; } return(model); }