コード例 #1
0
        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);
        }
コード例 #2
0
 public JsonResult GetTypePenaltyRatewithPartID()
 {
     DropDownListsRepository modelRepo = new DropDownListsRepository();
      int PartID = 1;
      var PenaltyRate = modelRepo.GetPenaltyRate().FindAll(f => f.PartID == PartID);
      return Json(PenaltyRate, JsonRequestBehavior.AllowGet);
 }
コード例 #3
0
        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);
        }