public ActionResult Create(ClsMasterP model) { clsMasterMethod objMaster = new clsMasterMethod(); objMaster.Insert(model); return(RedirectToAction("Create", new { @menuId = model.Viewbagidformenu })); }
public List <ClsMasterP> BindGrid() { clsMasterMethod objclsmethod = new clsMasterMethod(); List <ClsMasterP> objMaster = objclsmethod.GetALL(); return(objMaster); }
// // 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 Edit(ClsMasterP model) { ClsMasterP objmasterp = new ClsMasterP(); clsMasterMethod objmasterme = new clsMasterMethod(); objmasterme.Update(model); return(RedirectToAction("Create", new { @menuId = model.Viewbagidformenu })); }
public ActionResult Edit(int id) { clsMasterMethod objmethod = new clsMasterMethod(); ClsMasterP objmaster = new ClsMasterP(); objmaster = objmethod.GetById(id); List <ClsMasterP> lstmasterp = new List <ClsMasterP>(); objmaster.MasterList = new List <ClsMasterP>(); objmaster.MasterList.AddRange(lstmasterp); ViewBag.Menuid = Request.QueryString["menuId"]; return(View(objmaster)); }
public ActionResult Edit(int Id) { clsMasterDataMethod objmethod = new clsMasterDataMethod(); clsMasterData objmasterdata = objmethod.GetById(Id); List <ClsMasterP> lstmasterp = new List <ClsMasterP>(); clsMasterMethod objmastermethod = new clsMasterMethod(); lstmasterp = objmastermethod.GetALL(); if (objmasterdata.maserlist == null) { objmasterdata.maserlist = new List <ClsMasterP>(); } objmasterdata.maserlist.AddRange(lstmasterp); ViewBag.Menuid = Request.QueryString["menuId"]; 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)); }