Ejemplo n.º 1
0
        public ActionResult Details(string CatalogueBefore, string CatalogueAfter)
        {
            MainApplication model = new MainApplication();

            model.userCredentialList = _IUserCredentialService.GetUserCredentialsByEmail(UserEmail);
            model.modulelist         = _iIModuleService.getAllModules();
            model.CompanyCode        = CompanyCode;
            model.CompanyName        = CompanyName;
            model.FinancialYear      = FinancialYear;

            int id1 = Decode(CatalogueBefore);
            int id2 = Decode(CatalogueAfter);

            model.CatalogueDetails = _CatalogueService.GetCatalogue(id1);
            model.CatalogueList    = _CatalogueService.GetInsertedRow(id1, id2);

            return(View(model));
        }
Ejemplo n.º 2
0
 public IActionResult getcatalogue(int id)
 {
     try
     {
         string message   = string.Empty;
         var    catalogue = _catalogueService.GetCatalogue(id, out message);
         if (catalogue != null)
         {
             //clear the image (there is different API call for same)
             catalogue.Itempic = null;
         }
         return(Ok(new { status = catalogue != null ? Constants.Success : Constants.Error, message = message, catalogue = catalogue }));
     }
     catch (Exception ex)
     {
         //TODO: Log the exception
         return(Ok(new { status = Constants.Error, message = Constants.ErrorMessage, catalogue = "" }));
     }
 }
Ejemplo n.º 3
0
 public ActionResult getCatalogueImage(int id)
 {
     try
     {
         string message   = string.Empty;
         var    catalogue = _catalogueService.GetCatalogue(id, out message);
         byte[] itemPic   = null;
         if (catalogue != null)
         {
             itemPic = catalogue.Itempic;
         }
         else
         {
             //! Fetch the image not found picture
             var defaultCatalogue = _catalogueService.GetImageNotFoundCatalogue();
             if (defaultCatalogue != null)
             {
                 itemPic = defaultCatalogue.Itempic;
             }
         }
         if (itemPic != null)
         {
             Response.Headers.Add("Content-Disposition", "inline; filename=" + id + ".png");
             Response.ContentType = "application/image";
             return(new FileContentResult(itemPic, "image/png"));
         }
         else
         {
             return(Ok(new { status = Constants.Error, message = message }));
         }
     }
     catch (Exception ex)
     {
         return(Ok(new { status = Constants.Error, message = Constants.ErrorMessage }));
     }
 }