public static string GetDBInfoMisa(out DbMisaInfo oMisaInfo) { string msg = Exec.ExecQueryStringOne(string.Format(@"SELECT (SELECT OptionValue FROM dbo.DBOption WHERE OptionID = 'CompanyCode') AS CompanyID , (SELECT OptionValue FROM dbo.DBOption WHERE OptionID = 'CompanyName') AS CompanyName, (SELECT Version FROM DBInfo) AS ExportVersion, 0 AS ParticularID, (SELECT Application + ' ' + Version FROM DBInfo) AS ProductID, (SELECT MISAVersionControl FROM DBInfo) AS Version, (SELECT OptionValue FROM dbo.DBOption WHERE OptionID='DefaultBudgetChapterCode') AS BudgetChapterID, (SELECT OptionValue FROM dbo.DBOption WHERE OptionID='DefaultBudgetKindItemCode') AS BudgetKindItemID, (SELECT OptionValue FROM dbo.DBOption WHERE OptionID='DefaultBudgetSubKindItemCode') AS BudgetSubKindItemID, (SELECT OptionValue FROM DBOption WHERE OptionID = 'DBStartDate') AS StartDate, (SELECT OptionValue FROM DBOption WHERE OptionID = 'AccountSystem') AS AccountSystem"), out oMisaInfo); if (msg.Length > 0) { return(Msg.Exec_GetDBInfoMisa_Err); } if (string.IsNullOrEmpty(oMisaInfo.StartDate)) { oMisaInfo.StartDate = new DateTime(DateTime.Now.Year, 1, 1).ToString("yyyy-MM-dd HH:mm:ss"); } DateTime startDateConvert = Convert.ToDateTime(oMisaInfo.StartDate); oMisaInfo.StartDate = startDateConvert.ToString("yyyy-MM-dd HH:mm:ss"); return(""); }
public F01_02_P2BCQT_Sync(DbMisaInfo dbMisaInfo, string urlAPI, string token, IConfiguration configuration, IMapper mapper) { _dbMisaInfo = dbMisaInfo; _urlAPI = urlAPI; _token = token; _configuration = configuration; _mapper = mapper; }
private void DoWork(DbMisaInfo oMisaInfo, string urlAPI, string access_token) { DoWorkB01BCTC(oMisaInfo, urlAPI, access_token); WriteLog("-------------------------------------"); DoWorkB02BCTC(oMisaInfo, urlAPI, access_token); WriteLog("-------------------------------------"); DoWorkB03bBCTC(oMisaInfo, urlAPI, access_token); WriteLog("-------------------------------------"); DoWorkB04BCTC(oMisaInfo, urlAPI, access_token); WriteLog("-------------------------------------"); DoWorkB01BCQT(oMisaInfo, urlAPI, access_token); WriteLog("-------------------------------------"); DoWorkB03TT90(oMisaInfo, urlAPI, access_token); WriteLog("-------------------------------------"); DoWorkB04TT90(oMisaInfo, urlAPI, access_token); WriteLog("-------------------------------------"); DoWorkF01_01BCQT(oMisaInfo, urlAPI, access_token); WriteLog("-------------------------------------"); DoWorkF01_02_P1BCQT(oMisaInfo, urlAPI, access_token); WriteLog("-------------------------------------"); DoWorkF01_02_P2BCQT(oMisaInfo, urlAPI, access_token); WriteLog("-------------------------------------"); }
private async void DoWorkF01_02_P2BCQT(DbMisaInfo oMisaInfo, string urlAPI, string access_token) { WriteLog("--> Bắt đầu gửi dữ liệu báo cáo F01_02_P2BCQT <--"); F01_02_P2BCQT_Sync f01_02_P2BCQT = new F01_02_P2BCQT_Sync(oMisaInfo, urlAPI, access_token, _configuration, _mapper); Result result = await f01_02_P2BCQT.SendDataToAPI(); if (result.IsFailed) { IEnumerable <Reason> reasons = result.Reasons; WriteLog("Xảy ra lỗi gửi dữ liệu báo cáo F01_02_P2BCQT:"); WriteLog(reasons.FirstOrDefault().Message); return; } IEnumerable <Success> successes = result.Successes; string msg = Convertor.StringToObject(successes.FirstOrDefault().Message, out ResponseObj resObj); if (msg.Length > 0) { WriteLog(Msg.Convert_ResponseObj_Err); } WriteLog(string.IsNullOrEmpty(resObj.Message) ? "Gửi dữ liệu thành công báo cáo F01_02_P2BCQT" : resObj.Message); WriteLog("--> Kết thúc gửi dữ liệu báo cáo F01_02_P2BCQT <--"); }