Exemplo n.º 1
0
        public ActionResult Action(tblSupport objSubmit)
        {
            if (objSubmit.ID == 0)
            {
                objSubmit.DateCreated = DateTime.Now;
                objSubmit.DateUpdated = DateTime.Now;
                objSubmit.IsDeleted   = false;
                objSubmit.IsShow      = true;
                supportRepository.Add(objSubmit);
            }
            else
            {
                var obj = supportRepository.GetById <tblSupport>(objSubmit.ID);

                UpdateModel(obj);

                objSubmit.DateUpdated = DateTime.Now;

                supportRepository.Update(obj);
            }

            return(Json(new
            {
                Error = false
            }, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 2
0
        public Support GetSupport(int id)
        {
            var support = _supportRepository.GetById(id);

            return(support);
        }