示例#1
0
        public ActionResult Delete(GstMaster model)
        {
            model.Action = "Delete";
            model.UserId = UserId;

            GstMasterService.ManageGstMaster(model);
            Success("GstMaster deleted successfully.", true);
            return(RedirectToAction("Index", new { id = model.GstMasterId }));
        }
示例#2
0
        public ActionResult Delete(int id)
        {
            var model = new GstMaster()
            {
                Action      = "Get",
                UserId      = UserId,
                GstMasterId = id
            };

            model = GstMasterService.ManageGstMaster(model).FirstOrDefault();
            return(View(model));
        }
示例#3
0
 public ActionResult Edit(GstMaster model, string SelctedPermissionIds)
 {
     if (ModelState.IsValid)
     {
         model.Action = "Edit";
         model.UserId = UserId;
         GstMasterService.ManageGstMaster(model);
         Success(string.Format("GstMaster '{0}' updated successfully.", model.GstNumber), true);
         return(RedirectToAction("Details", new { id = model.GstMasterId }));
     }
     return(View(model));
 }
示例#4
0
 public ActionResult Create(GstMaster model)
 {
     if (ModelState.IsValid)
     {
         model.Action      = "Add";
         model.UserId      = UserId;
         model.GstMasterId = GstMasterService.ManageGstMaster(model).FirstOrDefault().GstMasterId;
         Success(string.Format("GstMaster '{0}' created successfully.", model.GstNumber), true);
         return(RedirectToAction("Details", new { id = model.GstMasterId }));
     }
     return(View());
 }
示例#5
0
        public ActionResult Details(int?id)
        {
            var model = new GstMaster()
            {
                Action      = "Get",
                UserId      = UserId,
                GstMasterId = Convert.ToInt32(id)
            };

            model = GstMasterService.ManageGstMaster(model).FirstOrDefault();

            return(View(model));
        }
示例#6
0
        Pager <GstMaster> GetData(GstMaster model)
        {
            int totalCount = 0;

            model.Action = "Get";
            model.UserId = UserId;

            var list = GstMasterService.ManageGstMaster(model);

            if (model != null && list.Count() > 0)
            {
                totalCount = list.First().TotalCount;
            }

            Pager <GstMaster> pagedList = new Pager <GstMaster>(list.ToList().AsQueryable(), model.PageNo, model.PageSize, totalCount);

            return(pagedList);
        }