internal void ReturnAlertMessagToView(Enums.CrudStatus status) { if (status == Enums.CrudStatus.Deleted) { SetAlertMessage(Resource.DataDeleted, Enums.AlertType.success); } else if (status == Enums.CrudStatus.Inserted) { SetAlertMessage(Resource.DataSaved, Enums.AlertType.success); } else if (status == Enums.CrudStatus.Updated) { SetAlertMessage(Resource.DataUpdated, Enums.AlertType.success); } else if (status == Enums.CrudStatus.AlreadyExistForSameShop) { SetAlertMessage(Resource.DataExistWithSameShopName, Enums.AlertType.info); } else if (status == Enums.CrudStatus.NoEffect) { SetAlertMessage(Resource.DataNotSaved, Enums.AlertType.warning); } else if (status == Enums.CrudStatus.Exception) { SetAlertMessage(Resource.Exception, Enums.AlertType.danger); } else if (status == Enums.CrudStatus.AlreadyInUse) { SetAlertMessage(Resource.AlreadyInUse, Enums.AlertType.warning); } }
public ActionResult SetNotificationType(NotificationTypeModel model) { if (ModelState.IsValid) { MasterDetails _details = new MasterDetails(); Enums.CrudStatus status = _details.SetNotificationType(model, Enums.CrudType.Insert); ReturnAlertMessage(status); } return(RedirectToAction("GetNotificationType")); }
public ActionResult DeleteRoleType(Gbl_Master_Employee_Role model) { if (ModelState.IsValid) { MastersDetails details = new MastersDetails(); Enums.CrudStatus status = details.SetEmployeeRole(model, Enums.CrudType.Delete); ReturnAlertMessage(status); } return(View("AddEmployeeRole")); }
public ActionResult DeleteStockEntry(StockEntryModel model, List <Stk_Dtl_Entry> list) { if (ModelState.IsValid) { details = new StockEntryDetails(); Enums.CrudStatus status = details.SetStock(model, list, Enums.CrudType.Delete); ReturnAlertMessage(status); } return(RedirectToAction("StockEntry")); }
public ActionResult UpdateAppPage(AppPageModel model) { if (ModelState.IsValid) { MenuDetails _details = new MenuDetails(); Enums.CrudStatus status = _details.SetAppPage(model, Enums.CrudType.Update); ReturnAlertMessage(status); } return(RedirectToAction("AddAppPage")); }
public ActionResult DeleteCustmer(CustomerModel model) { if (ModelState.IsValid) { _details = new MasterModel(); Enums.CrudStatus status = _details.SetCustomer(model, Enums.CrudType.Delete); ReturnAlertMessage(status); } return(View("AddCustmer")); }
public ActionResult SetDowntime([Bind(Exclude = "Id")] DowntimeModel model) { if (ModelState.IsValid) { SettingDetails _details = new SettingDetails(); Enums.CrudStatus status = _details.AddDowntime(model, Enums.CrudType.Insert); ReturnAlertMessage(status); } return(RedirectToAction("GetDowntime")); }
public ActionResult DeleteDowntime(DowntimeModel model) { if (ModelState.IsValid) { SettingDetails _details = new SettingDetails(); Enums.CrudStatus status = _details.AddDowntime(model, Enums.CrudType.Delete); ReturnAlertMessage(status); } return(RedirectToAction("GetDowntime")); }
public ActionResult DeleteCheque(ChequeModel model) { if (ModelState.IsValid) { MasterDetails _details = new MasterDetails(); Enums.CrudStatus status = _details.SetCheque(model, Enums.CrudType.Delete); ReturnAlertMessage(status); } return(RedirectToAction("GetCheque")); }
public ActionResult SetCategory(CategoryModel model) { if (ModelState.IsValid) { MastersModel insertCat = new MastersModel(); Enums.CrudStatus status = insertCat.SetCatogary(model, Enums.CrudType.Insert); ReturnAlertMessage(status); } return(View("GetCategory")); }
public ActionResult UpdateShop(ShopModel model) { if (ModelState.IsValid) { MasterDetails _details = new MasterDetails(); Enums.CrudStatus status = _details.SetShop(model, Enums.CrudType.Update); ReturnAlertMessage(status); } return(View("GetShop")); }
public ActionResult DeleteNotification(NotificationDbModel model) { if (ModelState.IsValid) { _details = new MasterDetails(); Enums.CrudStatus status = _details.SetNotification(model, Enums.CrudType.Delete); ReturnAlertMessage(status); } return(RedirectToAction("GetNotification")); }
public ActionResult DeleteProduct(ProductModel model) { if (ModelState.IsValid) { MastersModel insertCat = new MastersModel(); Enums.CrudStatus status = insertCat.SetProduct(model, Enums.CrudType.Delete); ReturnAlertMessage(status); } return(View("GetProduct")); }
public ActionResult UpdateVendor(VendorModel model) { if (ModelState.IsValid) { MastersModel insertBrand = new MastersModel(); Enums.CrudStatus status = insertBrand.SetVendor(model, Enums.CrudType.Update); ReturnAlertMessage(status); } return(View("GetVendor")); }
public ActionResult UpdateDocProof(Gbl_Master_DocProof model) { ViewBag.ShopList = WebSession.ShopList; if (ModelState.IsValid) { MasterDetails _details = new MasterDetails(); Enums.CrudStatus status = _details.SetDocProof(model, Enums.CrudType.Update); ReturnAlertMessage(status); } return(RedirectToAction("GetDocProof")); }
public ActionResult UpdateUnit(UnitModel model) { if (ModelState.IsValid) { MastersModel insertCat = new MastersModel(); Enums.CrudStatus status = insertCat.SetUnit(model, Enums.CrudType.Update); ReturnAlertMessage(status); } return(View("GetUnit")); }
public ActionResult DeleteShop(ShopModel model) { ViewBag.ShopList = WebSession.ShopList; if (ModelState.IsValid) { MasterDetails _details = new MasterDetails(); Enums.CrudStatus status = _details.SetShop(model, Enums.CrudType.Delete); ReturnAlertMessage(status); } return(RedirectToAction("GetShop")); }
public ActionResult UpdateNotification(NotificationDbModel model) { ViewBag.ShopList = WebSession.ShopList; if (ModelState.IsValid) { MasterDetails _details = new MasterDetails(); Enums.CrudStatus status = _details.SetNotification(model, Enums.CrudType.Update); ReturnAlertMessage(status); } return(RedirectToAction("GetNotification")); }
public ActionResult DeleteBrand(BrandModel model) { if (ModelState.IsValid) { MastersModel insertBrand = new MastersModel(); Enums.CrudStatus status = insertBrand.SetBrand(model, Enums.CrudType.Delete); ReturnAlertMessage(status); } return(View("GetBrand")); }
public ActionResult SetAccountType(AccTypeModel model) { ViewBag.ShopList = WebSession.ShopList; if (ModelState.IsValid) { MasterDetails _details = new MasterDetails(); Enums.CrudStatus status = _details.SetAccType(model, Enums.CrudType.Insert); ReturnAlertMessage(status); } return(RedirectToAction("GetAccountType")); }
public ActionResult DeleteUser(CreateUserModel model) { if (ModelState.IsValid) { UserDetails _details = new UserDetails(); if (WebSession.UserType.ToLower().Contains("super") && WebSession.UserType.ToLower().Contains("admin")) { Enums.CrudStatus status = _details.SetUser(model, Enums.CrudType.Delete); ReturnAlertMessagToView(status); } else { SetAlertMessage("You do not have rights to delete user", Enums.AlertType.warning); } } return(View("GetUser")); }
internal Dictionary <int, string> ReturnAjaxAlertMessage(Enums.CrudStatus status, int returnId = 0) { Dictionary <int, string> result = new Dictionary <int, string>(); if (returnId > 0) { result.Add(returnId, "ReturnId"); } if (status == Enums.CrudStatus.Deleted) { result.Add(100, Resource.DataDeleted); } else if (status == Enums.CrudStatus.Inserted) { result.Add(101, Resource.DataSaved); } else if (status == Enums.CrudStatus.Updated) { result.Add(102, Resource.DataUpdated); } else if (status == Enums.CrudStatus.AlreadyExistForSameShop) { result.Add(103, Resource.DataExistWithSameShopName); } else if (status == Enums.CrudStatus.NoEffect) { result.Add(104, Resource.DataNotSaved); } else if (status == Enums.CrudStatus.Exception) { result.Add(105, Resource.Exception); } else if (status == Enums.CrudStatus.AlreadyInUse) { result.Add(106, Resource.AlreadyInUse); } else if (status == Enums.CrudStatus.AlreadySendNotification) { result.Add(107, Resource.Notification_Already_Pushed); } else if (status == Enums.CrudStatus.NotificationExpired) { result.Add(108, Resource.Notification_Expired); } else if (status == Enums.CrudStatus.NotificationSend) { result.Add(109, Resource.Notification_Send); } else if (status == Enums.CrudStatus.AlreadyExist) { result.Add(110, Resource.DataExistWithSameShopName); } else if (status == Enums.CrudStatus.InvalidParameter) { result.Add(111, Resource.Invalid_Parameter); } else if (status == Enums.CrudStatus.InvoiceAlreadyCancelled) { result.Add(112, Resource.InvoiceAlreadyCancelled); } else if (status == Enums.CrudStatus.AmountMismatched) { result.Add(113, Resource.AmountMismatched); } else if (status == Enums.CrudStatus.PartiallyUpdated) { result.Add(114, Resource.Partially_Updated); } else if (status == Enums.CrudStatus.NotExist) { result.Add(115, Resource.RecordNotExist); } else { result.Add(1100, Resource.Status_Not_Defined); } return(result); }