コード例 #1
0
 public static TradmarkEntity ToDto(TradmarkModel model)
 {
     return(new TradmarkEntity
     {
         TrdID = model.TrdID,
         TrdName = model.TrdName
     });
 }
コード例 #2
0
 public ActionResult DeleteTradmark(TradmarkModel model)
 {
     if (Session["S_EmpID"] != null && Session["S_EmpFname"] != null)
     {
         var result = _tradRepository.DeleteTradmark(model.TrdID);
         return(RedirectToAction("ListTradmark"));
     }
     else
     {
         return(RedirectToAction("Login2", "Account"));
     }
 }
コード例 #3
0
 public ActionResult TradmarkCreate(TradmarkModel model)
 {
     if (Session["S_EmpID"] != null && Session["S_EmpFname"] != null)
     {
         if (ModelState.IsValid)
         {
             _tradRepository.InsertTradmark(Mapper.ToDto(model));
             ViewBag.StatusMessage = "Success";
             return(RedirectToAction("ListTradmark"));
         }
         ModelState.AddModelError("", "Please complete the following information !");
         return(View());
     }
     else
     {
         return(RedirectToAction("Login2", "Account"));
     }
 }
コード例 #4
0
 public ActionResult EditTradmark(TradmarkModel model)
 {
     if (Session["S_EmpID"] != null && Session["S_EmpFname"] != null)
     {
         if (ModelState.IsValid)
         {
             if (_tradRepository.UpdateTradmark(Mapper.ToDto(model)) == true)
             {
                 return(RedirectToAction("ListTradmark"));
             }
         }
         return(View(model));
     }
     else
     {
         return(RedirectToAction("Login2", "Account"));
     }
 }