Exemplo n.º 1
0
 public ActionResult DeletePromotion(string PinCode, string Reason, string Id)
 {
     try
     {
         var IsCheckPinCode = CheckPinCode(PinCode);
         if (!IsCheckPinCode)
         {
             return(Json(new { Status = "400", Message = "Pin Code Is invalid", IsPinCode = true }));
         }
         else
         {
             PromotionsFactory _factory = new PromotionsFactory();
             var result = _factory.Delete(Id, Reason);
             if (!result)
             {
                 return(Json(new { Status = "400", Message = "This promotion already has transaction. Cannot delete this one.", IsPinCode = false }));
             }
             return(Json(new { Status = "200", Message = "Success." }));
         }
     }
     catch (Exception ex)
     {
         NSLog.Logger.Error("DeleteProduct : ", ex);
         return(new HttpStatusCodeResult(400, ex.Message));
     }
 }
Exemplo n.º 2
0
 public ActionResult DeletePopup(string ID, string PinCode, string Reason)
 {
     try
     {
         PromotionsFactory _factory = new PromotionsFactory();
         if (!PinCode.Equals(CurrentUser.PinCode))
         {
             return(new HttpStatusCodeResult(HttpStatusCode.NotFound));
         }
         var result = _factory.Delete(ID, Reason);
         if (!result)
         {
             return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
         }
         return(new HttpStatusCodeResult(HttpStatusCode.OK));
     }
     catch (Exception ex)
     {
         NSLog.Logger.Error("Promotions Delete: ", ex);
         return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
     }
 }
Exemplo n.º 3
0
 public SBInventoryPromotionController()
 {
     _promotionsFactory = new PromotionsFactory();
     _productFactory    = new ProductFactory();
 }