コード例 #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);
        }
コード例 #2
0
        public JsonResult GetActiveRegions()
        {
            SedesolService.SedesolServiceClient client = new SedesolService.SedesolServiceClient();
            var regions = client.GetActiveRegions();

            client.Close();

            return(Json(regions, JsonRequestBehavior.AllowGet));
        }
コード例 #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));
        }
コード例 #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));
        }
コード例 #5
0
        public PartialViewResult Pictures(int hq)
        {
            var client = new SedesolService.SedesolServiceClient();
            List <CaptureImageDTO> pictures = new List <CaptureImageDTO>();

            pictures = client.GetImageByCaptureId(hq);

            foreach (CaptureImageDTO item in pictures)
            {
                item.ImageFileB64 = Convert.ToBase64String(item.ImageFile);
            }

            return(PartialView(pictures));
        }
コード例 #6
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 }));
        }