Esempio n. 1
0
 private void init()
 {
     //1.读取配置文件
     readDataBaseConfig();
     //2.初始化 日志系统
     BussnessLog.createLogFileWithFunction(BaseInfo.ModelList);
 }
Esempio n. 2
0
        public bool updateKingDeeDataBase(string model, List <string> SQLStatement, Dictionary <string, UpdateFields> updateMap, Context ctx)
        {
            List <string> statementList = new List <string>();

            foreach (KeyValuePair <string, UpdateFields> kvp in updateMap)
            {
                if (string.Equals(CustomerSQLObject.Customer, model, StringComparison.CurrentCultureIgnoreCase))
                {
                    CustomerUpdateFields customerUpdateFields = (CustomerUpdateFields)kvp.Value;
                    string statement = string.Format(SQLStatement[0], customerUpdateFields.FName, kvp.Key);
                    statementList.Add(statement);
                    CustomerFnunbers.Add(kvp.Key);
                }
                if (string.Equals(SupplierSQLObject.Supplier, model, StringComparison.CurrentCultureIgnoreCase))
                {
                    SupplierUpdateFields supplierUpdateFields = (SupplierUpdateFields)kvp.Value;
                    string statement1 = string.Format(SQLStatement[0], supplierUpdateFields.FName, kvp.Key);
                    string statement2 = string.Format(SQLStatement[1], supplierUpdateFields.FbankCode, kvp.Key);
                    string statement3 = string.Format(SQLStatement[2], supplierUpdateFields.FopenBankName, kvp.Key);
                    SupplierFnumbers.Add(kvp.Key);

                    using (KDTransactionScope trans = new KDTransactionScope(System.Transactions.TransactionScopeOption.Required))
                    {
                        if (DBServiceHelper.Execute(ctx, statement1) > 0)
                        {
                            if (DBServiceHelper.Execute(ctx, statement2) > 0)
                            {
                                if (DBServiceHelper.Execute(ctx, statement3) > 0)
                                {
                                    BussnessLog.WriteBussnessLog("", model + "更新", "更新金蝶数据库成功! fnumber=" + kvp.Key);
                                }
                                else
                                {
                                    BussnessLog.WriteBussnessLog("", model + "更新", "更新金蝶数据库失败! fnumber=" + kvp.Key);
                                }
                            }
                        }
                        trans.Complete();
                    }
                }
            }

            if (DBServiceHelper.ExecuteBatch(ctx, statementList) > 0)
            {
                foreach (string s in statementList)
                {
                    BussnessLog.WriteBussnessLog("", model + "更新", "更新金蝶数据库成功! 更新语句=" + s);
                }
            }
            else
            {
                foreach (string s in statementList)
                {
                    BussnessLog.WriteBussnessLog("", model + "更新", "更新金蝶数据库失败! 更新语句=" + s);
                }
            }

            return(true);
        }
Esempio n. 3
0
        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;
                }
            }
        }
