Esempio n. 1
0
 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);
     }
 }
Esempio n. 2
0
 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"));
 }
Esempio n. 3
0
 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"));
 }
Esempio n. 4
0
 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"));
 }
Esempio n. 5
0
 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"));
 }
Esempio n. 6
0
 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"));
 }
Esempio n. 7
0
 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"));
 }
Esempio n. 8
0
 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"));
 }
Esempio n. 9
0
 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"));
 }
Esempio n. 10
0
 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"));
 }
Esempio n. 11
0
 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"));
 }
Esempio n. 12
0
 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"));
 }
Esempio n. 13
0
        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"));
        }
Esempio n. 14
0
        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"));
        }
Esempio n. 15
0
 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"));
 }
Esempio n. 16
0
        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"));
        }
Esempio n. 17
0
 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"));
 }
Esempio n. 18
0
 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"));
 }
Esempio n. 19
0
        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"));
        }
Esempio n. 20
0
 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"));
 }
Esempio n. 21
0
 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"));
 }
Esempio n. 22
0
        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);
        }