public ActionResult AllotmentDetails(int id) { AllotementDetailModel model = new AllotementDetailModel(); model.AllotmentDetailList = pro.GetAllotmentsDetails(id); return(View(model)); }
public ActionResult AllotmentDetails(AllotementDetailModel model) { string s = ""; s = proA.Update(model.AllotmentDetailList); if (s != "") { TempData["message"] = s; return(RedirectToAction("AllotmentDetails")); } return(RedirectToAction("AllotmentMaster")); }
public ActionResult AllotmentReport(int id) { EHMSEntities ent = new EHMSEntities(); AllotementDetailModel model = new AllotementDetailModel(); model.AllotmentDetailList = pro.GetAllotmentsDetails(id); model.Remarks = ent.ItemAllotmentMasters.Where(x => x.ItemAllotmentMasterID == id).SingleOrDefault().ItemAllotmentNo; foreach (var item in model.AllotmentDetailList) { try { item.QuantityRemained = (from am in ent.ItemAllotmentMasters join dd in ent.ItemDemandDetails on am.ItemDemandID equals dd.ItemDemandID where am.ItemAllotmentMasterID == id where dd.ItemID == item.ItemID select dd).SingleOrDefault().QuantityDemand; } catch { item.QuantityRemained = 0; } } return(View(model)); }