Esempio n. 4
0
        public InvokeReturnHandle <InvokeResult> InvokeAPI <T>(string[] opearteList, T t, Invoke.LoginResult loginResult, Context ctx, string formID, string model)
        {
            InvokeResult invokeResult = null;
            string       input        = null;
            string       outopt       = "";

            foreach (string opearte in opearteList)
            {
                BussnessLog.WriteBussnessLog(default(T), model, "操作=" + opearte);
                if (Save.Equals(opearte))
                {
                    BussnessLog.WriteBussnessLog(default(T), model, "input json=" + JsonExtension.ToJSON(t));
                    invokeResult = InvokeCloudAPI.InvokeFunction(JsonExtension.ToJSON(t), loginResult.client, formID, Save, model);
                }
                else
                {
                    input = JsonExtension.ToJSON(handleReturnMessage <InfoexceptAllocate>(invokeResult, opearte, model, ctx).CustomOpearteObject);
                    BussnessLog.WriteBussnessLog(default(T), model, "input json=" + input);
                    invokeResult = InvokeCloudAPI.InvokeFunction(input, loginResult.client, formID, opearte, model);
                }
                if (model.Equals("voucher") || model.Equals("payable") || model.Equals("receivable") || model.Equals("otherpayable") || model.Equals("otherrecable"))
                {
                    InvokeReturnHandle <InvokeResult> result = handleReturnMessage <InvokeResult>(invokeResult, opearte, model, ctx);
                    if (result.CustomOpearteObject.Result.ResponseStatus.IsSuccess)
                    {
                        BussnessLog.WriteBussnessLog(default(T), model, "操作=" + opearte + "成功!");
                    }
                    else
                    {
                        BussnessLog.WriteBussnessLog(default(T), model, "操作=" + opearte + "失败!");
                    }
                    return(result);
                }

                if (!handleReturnMessage <InfoexceptAllocate>(invokeResult, opearte, model, ctx).ReturnResult)
                {
                    outopt = opearte;
                    BussnessLog.WriteBussnessLog(default(T), model, "操作=" + opearte + "失败!");
                    InvokeReturnHandle <InvokeResult> aresult = new InvokeReturnHandle <InvokeResult>();
                    aresult.ReturnResult        = false;
                    aresult.CustomOpearteObject = invokeResult;
                    return(aresult);
                }
                else
                {
                    BussnessLog.WriteBussnessLog(default(T), model, "操作=" + opearte + "成功!");
                }
            }
            InvokeReturnHandle <InvokeResult> a = new InvokeReturnHandle <InvokeResult>();

            a.ReturnResult        = true;
            a.CustomOpearteObject = invokeResult;
            return(a);

            throw new NotImplementedException();
        }
Esempio n. 5
0
        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;
                }
            }
        }
Esempio n. 6
0
        public bool updateMiddleDataBase(string updateSQLStatement, string model, string tableName, SqlConnection Sqlconn)
        {
            BussnessLog.WriteBussnessLog("", "测试打印", "update=" + updateSQLStatement);
            ExcuteDataBaseResult excuteDataBaseResult = remoteExcuteDataBase.excuteStatement(updateSQLStatement, Sqlconn);

            if (!excuteDataBaseResult.Sucessd)
            {
                BussnessLog.WriteBussnessLog("", "更新中间数据库", "更新中间数据库,表=" + tableName + "错误, 操作模块=" + model);
                return(false);
            }
            return(true);
        }
Esempio n. 7
0
 public bool closeConnetction(SqlConnection sqlConn)
 {
     if (!remoteExcuteDataBase.closeConnection(sqlConn))
     {
         BussnessLog.WriteBussnessLog("", "数据库操作错误", "关闭数据库错误!");
         return(false);
     }
     else
     {
         return(true);
     }
 }
Esempio n. 8
0
        public ConnectionResult connectionToRemoteDatabase()
        {
            remoteExcuteDataBase = new RemoteExcuteDataBase(DataBaseInfo.IP, DataBaseInfo.database, DataBaseInfo.userid, DataBaseInfo.password);
            if (!remoteExcuteDataBase.connectionToRemoteDatabase().Sucessd)
            {
                BussnessLog.WriteBussnessLog(remoteExcuteDataBase, "DATABASE", "");
                remoteExcuteDataBase.Result = false;
            }
            remoteExcuteDataBase.Result = true;
            ConnectionResult result = remoteExcuteDataBase.connectionToRemoteDatabase();

            return(result);
        }
Esempio n. 9
0
        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;
                }
            }
        }
Esempio n. 10
0
        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;
                }
            }
        }
