コード例 #1
0
 public ActionResult Edit(int id, Models.InforMation info)
 {
     try
     {
         Models.InfoDBHandle idb = new Models.InfoDBHandle();
         idb.UpdateInformation(info);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
コード例 #2
0
        public ActionResult Create(Models.InforMation info)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    Models.InfoDBHandle idb = new Models.InfoDBHandle();
                    idb.AddInformation(info);

                    return(RedirectToAction("Index"));
                }
                ViewBag.Message = " Details Added Successfully";
                return(View());
            }
            catch
            {
                return(View());
            }
        }