本文整理汇总了C#中System.Web.Script.Serialization.JavaScriptSerializer.Deserialize方法的典型用法代码示例。如果您正苦于以下问题:C# System.Web.Script.Serialization.JavaScriptSerializer.Deserialize方法的具体用法?C# System.Web.Script.Serialization.JavaScriptSerializer.Deserialize怎么用?C# System.Web.Script.Serialization.JavaScriptSerializer.Deserialize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.Script.Serialization.JavaScriptSerializer
的用法示例。
在下文中一共展示了System.Web.Script.Serialization.JavaScriptSerializer.Deserialize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessRequest
public void ProcessRequest(HttpContext context)
{
NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();
context.Response.ContentType = "text/plain";
NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
string documentStr = context.Request.Form["document"];
string docStocksStr = context.Request.Form["docStocks"];
string isSubmitAuditStr = context.Request.Form["IsSubmitAudit"];
System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
NFMT.Document.Model.Document document = serializer.Deserialize<NFMT.Document.Model.Document>(documentStr);
List<NFMT.Document.Model.DocumentStock> docStocks = serializer.Deserialize<List<NFMT.Document.Model.DocumentStock>>(docStocksStr);
bool isSubmitAudit = false;
if (string.IsNullOrEmpty(isSubmitAuditStr) || !bool.TryParse(isSubmitAuditStr, out isSubmitAudit))
isSubmitAudit = false;
NFMT.Document.BLL.DocumentBLL bll = new NFMT.Document.BLL.DocumentBLL();
result = bll.Create(user, document, docStocks, isSubmitAudit);
if (result.ResultStatus == 0)
result.Message = "制单新增成功";
string jsonStr = Newtonsoft.Json.JsonConvert.SerializeObject(result);
context.Response.Write(jsonStr);
}
示例2: ProcessRequest
public void ProcessRequest(HttpContext context)
{
NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();
try
{
NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
context.Response.ContentType = "text/plain";
string empStr = context.Request.Form["Employee"];
if (string.IsNullOrEmpty(empStr))
{
context.Response.Write("员工信息不能为空");
context.Response.End();
}
string accountStr = context.Request.Form["account"];
if (string.IsNullOrEmpty(empStr))
{
context.Response.Write("员工账号密码信息不能为空");
context.Response.End();
}
System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
NFMT.User.Model.Employee emp = serializer.Deserialize<NFMT.User.Model.Employee>(empStr);
NFMT.User.Model.Account account = serializer.Deserialize<NFMT.User.Model.Account>(accountStr);
if (emp.DeptId <= 0)
{
context.Response.Write("未选择部门");
context.Response.End();
}
if (string.IsNullOrEmpty(emp.EmpCode))
{
context.Response.Write("未填写员工编号");
context.Response.End();
}
if (string.IsNullOrEmpty(emp.Name))
{
context.Response.Write("员工名称不能为空");
context.Response.End();
}
NFMT.User.BLL.EmployeeBLL empBLL = new NFMT.User.BLL.EmployeeBLL();
result = empBLL.CreateHandler(user, emp, account);
if (result.ResultStatus == 0)
result.Message = "员工新增成功";
}
catch (Exception e)
{
result.Message = e.Message;
result.ResultStatus = -1;
}
context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
}
示例3: ProcessRequest
public void ProcessRequest(HttpContext context)
{
NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();
context.Response.ContentType = "text/plain";
NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
string orderStr = context.Request.Form["order"];
string orderStockInvoiceStr = context.Request.Form["orderStockInvoice"];
string orderDetailStr = context.Request.Form["orderDetail"];
System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
NFMT.Document.Model.DocumentOrder order = serializer.Deserialize<NFMT.Document.Model.DocumentOrder>(orderStr);
List<NFMT.Document.Model.OrderReplaceStock> stockInvoices = serializer.Deserialize<List<NFMT.Document.Model.OrderReplaceStock>>(orderStockInvoiceStr);
NFMT.Document.Model.DocumentOrderDetail detail = serializer.Deserialize<NFMT.Document.Model.DocumentOrderDetail>(orderDetailStr);
NFMT.Document.BLL.DocumentOrderBLL bll = new NFMT.Document.BLL.DocumentOrderBLL();
result = bll.UpdateReplaceOrder(user, order, stockInvoices, detail);
if (result.ResultStatus == 0)
result.Message = "制单指令修改成功";
string jsonStr = Newtonsoft.Json.JsonConvert.SerializeObject(result);
context.Response.Write(jsonStr);
}
示例4: ProcessRequest
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();
string priceConfirmStr = context.Request.Form["priceConfirm"];
if (string.IsNullOrEmpty(priceConfirmStr))
{
result.Message = "价格确认单信息不能为空";
context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
context.Response.End();
}
string rowsStr = context.Request.Form["rows"];
if (string.IsNullOrEmpty(rowsStr))
{
result.Message = "价格确认单明细信息不能为空";
context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
context.Response.End();
}
bool isSubmitAudit = false;
if (string.IsNullOrEmpty(context.Request.Form["IsSubmitAudit"]) || !bool.TryParse(context.Request.Form["IsSubmitAudit"], out isSubmitAudit))
isSubmitAudit = false;
try
{
System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
NFMT.DoPrice.Model.PriceConfirm priceConfirm = serializer.Deserialize<NFMT.DoPrice.Model.PriceConfirm>(priceConfirmStr);
List<NFMT.DoPrice.Model.PriceConfirmDetail> details = serializer.Deserialize<List<NFMT.DoPrice.Model.PriceConfirmDetail>>(rowsStr);
if (priceConfirm == null || details == null || !details.Any())
{
result.Message = "数据错误";
context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
context.Response.End();
}
foreach (NFMT.DoPrice.Model.PriceConfirmDetail detail in details)
{
detail.SettlePrice = priceConfirm.SettlePrice;
detail.SettleBala = detail.SettlePrice * detail.ConfirmAmount;
}
NFMT.DoPrice.BLL.PriceConfirmBLL bll = new NFMT.DoPrice.BLL.PriceConfirmBLL();
result = bll.Create(user, priceConfirm, details, isSubmitAudit);
if (result.ResultStatus == 0)
{
result.Message = "价格确认单新增成功";
}
}
catch (Exception ex)
{
result.ResultStatus = -1;
result.Message = ex.Message;
}
context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
context.Response.End();
}
示例5: ProcessRequest
public void ProcessRequest(HttpContext context)
{
NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();
context.Response.ContentType = "text/plain";
NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
string orderStr = context.Request.Form["order"];
string orderStockInvoiceStr = context.Request.Form["orderStockInvoice"];
string orderDetailStr = context.Request.Form["orderDetail"];
string isSubmitAuditStr = context.Request.Form["IsSubmitAudit"];
System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
NFMT.Document.Model.DocumentOrder order = serializer.Deserialize<NFMT.Document.Model.DocumentOrder>(orderStr);
List<NFMT.Document.Model.OrderStockInvoice> stockInvoices = serializer.Deserialize<List<NFMT.Document.Model.OrderStockInvoice>>(orderStockInvoiceStr);
NFMT.Document.Model.DocumentOrderDetail detail = serializer.Deserialize<NFMT.Document.Model.DocumentOrderDetail>(orderDetailStr);
bool isSubmitAudit = false;
if (string.IsNullOrEmpty(isSubmitAuditStr) || !bool.TryParse(isSubmitAuditStr, out isSubmitAudit))
isSubmitAudit = false;
NFMT.Document.BLL.DocumentOrderBLL bll = new NFMT.Document.BLL.DocumentOrderBLL();
result = bll.Create(user, order, stockInvoices, detail, isSubmitAudit);
if (result.ResultStatus == 0)
result.Message = "制单指令新增成功";
string jsonStr = Newtonsoft.Json.JsonConvert.SerializeObject(result);
context.Response.Write(jsonStr);
}
示例6: ProcessRequest
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();
string stockMoveStr = context.Request.Form["stockMove"];
if (string.IsNullOrEmpty(stockMoveStr))
{
result.Message = "移库信息不能为空";
result.ResultStatus = -1;
context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
context.Response.End();
}
string applyStr = context.Request.Form["apply"];
if (string.IsNullOrEmpty(applyStr))
{
result.Message = "申请信息不能为空";
result.ResultStatus = -1;
context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
context.Response.End();
}
int stockMoveApplyId = 0;
if (string.IsNullOrEmpty(context.Request.Form["aid"]) || !int.TryParse(context.Request.Form["aid"], out stockMoveApplyId) || stockMoveApplyId <= 0)
{
result.Message = "移库申请序号错误";
result.ResultStatus = -1;
context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
context.Response.End();
}
try
{
System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
List<NFMT.WareHouse.Model.StockMoveApplyDetail> stockMoveApplyDetails = serializer.Deserialize<List<NFMT.WareHouse.Model.StockMoveApplyDetail>>(stockMoveStr);
NFMT.Operate.Model.Apply apply = serializer.Deserialize<NFMT.Operate.Model.Apply>(applyStr);
if (apply == null || stockMoveApplyDetails == null || !stockMoveApplyDetails.Any())
{
result.Message = "数据错误";
result.ResultStatus = -1;
context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
context.Response.End();
}
NFMT.WareHouse.BLL.StockMoveApplyBLL stockMoveApplyBLL = new NFMT.WareHouse.BLL.StockMoveApplyBLL();
result = stockMoveApplyBLL.StockMoveApplyUpdateHandle(user, apply, stockMoveApplyDetails, stockMoveApplyId);
if (result.ResultStatus == 0)
result.Message = "更新成功";
}
catch (Exception ex)
{
result.ResultStatus = -1;
result.Message = ex.Message;
}
context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
}
示例7: ProcessRequest
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
string resultStr = string.Empty;
string repoApplyStr = context.Request.Form["repoApply"];
if (string.IsNullOrEmpty(repoApplyStr))
{
context.Response.Write("赎回申请单信息不能为空");
context.Response.End();
}
string rowsStr = context.Request.Form["rows"];
if (string.IsNullOrEmpty(rowsStr))
{
context.Response.Write("明细信息不能为空");
context.Response.End();
}
NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();
try
{
System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
NFMT.Finance.Model.RepoApply repoApply = serializer.Deserialize<NFMT.Finance.Model.RepoApply>(repoApplyStr);
List<NFMT.Finance.Model.RepoApplyDetail> details = serializer.Deserialize<List<NFMT.Finance.Model.RepoApplyDetail>>(rowsStr);
if (repoApply == null || details == null || !details.Any())
{
context.Response.Write("信息错误");
context.Response.End();
}
decimal sumNetAmount = 0;
int sumHands = 0;
foreach (NFMT.Finance.Model.RepoApplyDetail detail in details)
{
sumNetAmount += detail.NetAmount;
sumHands += detail.Hands;
}
repoApply.SumNetAmount = sumNetAmount;
repoApply.SumHands = sumHands;
string userJson = serializer.Serialize(user);
string repoApplyJson = serializer.Serialize(repoApply);
FinanceService.FinService service = new FinanceService.FinService();
resultStr = service.FinRepoApplyUpdate(userJson, repoApplyJson, rowsStr);
}
catch (Exception e)
{
result.ResultStatus = -1;
result.Message = e.Message;
}
context.Response.Write(resultStr);
context.Response.End();
}
示例8: ProcessRequest
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();
string interestStr = context.Request.Form["Interest"];
if (string.IsNullOrEmpty(interestStr))
{
result.Message = "利息结算信息不能为空";
context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
context.Response.End();
}
string detailsStr = context.Request.Form["InterestDetail"];
if (string.IsNullOrEmpty(detailsStr))
{
result.Message = "利息结算明细信息不能为空";
context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
context.Response.End();
}
bool isSubmitAudit = false;
if (string.IsNullOrEmpty(context.Request.Form["IsSubmitAudit"]) || !bool.TryParse(context.Request.Form["IsSubmitAudit"], out isSubmitAudit))
isSubmitAudit = false;
try
{
System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
NFMT.DoPrice.Model.Interest interest = serializer.Deserialize<NFMT.DoPrice.Model.Interest>(interestStr);
List<NFMT.DoPrice.Model.InterestDetail> interestDetails = serializer.Deserialize<List<NFMT.DoPrice.Model.InterestDetail>>(detailsStr);
if (interest == null || interestDetails == null || interestDetails.Count == 0)
{
result.Message = "数据错误";
context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
context.Response.End();
}
NFMT.DoPrice.BLL.InterestBLL bll = new NFMT.DoPrice.BLL.InterestBLL();
result = bll.Create(user,interest,interestDetails, isSubmitAudit);
if (result.ResultStatus == 0)
{
result.Message = "利息结算新增成功";
}
}
catch (Exception ex)
{
result.ResultStatus = -1;
result.Message = ex.Message;
}
context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
context.Response.End();
}
示例9: ProcessRequest
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();
string invoiceStr = context.Request.Form["Invoice"];
if (string.IsNullOrEmpty(invoiceStr))
{
result.Message = "发票不能为空";
context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
context.Response.End();
}
string invoiceBusinessStr = context.Request.Form["InvoiceBusiness"];
if (string.IsNullOrEmpty(invoiceBusinessStr))
{
result.Message = "发票不能为空";
context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
context.Response.End();
}
string detailStr = context.Request.Form["Details"];
if (string.IsNullOrEmpty(detailStr))
{
result.Message = "业务发票明细不能为空";
context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
context.Response.End();
}
try
{
System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
NFMT.Operate.Model.Invoice invoice = serializer.Deserialize<NFMT.Operate.Model.Invoice>(invoiceStr);
NFMT.Invoice.Model.BusinessInvoice invoiceBusiness = serializer.Deserialize<NFMT.Invoice.Model.BusinessInvoice>(invoiceBusinessStr);
List<NFMT.Invoice.Model.BusinessInvoiceDetail> details = new List<NFMT.Invoice.Model.BusinessInvoiceDetail>();
details = serializer.Deserialize<List<NFMT.Invoice.Model.BusinessInvoiceDetail>>(detailStr);
NFMT.Invoice.BLL.BusinessInvoiceBLL bll = new NFMT.Invoice.BLL.BusinessInvoiceBLL();
result = bll.CreateDirect(user, invoice, invoiceBusiness, details);
if (result.ResultStatus == 0)
{
result.Message = "直接终票新增成功";
}
}
catch (Exception ex)
{
result.ResultStatus = -1;
result.Message = ex.Message;
}
context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
}
示例10: ProcessRequest
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();
string applyStr = context.Request.Form["apply"];
if (string.IsNullOrEmpty(applyStr))
{
context.Response.Write("申请信息不能为空");
context.Response.End();
}
string pledgeApplyStr = context.Request.Form["pledgeApply"];
if (string.IsNullOrEmpty(pledgeApplyStr))
{
context.Response.Write("质押申请信息不能为空");
context.Response.End();
}
string detailsStr = context.Request.Form["rows"];
if (string.IsNullOrEmpty(detailsStr))
{
context.Response.Write("明细内容不能为空");
context.Response.End();
}
try
{
System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
NFMT.Operate.Model.Apply apply = serializer.Deserialize<NFMT.Operate.Model.Apply>(applyStr);
NFMT.WareHouse.Model.PledgeApply pledgeApply = serializer.Deserialize<NFMT.WareHouse.Model.PledgeApply>(pledgeApplyStr);
List<NFMT.WareHouse.Model.PledgeApplyDetail> details = serializer.Deserialize<List<NFMT.WareHouse.Model.PledgeApplyDetail>>(detailsStr);
if (apply == null || pledgeApply == null || details == null || !details.Any())
{
context.Response.Write("数据错误");
context.Response.End();
}
apply.ApplyType = NFMT.Operate.ApplyType.PledgeApply;
apply.EmpId = user.EmpId;
apply.ApplyTime = DateTime.Now;
NFMT.WareHouse.BLL.PledgeApplyBLL pledgeApplyBLL = new NFMT.WareHouse.BLL.PledgeApplyBLL();
result = pledgeApplyBLL.PledgeApplyUpdateHandle(user, apply, pledgeApply, details);
if (result.ResultStatus == 0)
result.Message = "质押申请修改成功";
}
catch (Exception ex)
{
result.ResultStatus = -1;
result.Message = ex.Message;
}
context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
}
示例11: ProcessRequest
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();
string invoiceStr = context.Request.Form["invoice"];
if (string.IsNullOrEmpty(invoiceStr))
{
context.Response.Write("发票不能为空");
context.Response.End();
}
string SIstr = context.Request.Form["SI"];
if (string.IsNullOrEmpty(SIstr))
{
context.Response.Write("价外票内容不能为空");
context.Response.End();
}
string SIDetailstr = context.Request.Form["SIDetail"];
if (string.IsNullOrEmpty(SIDetailstr))
{
context.Response.Write("价外票明细内容不能为空");
context.Response.End();
}
try
{
System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
NFMT.Operate.Model.Invoice invoice = serializer.Deserialize<NFMT.Operate.Model.Invoice>(invoiceStr);
NFMT.Invoice.Model.SI si = serializer.Deserialize<NFMT.Invoice.Model.SI>(SIstr);
List<NFMT.Invoice.Model.SIDetail> siDetails = serializer.Deserialize<List<NFMT.Invoice.Model.SIDetail>>(SIDetailstr);
if (invoice == null || si == null || siDetails == null)
{
context.Response.Write("数据错误");
context.Response.End();
}
NFMT.Invoice.BLL.SIBLL bll = new NFMT.Invoice.BLL.SIBLL();
result = bll.Update(user, invoice, si, siDetails);
if (result.ResultStatus == 0)
{
result.Message = "修改成功";
}
}
catch (Exception ex)
{
result.ResultStatus = -1;
result.Message = ex.Message;
}
context.Response.Write(result.Message);
}
示例12: ProcessRequest
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();
string stockMoveStr = context.Request.Form["stockMove"];
if (string.IsNullOrEmpty(stockMoveStr))
{
result.Message = "移库信息不能为空";
result.ResultStatus = -1;
context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
context.Response.End();
}
string applyStr = context.Request.Form["apply"];
if (string.IsNullOrEmpty(applyStr))
{
result.Message = "申请信息不能为空";
result.ResultStatus = -1;
context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
context.Response.End();
}
try
{
System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
List<NFMT.WareHouse.Model.StockMoveApplyDetail> stockMoveApplyDetails = serializer.Deserialize<List<NFMT.WareHouse.Model.StockMoveApplyDetail>>(stockMoveStr);
NFMT.Operate.Model.Apply apply = serializer.Deserialize<NFMT.Operate.Model.Apply>(applyStr);
if (apply == null || stockMoveApplyDetails == null || !stockMoveApplyDetails.Any())
{
result.Message = "数据错误";
result.ResultStatus = -1;
context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
context.Response.End();
}
apply.ApplyType = NFMT.Operate.ApplyType.StockMoveApply;
apply.EmpId = user.EmpId;
apply.ApplyTime = DateTime.Now;
NFMT.WareHouse.BLL.StockMoveApplyBLL bll = new NFMT.WareHouse.BLL.StockMoveApplyBLL();
result = bll.StockMoveApplyCreateHandle(user, apply, stockMoveApplyDetails);
if (result.ResultStatus == 0)
result.Message = "新增成功";
}
catch (Exception ex)
{
result.ResultStatus = -1;
result.Message = ex.Message;
}
context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
}
示例13: ProcessRequest
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();
string paymentyStr = context.Request.Form["Payment"];
if (string.IsNullOrEmpty(paymentyStr))
{
result.Message = "财务付款不能为空";
context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
context.Response.End();
}
string detailStr = context.Request.Form["Detail"];
if (string.IsNullOrEmpty(detailStr))
{
result.Message = "财务付款明细不能为空";
context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
context.Response.End();
}
int payApplyId = 0;
if (string.IsNullOrEmpty(context.Request.Form["PayApplyId"]) || !int.TryParse(context.Request.Form["PayApplyId"], out payApplyId))
{
result.Message = "财务付款对应申请不能为空";
context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
context.Response.End();
}
try
{
System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
NFMT.Funds.Model.Payment payment = serializer.Deserialize<NFMT.Funds.Model.Payment>(paymentyStr);
List<NFMT.Funds.Model.PaymentStockDetail> details = new List<NFMT.Funds.Model.PaymentStockDetail>();
details = serializer.Deserialize<List<NFMT.Funds.Model.PaymentStockDetail>>(detailStr);
NFMT.Funds.BLL.PaymentBLL bll = new NFMT.Funds.BLL.PaymentBLL();
result = bll.PaymentStockCreate(user, payment, details, payApplyId);
if (result.ResultStatus == 0)
{
result.Message = "付款添加成功";
}
}
catch (Exception ex)
{
result.ResultStatus = -1;
result.Message = ex.Message;
}
context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
}
示例14: ProcessRequest
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();
string invoiceStr = context.Request.Form["Invoice"];
if (string.IsNullOrEmpty(invoiceStr))
{
context.Response.Write("发票不能为空");
context.Response.End();
}
string invoiceFunds = context.Request.Form["InvoiceFunds"];
if (string.IsNullOrEmpty(invoiceFunds))
{
context.Response.Write("发票不能为空");
context.Response.End();
}
string iids = context.Request.Form["iids"];
int invoiceApplyId = 0;
if (string.IsNullOrEmpty(context.Request.Form["invApplyId"]) || !int.TryParse(context.Request.Form["invApplyId"], out invoiceApplyId) || invoiceApplyId <= 0)
{
context.Response.Write("参数错误");
context.Response.End();
}
try
{
System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
NFMT.Operate.Model.Invoice invoice = serializer.Deserialize<NFMT.Operate.Model.Invoice>(invoiceStr);
NFMT.Invoice.Model.FinanceInvoice fundsInvoice = serializer.Deserialize<NFMT.Invoice.Model.FinanceInvoice>(invoiceFunds);
fundsInvoice.VATRatio = fundsInvoice.VATRatio / 100;
NFMT.Invoice.BLL.FinanceInvoiceBLL bll = new NFMT.Invoice.BLL.FinanceInvoiceBLL();
result = bll.CreateByInvApply(user, invoice, fundsInvoice, iids, invoiceApplyId);
if (result.ResultStatus == 0)
{
result.Message = "财务发票新增成功";
}
}
catch (Exception ex)
{
result.ResultStatus = -1;
result.Message = ex.Message;
}
context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
}
示例15: ProcessRequest
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();
string applyStr = context.Request.Form["apply"];
if (string.IsNullOrEmpty(applyStr))
{
result.Message = "申请信息不能为空";
context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
context.Response.End();
}
string invoiceApplyStr = context.Request.Form["invoiceApply"];
if (string.IsNullOrEmpty(invoiceApplyStr))
{
result.Message = "发票申请信息不能为空";
context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
context.Response.End();
}
string rowsStr = context.Request.Form["rows"];
if (string.IsNullOrEmpty(rowsStr))
{
result.Message = "明细信息不能为空";
context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
context.Response.End();
}
try
{
System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
NFMT.Operate.Model.Apply apply = serializer.Deserialize<NFMT.Operate.Model.Apply>(applyStr);
NFMT.Invoice.Model.InvoiceApply invoiceApply = serializer.Deserialize<NFMT.Invoice.Model.InvoiceApply>(invoiceApplyStr);
List<NFMT.Invoice.Model.InvoiceApplyDetail> details = serializer.Deserialize<List<NFMT.Invoice.Model.InvoiceApplyDetail>>(rowsStr);
NFMT.Invoice.BLL.InvoiceApplyBLL bll = new NFMT.Invoice.BLL.InvoiceApplyBLL();
result = bll.Update(user, apply, invoiceApply, details);
if (result.ResultStatus == 0)
{
result.Message = "修改成功";
}
}
catch (Exception ex)
{
result.ResultStatus = -1;
result.Message = ex.Message;
}
context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
}