1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- using JLHHJSvr.BLL;
- using JLHHJSvr.Com.Model;
- using JLHHJSvr.LJException;
- using LJLib.DAL.SQL;
- using NPOI.SS.Formula;
- using NPOI.SS.Formula.Functions;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace JLHHJSvr.Helper
- {
- internal class BasicInfoHelper: HelperBase
- {
- /// <summary>
- /// 核价选配类型-保存
- /// </summary>
- /// <param name="configure"></param>
- public void SaveConfigureType(u_configure_type configure)
- {
- if (configure.contfigtypeid <= 0)
- {
- configure.contfigtypeid = BllHelper.GetID(cmd, "u_configure_type");
- var fields = @"contfigtypeid,contfigtype,contfigtypename,usechflag,flag";
- DbSqlHelper.Insert(cmd, "u_configure_type", null, configure, fields);
- }
- else
- {
- configure.moddate = context.opdate;
- configure.modemp = context.tokendata.username;
- //修改
- var fields = @"contfigtype,contfigtypename,usechflag,modemp,moddate";
- DbSqlHelper.Update(cmd, "u_configure_type", null, configure, "contfigtypeid", fields);
- }
- }
- /// <summary>
- /// 核价软床公式定义-保存
- /// </summary>
- /// <param name="formula"></param>
- public void SaveSoftBedFormula(u_softbed_formula formula)
- {
- if (formula == null)
- {
- throw new LJCommonException("未提交软床公式定义信息");
- }
- if (string.IsNullOrEmpty(formula.formulaname))
- {
- throw new LJCommonException($"公式名称不能为空,请检查!");
- }
- var fields = "formulaname,price_formula,use_formula";
- if (formula.formulaid <= 0)
- {
- // 新建
- fields += ",formulaid,create_date,create_emp";
- formula.formulaid = BllHelper.GetID(cmd, "u_softbed_formula");
- formula.create_date = context.opdate;
- formula.create_emp = context.tokendata.username;
- DbSqlHelper.Insert(cmd, "u_softbed_formula", null, formula, fields);
- }
- else
- {
- //修改
- fields += ",update_date,update_emp";
- formula.update_date = context.opdate;
- formula.update_emp = context.tokendata.username;
- DbSqlHelper.Update(cmd, "u_softbed_formula", null, formula, "formulaid", fields);
- }
- }
- public void SaveErpMtrlPrice(u_erpmtrl_price mtrl)
- {
- var fields = "";
- if(mtrl.mtrlid <= 0)
- {
- throw new LJCommonException("物料ID有误,请检查!");
- }
- mtrl.update_date = context.opdate;
- mtrl.update_emp = context.tokendata.username;
- if(DbSqlHelper.Update(cmd, "u_erpmtrl_price", null, mtrl, "mtrlid", "price,update_date,update_emp") == 0)
- {
- mtrl.create_date = context.opdate;
- mtrl.create_emp = context.tokendata.username;
- DbSqlHelper.Insert(cmd, "u_erpmtrl_price", null, mtrl, "mtrlid,price,create_date,create_emp");
- }
- }
- }
- }
|