public ActionResult Create(VehicleType_Model MyModel) { if (string.IsNullOrEmpty(MyModel.ID) || Convert.ToInt32(MyModel.ID) == 0) { if (MyTravel_Repository.ManageEntity(MyModel, "Post")) { TempData["Notification"] = Notification_Component.SetNotification((int)Notification_Component.Result.Success, "Data Inserted Successfully!"); } else { TempData["Notification"] = Notification_Component.SetNotification((int)Notification_Component.Result.Info, "Data not Inserted!"); } } else { if (MyTravel_Repository.ManageEntity(MyModel, "Put")) { TempData["Notification"] = Notification_Component.SetNotification((int)Notification_Component.Result.Success, "Data Updated Successfully!"); } else { TempData["Notification"] = Notification_Component.SetNotification((int)Notification_Component.Result.Info, "Data not Updated!"); } } return(RedirectToAction("Index")); }
public ActionResult Login(Login_Model MyModel) { Login_DTO MyLogin_DTO = MyRepository.AuthenticationUser(MyModel); if (MyLogin_DTO != null && MyLogin_DTO.Result.StartsWith("success")) { MyLogin_DTO.Result = MyLogin_DTO.Result.Replace("success:", ""); SessionComponent.UID = MyLogin_DTO.ID; SessionComponent.UName = MyLogin_DTO.vName; SessionComponent.SessionID = Session.SessionID; return(RedirectToAction("Index", "Travel")); } else if (MyLogin_DTO != null && MyLogin_DTO.Result.StartsWith("fail")) { MyLogin_DTO.Result = MyLogin_DTO.Result.Replace("fail:", ""); TempData["msg"] = MyLogin_DTO.Result; TempData["Notification"] = Notification_Component.SetNotification((int)Notification_Component.Result.Info, MyLogin_DTO.Result); return(RedirectToAction("Login")); } else { TempData["msg"] = "Invalid credentials,Please try again!"; TempData["Notification"] = Notification_Component.SetNotification((int)Notification_Component.Result.Info, "Invalid credentials,Please try again!"); return(RedirectToAction("Login")); // TempData["Notification"] = Notification_Component.SetNotification((int)Notification_Component.Result.Info, "Invalid credentials,Please try again!"); } }
public ActionResult Delete(string id) { if (MyTravel_Repository.ManageEntity(new VehicleType_Model { ID = id }, "Delete")) { TempData["Notification"] = Notification_Component.SetNotification((int)Notification_Component.Result.Success, "Data Inserted Successfully!"); } else { TempData["Notification"] = Notification_Component.SetNotification((int)Notification_Component.Result.Info, "Data not Inserted!"); } return(RedirectToAction("Index")); }