public ActionResult GetGRDataforReturnddl(int id) { ReqList li = new ReqList(); DataSet ds = li.Show_GRdataforrdddl(id); List <ProcureVM> list = new List <ProcureVM>(); foreach (DataRow dr in ds.Tables[0].Rows) { list.Add(new ProcureVM { ItemId = Convert.ToInt32(dr["ItemId"]), ItemName = dr["ItemName"].ToString() }); } return(Json(list, JsonRequestBehavior.AllowGet)); }
public ActionResult GetGRDataforReturnddlforrdm(int id) { var checkStatusofGr = obj.GetDoc().Where(x => x.DocumentNo == id && x.DocStatus == "Open").FirstOrDefault(); if (checkStatusofGr != null) { ReqList li = new ReqList(); DataSet ds = li.Show_GRdataforrdmddl(id); List <ProcureVM> list = new List <ProcureVM>(); foreach (DataRow dr in ds.Tables[0].Rows) { list.Add(new ProcureVM { ItemId = Convert.ToInt32(dr["ItemId"]), ItemName = dr["ItemName"].ToString() }); } return(Json(list, JsonRequestBehavior.AllowGet)); } else { ReqList li = new ReqList(); DataSet ds = li.Show_GRdataforrdddl(id); List <ProcureVM> list = new List <ProcureVM>(); foreach (DataRow dr in ds.Tables[0].Rows) { list.Add(new ProcureVM { ItemId = Convert.ToInt32(dr["ItemId"]), ItemName = dr["ItemName"].ToString() }); } return(Json(list, JsonRequestBehavior.AllowGet)); } }