Esempio n. 11
0
        public void excuteSQL(string model, ConnectionResult result, Context ctx)
        {
            BussnessLog.WriteBussnessLog("", model + "更新", "开始更新");
            if (string.Equals(CustomerSQLObject.Customer, model, StringComparison.CurrentCultureIgnoreCase))
            {
                SQLStatement       = "SELECT FNUMBER,FNAME FROM T_KF_CUSTOMER WHERE FSTATUS = 3";
                UpdateSQLStatement = "UPDATE T_BD_CUSTOMER_L SET FNAME = '{0}' WHERE FCUSTID = (SELECT FCUSTID FROM T_BD_CUSTOMER WHERE FNUMBER = '{1}')";
                UpdateSQLStatementList.Add(UpdateSQLStatement);
            }
            if (string.Equals(SupplierSQLObject.Supplier, model, StringComparison.CurrentCultureIgnoreCase))
            {
                SQLStatement        = "SELECT FNUMBER,FNAME,FOPENBANKNAME,FBANKCODE FROM T_KF_SUPPLIER WHERE FSTATUS = 3";
                UpdateSQLStatement1 = " UPDATE T_BD_SUPPLIER_L SET FNAME = '{0}' WHERE FSUPPLIERID IN (SELECT FSUPPLIERID FROM T_BD_SUPPLIER WHERE FNUMBER='{1}')";
                UpdateSQLStatement2 = " UPDATE T_BD_SUPPLIERBANK SET FBANKCODE = '{0}' WHERE FSUPPLIERID IN (SELECT FSUPPLIERID FROM T_BD_SUPPLIER WHERE FNUMBER='{1}')";
                UpdateSQLStatement3 = "UPDATE T_BD_SUPPLIERBANK_L SET FOPENBANKNAME = '{0}' WHERE FBANKID IN (SELECT  FBANKID FROM T_BD_SUPPLIER T1 LEFT JOIN T_BD_SUPPLIERBANK T2 ON T1.FSUPPLIERID = T2.FSUPPLIERID WHERE T1.FNUMBER ='{1}')";
                UpdateSQLStatementList.Add(UpdateSQLStatement1);
                UpdateSQLStatementList.Add(UpdateSQLStatement2);
                UpdateSQLStatementList.Add(UpdateSQLStatement3);
            }
            RemoteExcuteDataBase dbOjbect   = new RemoteExcuteDataBase(DataBaseInfo.IP, DataBaseInfo.database, DataBaseInfo.userid, DataBaseInfo.password);
            ExcuteDataBaseResult dataResult = dbOjbect.excuteStatement(SQLStatement, result.Sqlconn);

            if (dataResult.Ds.Tables[0].Rows.Count <= 0)
            {
                BussnessLog.WriteBussnessLog("", model + "更新", "无字段需要更新");
                return;
            }
            //取数
            Dictionary <string, UpdateFields> updateMap = getUpdateFields(model, dataResult);

            //更新金蝶数据库
            if (updateKingDeeDataBase(model, UpdateSQLStatementList, updateMap, ctx))
            {
                //更新中间表数据库
                updateMiddleDataBase(model, dataResult, result, dbOjbect);
                BussnessLog.WriteBussnessLog("", model + "更新", "更新金蝶数据库成功!");
            }


            //关闭
            //if (dbOjbect.closeConnection(result.Sqlconn))
            //{
            //    BussnessLog.WriteBussnessLog("", model + "更新", "更新结束,关闭数据库连接成功!");
            //}
            //else {
            //    BussnessLog.WriteBussnessLog("", model + "更新", "更新结束,关闭数据库连接失败!");
            //}
        }
Esempio n. 12
0
        public InvokeReturnHandle <T> handleReturnMessage <T>(InvokeResult invokeResult, string opearte, string model, Context ctx)
        {
            InvokeReturnHandle <T> invokeReturnHandle = new InvokeReturnHandle <T>();

            if (invokeResult == null)
            {
                BussnessLog.WriteBussnessLog(default(T), model, "调用模块=" + model + ",调用方法=" + opearte + ",返回为NULL");
            }
            if (model.Equals("voucher") || model.Equals("payable") || model.Equals("receivable") || model.Equals("otherpayable") || model.Equals("otherrecable"))
            {
                if (!invokeResult.Result.ResponseStatus.IsSuccess)
                {
                    BussnessLog.WriteBussnessLog(invokeResult, model, "");
                    invokeReturnHandle.ReturnResult = false;
                }
                else
                {
                    invokeReturnHandle.ReturnResult = true;
                }
                invokeReturnHandle.CustomOpearteObject = (T)(object)invokeResult;
                return(invokeReturnHandle);
            }

            if (!invokeResult.Result.ResponseStatus.IsSuccess)
            {
                invokeReturnHandle.ReturnResult = false;
                return(invokeReturnHandle);
            }

            List <SuccessEntitysItem> entries = invokeResult.Result.ResponseStatus.SuccessEntitys;

            InfoexceptAllocate infoexceptAllocateObject = new InfoexceptAllocate();
            List <string>      numbers = new List <string>();
            List <string>      pkids   = new List <string>();

            foreach (SuccessEntitysItem entry in entries)
            {
                numbers.Add(entry.Number.ToString());
                pkids.Add(entry.Id.ToString());
            }
            infoexceptAllocateObject.Numbers       = numbers.ToArray();
            invokeReturnHandle.CustomOpearteObject = (T)(object)infoexceptAllocateObject;
            invokeReturnHandle.ReturnResult        = true;
            return(invokeReturnHandle);

            throw new NotImplementedException();
        }
