public ActionResult Create(ClsMasterP model) { clsMasterMethod objMaster = new clsMasterMethod(); objMaster.Insert(model); return(RedirectToAction("Create", new { @menuId = model.Viewbagidformenu })); }
public int Update(ClsMasterP model) { Mapper.CreateMap <ClsMasterP, Master>(); Master objmaster = dbContext.Masters.SingleOrDefault(m => m.MId == model.MId); objmaster = Mapper.Map(model, objmaster); return(dbContext.SaveChanges()); }
public ClsMasterP GetById(int id) { Mapper.CreateMap <Master, ClsMasterP>(); Master objmaster = dbContext.Masters.SingleOrDefault(m => m.MId == id); ClsMasterP objmasterp = Mapper.Map <ClsMasterP>(objmaster); return(objmasterp); }
public int Insert(ClsMasterP model) { Mapper.CreateMap <ClsMasterP, Master>(); Master objMaster = Mapper.Map <Master>(model); dbContext.Masters.Add(objMaster); return(dbContext.SaveChanges()); }
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 Create() { List <ClsMasterP> lstmasterp = new List <ClsMasterP>(); List <clsMasterMethod> objMasterMethod = new List <clsMasterMethod>(); lstmasterp = BindGrid(); ClsMasterP objmast = new ClsMasterP(); objmast.MasterList = new List <ClsMasterP>(); objmast.MasterList.AddRange(lstmasterp); ViewBag.Menuid = Request.QueryString["menuId"]; return(View(objmast)); }