// // GET: /MasterData/ public ActionResult Index(clsMasterData model) { List <ClsMasterP> lstmasterp = new List <ClsMasterP>(); clsMasterMethod objmastermethod = new clsMasterMethod(); lstmasterp = objmastermethod.GetALL(); clsMasterData objmasterdata = new clsMasterData(); List <clsMasterData> objmasterdatalst = new List <clsMasterData>(); clsMasterDataMethod objmasterdatamethod = new clsMasterDataMethod(); objmasterdatalst = objmasterdatamethod.GetALL(model.MasterId); objmasterdata.MasterDataList = new List <clsMasterData>(); objmasterdata.MasterDataList.AddRange(objmasterdatalst); // clsMasterData objmasterdata = new clsMasterData(); if (objmasterdata.maserlist == null) { objmasterdata.maserlist = new List <ClsMasterP>(); } objmasterdata.maserlist.AddRange(lstmasterp); return(View(objmasterdata)); }
public ActionResult Create() { //int Compid; //if (ViewBag.id != null) // id = ViewBag.id; ////if (Compid == null) //{ // Compid = 0; //} int id = 0; List <ClsMasterP> lstmasterp = new List <ClsMasterP>(); clsMasterMethod objmastermethod = new clsMasterMethod(); lstmasterp = objmastermethod.GetALL(); clsMasterData objmasterdata = new clsMasterData(); List <clsMasterData> objmasterdatalst = new List <clsMasterData>(); clsMasterDataMethod objmasterdatamethod = new clsMasterDataMethod(); objmasterdatalst = objmasterdatamethod.GetALL(id); objmasterdata.MasterDataList = new List <clsMasterData>(); objmasterdata.MasterDataList.AddRange(objmasterdatalst); // clsMasterData objmasterdata = new clsMasterData(); if (objmasterdata.maserlist == null) { objmasterdata.maserlist = new List <ClsMasterP>(); } objmasterdata.maserlist.AddRange(lstmasterp); if (TempData["Id"] != null) { objmasterdata.MasterId = (int)TempData["Id"]; } else { objmasterdata.MasterId = 0; } ViewBag.Menuid = Request.QueryString["menuId"]; return(View(objmasterdata)); }