Esempio n. 13
0
        //public override bool InvokeAPI<T>(string[] opearteList, T t, LoginResult loginResult, Context ctx)
        //{
        //    InvokeResult invokeResult = null;
        //    string input = null;
        //    foreach (string opearte in opearteList)
        //    {
        //        BussnessLog.WriteBussnessLog(default(T), model, "操作=" + opearte);
        //        if (Save.Equals(opearte))
        //        {
        //            BussnessLog.WriteBussnessLog(default(T),model,"input json=" + JsonExtension.ToJSON(t));
        //            invokeResult = InvokeCloudAPI.InvokeFunction(JsonExtension.ToJSON(t), loginResult.client, formID, Save, model);
        //        }
        //        else
        //        {
        //            input = JsonExtension.ToJSON(handleReturnMessage<SupplierInfoexceptAllocate>(invokeResult, opearte, model, ctx).CustomOpearteObject);
        //            BussnessLog.WriteBussnessLog(default(T),model,"input json=" + input);
        //            invokeResult = InvokeCloudAPI.InvokeFunction(input, loginResult.client, formID, opearte, Save);
        //        }
        //        if (!handleReturnMessage<SupplierInfoexceptAllocate>(invokeResult, opearte, model, ctx).ReturnResult)
        //        {
        //            break;
        //        }
        //        else {
        //            BussnessLog.WriteBussnessLog(default(T), model, "操作=" + opearte + "成功!");
        //        }
        //    }
        //    return true;
        //    throw new NotImplementedException();
        //}

        public override List <T> handleData <T>(DataSet dataSet)
        {
            List <SupplierInfoSaveObject> supplierSaveInfoObjList = new List <SupplierInfoSaveObject>();

            for (int i = 0; i < dataSet.Tables[0].Rows.Count; i++)
            {
                SupplierInfoSaveObject supplierSaveInfoObj    = new SupplierInfoSaveObject();
                application.supplier.supplierSave.Model model = new application.supplier.supplierSave.Model();
                FFinanceInfo         fFinanceInfo             = new FFinanceInfo();
                FLocationInfo        fLocationInfo            = new FLocationInfo();
                List <FLocationInfo> fLocationInfoList        = new List <FLocationInfo>();
                List <FBankInfo>     fBankInfoList            = new List <FBankInfo>();
                FBankInfo            fBankInfo      = new FBankInfo();
                FCreateOrgId         fCreateOrgId   = new FCreateOrgId();
                FUseOrgId            fUseOrgId      = new FUseOrgId();
                FPayCurrencyId       fPayCurrencyId = new FPayCurrencyId();
                FLocNewContact       fLocNewContact = new FLocNewContact();
                fCreateOrgId.FNumber        = "9999";
                model.FCreateOrgId          = fCreateOrgId;
                fUseOrgId.FNumber           = "9999";
                model.FUseOrgId             = fUseOrgId;
                fPayCurrencyId.Fnumber      = "PRE001";
                fFinanceInfo.FPayCurrencyId = fPayCurrencyId;
                fBankInfo.FOpenBankName     = dataSet.Tables[0].Rows[i]["FopenBankName"].ToString();
                fBankInfo.FBankCode         = dataSet.Tables[0].Rows[i]["FbankCode"].ToString();
                fBankInfo.FBankHolder       = dataSet.Tables[0].Rows[i]["FbankHolder"].ToString();
                fBankInfoList.Add(fBankInfo);
                model.Fnumber = dataSet.Tables[0].Rows[i]["fnumber"].ToString();
                model.FName   = dataSet.Tables[0].Rows[i]["fname"].ToString();
                if (model.Fnumber.Contains("-") || model.FName.Contains("未知"))
                {
                    BussnessLog.WriteBussnessLog("", "中间数据库取数", "中间数据库取数错误,编码=" + model.Fnumber + ",客户名称=" + model.FName);
                    continue;
                }
                model.FBankInfo           = fBankInfoList.ToArray();
                model.FFinanceInfo        = fFinanceInfo;
                supplierSaveInfoObj.Model = model;
                supplierSaveInfoObjList.Add(supplierSaveInfoObj);
            }

            return((List <T>)(object) supplierSaveInfoObjList);

            throw new NotImplementedException();
        }
