public PartialViewResult IC() { Session["MnfsCount"] = null; CDTEntities db = new CDTEntities(); ICComposite ic = new ICComposite(); return PartialView("_ICPartial", ic); }
public PartialViewResult ICCreate(ICComposite icVM) { if(ModelState.IsValid) { _createBAL=new createBAL(); ICComposite get = _createBAL.iccrete(icVM); } return PartialView("_ICAllShow", icVM); }
public ICComposite iccrete(ICComposite icVM) { try { using (var db = new CDTEntities()) { IC ic = new IC() { BOM_Number = icVM.ICMain.BOM_Number, BU = icVM.ICMain.BU, Product_line = icVM.ICMain.Product_line, Site = icVM.ICMain.Site, Thermo_Number = icVM.ICMain.Thermo_Number, Item_Description = icVM.ICMain.Item_Description, Category = icVM.ICMain.Category, Part = icVM.ICMain.Part, Part_Type = icVM.ICMain.Part_Type, Technology = icVM.ICMain.Technology, Supply_Voltage = icVM.ICMain.Supply_Voltage, Memory___organisation = icVM.ICMain.Memory___organisation, Memory___access_Time = icVM.ICMain.Memory___access_Time, Mouting = icVM.ICMain.Mouting, Package = icVM.ICMain.Package, Lead_Spacing_Inch_ = icVM.ICMain.Lead_Spacing_Inch_, No___of_pins = icVM.ICMain.No___of_pins, Operating__Temperature = icVM.ICMain.Operating__Temperature, ICMnfs = GetICMnfs(icVM) }; db.ICs.Add(ic); db.SaveChanges(); return icVM; }; } catch (DbEntityValidationException e) { foreach (var eve in e.EntityValidationErrors) { Console.WriteLine("Entity of type \"{0}\" in state \"{1}\" has the following validation errors:", eve.Entry.Entity.GetType().Name, eve.Entry.State); foreach (var ve in eve.ValidationErrors) { Console.WriteLine("- Property: \"{0}\", Error: \"{1}\"", ve.PropertyName, ve.ErrorMessage); } } return icVM; } }
public Collection<ICMnf> GetICMnfs(ICComposite icVM) { Collection<ICMnf> icVMs = new Collection<ICMnf>(); foreach (var item in icVM.ICMainMnf) { icVMs.Add(new ICMnf() { Mfr__Name = item.Mfr__Name, Mfr__Part_Number = item.Mfr__Part_Number, Part_Status = item.Part_Status, RoHS_Status = item.RoHS_Status, Comments = item.Comments, Type = item.Type }); } return icVMs; }
public PartialViewResult ICMnfsPartial() { if (Session["MnfsCount"] == null) { Session["MnfsCount"] = 1; } else { Session["MnfsCount"] = Convert.ToInt16(Session["MnfsCount"]) + 1; } ICComposite icMnfs = new ICComposite(); return PartialView("_ICMnfsPartial", icMnfs); }