Esempio n. 1
0
        public JsonResult DeleteFile(int idFile)
        {
            var    client = new SedesolService.SedesolServiceClient();
            string data   = client.DeleteCaptureImage(idFile);

            CaptureModel           captureModel = (CaptureModel)Session["CaptureModel"];
            List <CaptureImageDTO> listImage    = new List <CaptureImageDTO>();

            listImage = client.GetImageByCaptureId(captureModel.Capture.Id);
            foreach (CaptureImageDTO item in listImage)
            {
                item.ImageFileB64 = "data:image/jpeg; base64," + Convert.ToBase64String(item.ImageFile);
            }

            Session["CountImg"] = null;
            Session.Add("CountImg", listImage.Count());

            client.Close();

            string viewContent = ConvertViewToString("ImageList", listImage);
            var    sjonResult  = Json(new { message = data, PartialView = viewContent });

            sjonResult.MaxJsonLength = int.MaxValue;

            return(sjonResult);
        }
Esempio n. 2
0
        public JsonResult GetActiveRegions()
        {
            SedesolService.SedesolServiceClient client = new SedesolService.SedesolServiceClient();
            var regions = client.GetActiveRegions();

            client.Close();

            return(Json(regions, JsonRequestBehavior.AllowGet));
        }
Esempio n. 3
0
        // GET: Product
        public ActionResult Index()
        {
            SedesolService.SedesolServiceClient client = new SedesolService.SedesolServiceClient();
            List <ProductDTO> model = new List <ProductDTO>();

            model = client.GetProductAll();
            client.Close();
            return(View(model));
        }
Esempio n. 4
0
        public JsonResult LoadForm(int idProduct)
        {
            SedesolService.SedesolServiceClient client = new SedesolService.SedesolServiceClient();
            var prod = client.GetProductById(idProduct);

            client.Close();

            prod.MomioString   = prod.Momio.ToString();
            prod.MeasureString = prod.Measure.ToString();
            return(Json(prod, JsonRequestBehavior.AllowGet));
        }
Esempio n. 5
0
        public JsonResult SaveProduct(ProductDTO productDTO)
        {
            productDTO.Price      = 0;
            productDTO.CreateDate = DateTime.Now;
            productDTO.EditDate   = DateTime.Now;
            productDTO.CreateUser = ((UserDTO)Session["userData"]).Username;
            productDTO.EditUser   = ((UserDTO)Session["userData"]).Username;

            SedesolService.SedesolServiceClient client = new SedesolService.SedesolServiceClient();

            productDTO = client.SaveProduct(productDTO);
            List <ProductDTO> listProduct = new List <ProductDTO>();

            if (productDTO.Message == "SUCCESS")
            {
                listProduct = client.GetProductAll();
            }
            client.Close();

            string viewContent = ConvertViewToString("ProductList", listProduct);

            return(Json(new { message = productDTO.Message, PartialView = viewContent }));
        }