Esempio n. 14
0
        public override List <T> handleData <T>(DataSet dataSet)
        {
            List <CustomInfoSaveObject> customSaveInfoObjList = new List <CustomInfoSaveObject>();

            for (int i = 0; i < dataSet.Tables[0].Rows.Count; i++)
            {
                CustomInfoSaveObject customSaveInfoObj = new CustomInfoSaveObject();
                Model          model          = new Model();
                FCreateOrgId   fcreateOrgID   = new FCreateOrgId();
                FGroup         fGroup         = new FGroup();
                FSALGROUPID    fsalGroupID    = new FSALGROUPID();
                FTRADINGCURRID ftradingCurrID = new FTRADINGCURRID();
                FUseOrgId      fUserOrgId     = new FUseOrgId();
                fcreateOrgID.FNumber = "9999";
                //fGroup.fNumber = "KH001";
                fsalGroupID.fNumber    = "0";
                ftradingCurrID.fNumber = "PRE001";
                fUserOrgId.FNumber     = "9999";

                model.Fnumber = dataSet.Tables[0].Rows[i]["fnumber"].ToString();
                model.FName   = dataSet.Tables[0].Rows[i]["fname"].ToString();
                if (model.Fnumber.Contains("-") || model.FName.Contains("未知"))
                {
                    BussnessLog.WriteBussnessLog("", "中间数据库取数", "中间数据库取数错误,编码=" + model.Fnumber + ",客户名称=" + model.FName);
                    continue;
                }
                model.FCreateOrgId = fcreateOrgID;
                //model.FGroup = fGroup;
                model.FsalGroupID       = fsalGroupID;
                model.FtradingCurrID    = ftradingCurrID;
                model.FUseOrgId         = fUserOrgId;
                customSaveInfoObj.Model = model;
                customSaveInfoObjList.Add(customSaveInfoObj);
            }
            return((List <T>)(object) customSaveInfoObjList);

            throw new NotImplementedException();
        }
Esempio n. 15
0
 public void updateMiddleDataBase(string model, ExcuteDataBaseResult dataResult, ConnectionResult result, RemoteExcuteDataBase dbOjbect)
 {
     if (string.Equals(CustomerSQLObject.Customer, model, StringComparison.CurrentCultureIgnoreCase))
     {
         foreach (string s in CustomerFnunbers)
         {
             SQLStatement = "UPDATE T_KF_CUSTOMER SET FSTATUS = 1, FResultMessage=' ', FLASTUPDATETIME='{0}' WHERE FNUMBER = '{1}'";
             string mSQL = string.Format(SQLStatement, System.DateTime.Now, s);
             ExcuteDataBaseResult excuteResult = dbOjbect.excuteStatement(mSQL, result.Sqlconn);
             if (!excuteResult.Sucessd)
             {
                 BussnessLog.WriteBussnessLog("", model + "更新", "更新中间表失败! fnumber=" + s);
             }
             else
             {
                 BussnessLog.WriteBussnessLog("", model + "更新", "更新中间表成功!");
             }
         }
     }
     if (string.Equals(SupplierSQLObject.Supplier, model, StringComparison.CurrentCultureIgnoreCase))
     {
         foreach (string s in SupplierFnumbers)
         {
             SQLStatement = "UPDATE T_KF_SUPPLIER SET FSTATUS = 1, FResultMessage=' ', FLastUpdateTime = '{0}'  WHERE FNUMBER = '{1}'";
             string mSQL = string.Format(SQLStatement, System.DateTime.Now, s);
             ExcuteDataBaseResult excuteResult = dbOjbect.excuteStatement(mSQL, result.Sqlconn);
             if (!excuteResult.Sucessd)
             {
                 BussnessLog.WriteBussnessLog("", model + "更新", "更新中间表失败! fnumber = " + s);
             }
             else
             {
                 BussnessLog.WriteBussnessLog("", model + "更新", "更新中间表成功!");
             }
         }
     }
 }