/// <summary> /// 保存表单(新增、修改) /// </summary> /// <param name="keyValue">主键值</param> /// <param name="entity">实体对象</param> /// <returns></returns> public void SaveForm(string keyValue, PtInvoiceEntity entity) { try { service.SaveForm(keyValue, entity); } catch (Exception) { throw; } }
public ActionResult SavePrintData(string keyValue, string queryJson) { if (String.IsNullOrEmpty(queryJson)) { return(Error("参数异常")); } var queryParam = HttpUtility.UrlDecode(queryJson).ToJObject(); //先保存购方客户信息,保存到表pt_kpkhxx,根据form里面gfkhdm是否为空判断,有值表示通过自动完成选择数据的已保存数据,不用保存,为空则需要pt_kpkhxx表插入一条记录 if (queryParam.GetValue("ghkhdm") == null || queryParam.GetValue("ghkhdm").ToString() == "") { string khdm = feeticketbll.GetMaxID();//获取产生一个pt_kpkhxx最大khdm字段字符串 //保存对应字段表pt_kpkhxx InvoiceInfoEntity saveEntity = new InvoiceInfoEntity(); saveEntity.khdm = khdm; saveEntity.khmc = queryParam.GetValue("ghdwmc").ToString(); saveEntity.khsh = queryParam.GetValue("ghdwsbh").ToString(); saveEntity.khdz = queryParam.GetValue("ghdwdzdh").ToString(); saveEntity.khkhyhzh = queryParam.GetValue("ghdwyhzh").ToString(); new InvoiceInfoBLL().SaveForm(null, saveEntity); } PtInvoiceEntity entity = new PtInvoiceEntity(); entity.inputtime = DateTime.Now; entity.inv_date = DateTime.Now; entity.inv_money = Convert.ToDecimal(queryParam.GetValue("fphjje")); entity.inv_name = queryParam.GetValue("kpr").ToString(); entity.inv_notes = queryParam.GetValue("bz").ToString(); entity.ticket_id = queryParam.GetValue("ticket_id").ToString(); // 前端传参 需要注意 entity.inv_num = queryParam.GetValue("fphm").ToString(); entity.inv_fpdm = queryParam.GetValue("fpdm").ToString(); entity.inv_lxdm = queryParam.GetValue("fplxdm").ToString(); entity.khdm = queryParam.GetValue("ghkhdm").ToString(); new PtInvoiceBLL().SaveForm(null, entity); return(Success("操作成功。")); }
public ActionResult GetPrintListJson(string keyValue, string queryJson) { PtInvoiceBLL ptinvoicebll = new PtInvoiceBLL(); //step1 判断是否有收费数据判断pt_invoice表里面ticket_id是否存在 PtInvoiceEntity entity = ptinvoicebll.GetEntity(keyValue); if (entity != null) { return(Error("发票已经打印过不能重复打印")); } //step2 data为空表示没有取到收费信息,发票号可能未使用或者作废等 var data = feeticketbll.GetPrintListJson(keyValue, string.Empty); if (data == null || data.Count() == 0) { return(Error("发票开票信息不存在!")); } return(Success("获取发票信息成功", data)); }
public ActionResult SaveForm(string keyValue, PtInvoiceEntity entity) { ptinvoicebll.SaveForm(keyValue, entity); return(Success("操作成功。")); }