Esempio n. 1
0
        public JsonResult Insignia(int?draw, int?start, int?length, List <Dictionary <string, string> > order, List <Dictionary <string, string> > columns)
        {
            var search        = Request["search[value]"];
            var dir           = order[0]["dir"].ToLower();
            var column        = columns[int.Parse(order[0]["column"])]["data"];
            var dataTableData = new InsigniaRepository().GetPage(search, draw, start, length, dir, column);

            return(Json(dataTableData, JsonRequestBehavior.AllowGet));
        }
Esempio n. 2
0
        public ActionResult InsigniaDetail(int?id)
        {
            InsigniaViewModel model = new InsigniaViewModel();

            if (id.HasValue)
            {
                model = new InsigniaRepository().GetByID((int)id);
            }
            return(PartialView("_Insignia", model));
        }
Esempio n. 3
0
        public JsonResult SaveInsignia(InsigniaViewModel model)
        {
            ResponseData result = new Models.ResponseData();

            if (model.InsID != 0)
            {
                result = new InsigniaRepository().UpdateByEntity(model);
            }
            else
            {
                result = new InsigniaRepository().AddByEntity(model);
            }

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Esempio n. 4
0
        public JsonResult DeleteInsignia(int id)
        {
            var result = new InsigniaRepository().RemoveByID(id);

            return(Json(result, JsonRequestBehavior.AllowGet));
        }