Ejemplo n.º 1
0
 public ActionResult SaveVDS_Payment(VM_VDS_Payment VDS_Payment)
 {
     try
     {
         RBACUser rUser = new RBACUser(Session["UserName"].ToString());
         if (!rUser.HasPermission("VDSPayment_Insert"))
         {
             return(Json("X", JsonRequestBehavior.AllowGet));
         }
         string content     = "An error occured during the save.";
         var    serSettings = new JsonSerializerSettings {
             PreserveReferencesHandling = PreserveReferencesHandling.Objects
         };
         string jsonCov = JsonConvert.SerializeObject(VDS_Payment, Formatting.Indented, serSettings);
         HttpResponseMessage response = GlobalVariabls.VatApiClient.PostAsJsonAsync("VM_VDS_Payment/PostVM_VDS_Payment", VDS_Payment).Result;
         content = response.StatusCode.ToString();
         if (content == "OK")
         {
             TransactionLogService.SaveTransactionLog(_transactionLogService, "VDS Payment", "Save", VDS_Payment.VDS_PaymentNo, Session["UserName"].ToString());
             return(Json("1", JsonRequestBehavior.AllowGet));
         }
         else
         {
             return(Json("0", JsonRequestBehavior.AllowGet));
         }
     }
     catch (Exception ex)
     {
         return(Json(ex.ToString(), JsonRequestBehavior.AllowGet));
     }
 }
Ejemplo n.º 2
0
        public ActionResult GetVDS_PaymentByVDS_PaymentNo(string VDS_PaymentNo)
        {
            HttpResponseMessage response       = GlobalVariabls.VatApiClient.GetAsync("VM_VDS_Payment/GetVM_VDS_Payment?VDS_PaymentNo=" + VDS_PaymentNo.ToString()).Result;
            VM_VDS_Payment      VM_VDS_Payment = response.Content.ReadAsAsync <VM_VDS_Payment>().Result;

            return(Json(VM_VDS_Payment, JsonRequestBehavior.AllowGet));
        }