public JsonResult GetPenaltyRate() { DropDownListsRepository model = new DropDownListsRepository(); return Json(model.GetPenaltyRate().OrderBy(o => o.Name).Select(c => new { PenaultyRateID = c.ID, PenaultyRate = c.Name }).OrderBy(o => o.PenaultyRate), JsonRequestBehavior.AllowGet); }
public JsonResult GetTypePenaltyRatewithPartID() { DropDownListsRepository modelRepo = new DropDownListsRepository(); int PartID = 1; var PenaltyRate = modelRepo.GetPenaltyRate().FindAll(f => f.PartID == PartID); return Json(PenaltyRate, JsonRequestBehavior.AllowGet); }
public static SelectList GetPenaltyRatedropdown(int PenaltyRateTypeID) { if(PenaltyRateTypeID==0) { PenaltyRateTypeID = 1; } DropDownListsRepository modelRepo = new DropDownListsRepository(); var penaltyrate = modelRepo.GetPenaltyRate(); List<SelectListItem> _Listpenaltrate = new List<SelectListItem>(); foreach (var item in penaltyrate) { SelectListItem itr = new SelectListItem(); itr.Text = item.Name; itr.Value = item.ID.ToString(); itr.Selected = false; _Listpenaltrate.Add(itr); } return new SelectList(_Listpenaltrate, "Value", "Text", PenaltyRateTypeID); }