public async Task <IActionResult> OnGetAsync(Guid?id) { if (id == null) { return(NotFound()); } CoatSize = await _context.CoatSize.FirstOrDefaultAsync(m => m.Id == id); if (CoatSize == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnPostAsync(Guid?id) { if (id == null) { return(NotFound()); } CoatSize = await _context.CoatSize.FindAsync(id); if (CoatSize != null) { _context.CoatSize.Remove(CoatSize); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
//西服尺码表解析 public static object Ret_Excel(DataTable table) { List <CoatSize> cslist = new List <CoatSize>(); for (int i = 0; i < table.Rows.Count; i++) { decimal ty = 0; CoatSize cs = new CoatSize(); if (decimal.TryParse(table.Rows[i]["Height"] + "", out ty)) { cs.Height = ty; } else { cs.Height = 0; } cs.FrontLength = table.Rows[i]["FrontLength"] + ""; cs.NetBust = table.Rows[i]["NetBust"] + ""; if (decimal.TryParse(table.Rows[i]["FinishedBust"] + "", out ty)) { cs.FinishedBust = ty; } else { cs.FinishedBust = 0; } if (decimal.TryParse(table.Rows[i]["InWaist"] + "", out ty)) { cs.InWaist = ty; } else { cs.InWaist = 0; } if (decimal.TryParse(table.Rows[i]["FinishedHem_NoFork"] + "", out ty)) { cs.FinishedHem_NoFork = ty; } else { cs.FinishedHem_NoFork = 0; } if (decimal.TryParse(table.Rows[i]["FinishedHem_SplitEnds"] + "", out ty)) { cs.FinishedHem_SplitEnds = ty; } else { cs.FinishedHem_NoFork = 0; } if (decimal.TryParse(table.Rows[i]["ShoulderWidth"] + "", out ty)) { cs.ShoulderWidth = ty; } else { cs.ShoulderWidth = 0; } cs.Size_Code = table.Rows[i]["Size_Code"] + ""; cs.Sleecve_Show = table.Rows[i]["FK_Sleeve_ID"] + ""; cslist.Add(cs); } return(cslist); }