public bool LoginAPI(string model) { Invoke.LoginResult loginResult = InvokeCloudAPI.Login(model); if (loginResult.LoginResultType != 1) { return(false); } return(true); }
public override void Run(Context ctx, Schedule schedule) { //1从中间表中获取当前需要调用的模块的SQL // 1.2.连接中间数据库 // 1.3.获取数据 //2.调用Kingdee登录API //3.调用客户API //4.反写中间数据库 //5.关闭数据库连接 SQLStatement = GetStatement(CustomerSQLObject.Customer); opearteList = GetOpearteList(CustomerSQLObject.Customer); //修改的单独处理 BussnessModify customerModify = new BussnessModify(); customerModify.excuteSQL(model, connectionToRemoteDatabase(), ctx); if (connectionToRemoteDatabase().Sucessd) { ExcuteDataBaseResult excuteDataBaseResult = base.remoteExcuteDataBase.excuteStatement(SQLStatement, connectionToRemoteDatabase().Sqlconn); customSaveInfoObjList = handleData <CustomInfoSaveObject>(excuteDataBaseResult.Ds); if (!closeConnetction(connectionToRemoteDatabase().Sqlconn)) { //打印关闭连接 BussnessLog.WriteBussnessLog("", "数据库操作错误", model + "中间表取数后,关闭数据库连接失败! 请联系系统管理员!"); return; } } else { if (!closeConnetction(connectionToRemoteDatabase().Sqlconn)) { BussnessLog.WriteBussnessLog("", "数据库操作错误", model + "中间表取数前打开数据库连接失败! 请联系系统管理员!"); return; } } Dictionary <string, Result> statusMap = new Dictionary <string, Result>(); if (LoginAPI(model)) { foreach (CustomInfoSaveObject customSaveInfoObj in customSaveInfoObjList) { InvokeReturnHandle <InvokeResult> callResult = InvokeAPI(opearteList, customSaveInfoObj, InvokeCloudAPI.Login(model), ctx, formID, model); statusMap.Add(customSaveInfoObj.Model.Fnumber, callResult.CustomOpearteObject.Result); } List <string> getUpdateSQLStatements = new SQLStatement(model).getUpdateSQLStatement(model, statusMap); SqlConnection Sqlconn = connectionToRemoteDatabase().Sqlconn; foreach (string UpdateSQLStatement in getUpdateSQLStatements) { updateMiddleDataBase(UpdateSQLStatement, model, "t_kf_customer", Sqlconn); } if (!closeConnetction(Sqlconn)) { BussnessLog.WriteBussnessLog("", "数据库操作错误", model + "中间表数据更新后,关闭数据库连接失败! 请联系系统管理员!"); return; } } }
public override void Run(Context ctx, Schedule schedule) { //VoucherNumbers.Add("记", "PRE001"); //VoucherNumbers.Add("现收", "PRE002"); //VoucherNumbers.Add("现付", "PRE003"); //VoucherNumbers.Add("转", "PRE004"); //VoucherNumbers.Add("银收", "PZZ1"); //VoucherNumbers.Add("银付", "PZZ2"); SQLStatement = base.GetStatement(VouchSQLObject.Voucher); opearteList = GetOpearteList(VouchSQLObject.Voucher); if (connectionToRemoteDatabase().Sucessd) { ExcuteDataBaseResult excuteDataBaseResult = base.remoteExcuteDataBase.excuteStatement(SQLStatement, connectionToRemoteDatabase().Sqlconn); voucherSaveInfoObjList = handleData <VoucherInfoSaveObject>(excuteDataBaseResult.Ds); if (!closeConnetction(connectionToRemoteDatabase().Sqlconn)) { //打印关闭连接 BussnessLog.WriteBussnessLog("", "数据库操作错误", model + "中间表取数后,关闭数据库连接失败! 请联系系统管理员!"); return; } } else { if (!closeConnetction(connectionToRemoteDatabase().Sqlconn)) { //打印关闭连接 BussnessLog.WriteBussnessLog("", "数据库操作错误", model + "中间表取数前打开数据库连接失败! 请联系系统管理员!"); return; } } if (LoginAPI(model)) { Dictionary <string, Result> statusMap = new Dictionary <string, Result>(); foreach (VoucherInfoSaveObject voucherSaveInfoObj in voucherSaveInfoObjList) { InvokeReturnHandle <InvokeResult> callResult = InvokeAPI(opearteList, voucherSaveInfoObj, InvokeCloudAPI.Login(model), ctx, formID, model); statusMap.Add(voucherSaveInfoObj.Model.FVOUCHERGROUPNO, callResult.CustomOpearteObject.Result); } List <string> getUpdateSQLStatements = new SQLStatement(model).getUpdateSQLStatement(model, statusMap); SqlConnection Sqlconn = connectionToRemoteDatabase().Sqlconn; foreach (string UpdateSQLStatement in getUpdateSQLStatements) { updateMiddleDataBase(UpdateSQLStatement, model, "t_kf_voucher", Sqlconn); } if (!closeConnetction(Sqlconn)) { BussnessLog.WriteBussnessLog("", "数据库操作错误", model + "中间表数据更新后,关闭数据库连接失败! 请联系系统管理员!"); return; } } }
public override void Run(Context ctx, Schedule schedule) { SQLStatement = base.GetStatement(SupplierSQLObject.Supplier); opearteList = GetOpearteList(SupplierSQLObject.Supplier); //修改的单独处理 BussnessModify customerModify = new BussnessModify(); customerModify.excuteSQL(model, connectionToRemoteDatabase(), ctx); if (connectionToRemoteDatabase().Sucessd) { ExcuteDataBaseResult excuteDataBaseResult = base.remoteExcuteDataBase.excuteStatement(SQLStatement, connectionToRemoteDatabase().Sqlconn); supplierSaveInfoObjList = handleData <SupplierInfoSaveObject>(excuteDataBaseResult.Ds); if (!closeConnetction(connectionToRemoteDatabase().Sqlconn)) { //打印关闭连接 BussnessLog.WriteBussnessLog("", "数据库操作错误", model + "中间表取数后,关闭数据库连接失败! 请联系系统管理员!"); return; } } else { BussnessLog.WriteBussnessLog("", "数据库操作错误", model + "中间表取数前打开数据库连接失败! 请联系系统管理员!"); return; } if (LoginAPI(model)) { Dictionary <string, Result> statusMap = new Dictionary <string, Result>(); foreach (SupplierInfoSaveObject supplierSaveInfoObj in supplierSaveInfoObjList) { InvokeReturnHandle <InvokeResult> callResult = (InvokeReturnHandle <InvokeResult>)(object) InvokeAPI(opearteList, supplierSaveInfoObj, InvokeCloudAPI.Login(model), ctx, formID, model); statusMap.Add(supplierSaveInfoObj.Model.Fnumber, callResult.CustomOpearteObject.Result); } List <string> getUpdateSQLStatements = new SQLStatement(model).getUpdateSQLStatement(model, statusMap); // ExcuteDataBaseResult excuteDataBaseResult = remoteExcuteDataBase.excuteStatement(updateSQLStatement, connectionToRemoteDatabase().Sqlconn); SqlConnection Sqlconn = connectionToRemoteDatabase().Sqlconn; foreach (string UpdateSQLStatement in getUpdateSQLStatements) { updateMiddleDataBase(UpdateSQLStatement, model, "t_kf_supplier", Sqlconn); } if (!closeConnetction(Sqlconn)) { //打印关闭连接信息 BussnessLog.WriteBussnessLog("", "数据库操作错误", model + "中间表数据更新后,关闭数据库连接失败! 请联系系统管理员!"); return; } } }
public override void Run(Context ctx, Schedule schedule) { SQLStatement = base.GetStatement(PayableSQLObject.Payable); opearteList = GetOpearteList(PayableSQLObject.Payable); if (connectionToRemoteDatabase().Sucessd) { ExcuteDataBaseResult excuteDataBaseResult = base.remoteExcuteDataBase.excuteStatement(SQLStatement, connectionToRemoteDatabase().Sqlconn); payableSaveInfoObjList = handleData <PayableInfoSaveObject>(excuteDataBaseResult.Ds); } else { //打印 } if (LoginAPI(model)) { Dictionary <string, Result> statusMap = new Dictionary <string, Result>(); foreach (PayableInfoSaveObject payableSaveInfoObject in payableSaveInfoObjList) { InvokeReturnHandle <InvokeResult> callResult = InvokeAPI(opearteList, payableSaveInfoObject, InvokeCloudAPI.Login(model), ctx, formID, model); statusMap.Add(payableSaveInfoObject.Model.FBillNo, callResult.CustomOpearteObject.Result); } List <string> getUpdateSQLStatements = new SQLStatement(model).getUpdateSQLStatement(model, statusMap); SqlConnection Sqlconn = connectionToRemoteDatabase().Sqlconn; foreach (string UpdateSQLStatement in getUpdateSQLStatements) { updateMiddleDataBase(UpdateSQLStatement, model, "t_kf_payable", Sqlconn); } } }
public override void Run(Context ctx, Schedule schedule) { SQLStatement = base.GetStatement(ReceivableSQLObject.Receivable); opearteList = GetOpearteList(ReceivableSQLObject.Receivable); if (connectionToRemoteDatabase().Sucessd) { ExcuteDataBaseResult excuteDataBaseResult = base.remoteExcuteDataBase.excuteStatement(SQLStatement, connectionToRemoteDatabase().Sqlconn); receivableSaveInfoObjList = handleData <ReceivableInfoSaveObject>(excuteDataBaseResult.Ds); if (!closeConnetction(connectionToRemoteDatabase().Sqlconn)) { //打印关闭连接 BussnessLog.WriteBussnessLog("", "数据库操作错误", model + "中间表取数后,关闭数据库连接失败! 请联系系统管理员!"); return; } } else { if (!closeConnetction(connectionToRemoteDatabase().Sqlconn)) { //打印关闭连接 BussnessLog.WriteBussnessLog("", "数据库操作错误", model + "中间表取数前打开数据库连接失败! 请联系系统管理员!"); return; } } if (LoginAPI(model)) { Dictionary <string, Result> statusMap = new Dictionary <string, Result>(); foreach (ReceivableInfoSaveObject receivableInfoSaveObject in receivableSaveInfoObjList) { InvokeReturnHandle <InvokeResult> callResult = InvokeAPI(opearteList, receivableInfoSaveObject, InvokeCloudAPI.Login(model), ctx, formID, model); statusMap.Add(receivableInfoSaveObject.Model.FBillNo, callResult.CustomOpearteObject.Result); } List <string> getUpdateSQLStatements = new SQLStatement(model).getUpdateSQLStatement(model, statusMap); SqlConnection Sqlconn = connectionToRemoteDatabase().Sqlconn; foreach (string UpdateSQLStatement in getUpdateSQLStatements) { updateMiddleDataBase(UpdateSQLStatement, model, "t_kf_receivable", Sqlconn); } if (!closeConnetction(Sqlconn)) { BussnessLog.WriteBussnessLog("", "数据库操作错误", model + "中间表数据更新后,关闭数据库连接失败! 请联系系统管理员!"); return; } } }