Example #1
0
        public ActionResult GetReturnDataforGRddl(int id)
        {
            var checkstatus = obj.GetDoc().Where(x => x.DocumentNo == id && x.Status == "Partial Delivery").FirstOrDefault();

            if (checkstatus != null)
            {
                ReqList          li   = new ReqList();
                DataSet          ds   = li.Show_returniteminddlPartial(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_returniteminddl(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));
            }
        }