예제 #1
0
        public ActionResult Create(ClsMasterP model)
        {
            clsMasterMethod objMaster = new clsMasterMethod();

            objMaster.Insert(model);
            return(RedirectToAction("Create", new { @menuId = model.Viewbagidformenu }));
        }
예제 #2
0
        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());
        }
예제 #3
0
        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);
        }
예제 #4
0
        public int Insert(ClsMasterP model)
        {
            Mapper.CreateMap <ClsMasterP, Master>();
            Master objMaster = Mapper.Map <Master>(model);

            dbContext.Masters.Add(objMaster);
            return(dbContext.SaveChanges());
        }
예제 #5
0
        public ActionResult Edit(ClsMasterP model)
        {
            ClsMasterP      objmasterp  = new ClsMasterP();
            clsMasterMethod objmasterme = new clsMasterMethod();

            objmasterme.Update(model);
            return(RedirectToAction("Create", new { @menuId = model.Viewbagidformenu }));
        }
예제 #6
0
        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));
        }
예제 #7
0
        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));
        }