Exemplo n.º 1
0
        public ActionResult CreateEdit(PemasokViewModel model)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    if (PemasokDataAccess.Update(model))
                    {
                        return(Json(new { success = true, message = "Succes" }, JsonRequestBehavior.AllowGet));
                    }
                    else
                    {
                        return(Json(new { success = false, message = PemasokDataAccess.Message }, JsonRequestBehavior.AllowGet));
                    }
                }
                else
                {
                    return(Json(new { success = false, message = "Pelase full fill required fields" }, JsonRequestBehavior.AllowGet));
                }
            }
            catch (Exception ex)
            {
                return(Json(new { success = false, message = ex.Message }, JsonRequestBehavior.AllowGet));

                {
                }
            }
        }
Exemplo n.º 2
0
 public ActionResult DeleteConfirm(int id)
 {
     if (PemasokDataAccess.Delete(id))
     {
         return(Json(new { success = true, message = "Success" }, JsonRequestBehavior.AllowGet));
     }
     else
     {
         return(Json(new { success = false, message = "Error" }, JsonRequestBehavior.AllowGet));
     }
 }
Exemplo n.º 3
0
 public ActionResult Delete(int id)
 {
     return(View(PemasokDataAccess.GetById(id)));
 }
Exemplo n.º 4
0
 public ActionResult List()
 {
     return(View(PemasokDataAccess.GetAll()));
 }