You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

723 lines
26 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.IO;
  7. using System.Security.Cryptography;
  8. using System.Data;
  9. using System.Data.Sql;
  10. using System.Data.SqlClient;
  11. using System.Windows.Forms;
  12. using System.Configuration;
  13. using System.Drawing;
  14. namespace ManagementSystem.Utility
  15. {
  16. public static class UtilityClass
  17. {
  18. #region 加解密相關
  19. /// <summary>
  20. /// 進行DES加密
  21. /// </summary>
  22. /// <param name="pToEncrypt">要加密的字串</param>
  23. /// <param name="key">金鑰,必須為8位</param>
  24. /// <returns>以Base64格式返回的加密字串</returns>
  25. public static string EncryptDES(string pToEncrypt, string sKey)
  26. {
  27. using (DESCryptoServiceProvider des = new DESCryptoServiceProvider())
  28. {
  29. byte[] inputByteArray = Encoding.UTF8.GetBytes(pToEncrypt);
  30. des.Key = ASCIIEncoding.ASCII.GetBytes(sKey);
  31. des.IV = ASCIIEncoding.ASCII.GetBytes(sKey);
  32. System.IO.MemoryStream ms = new System.IO.MemoryStream();
  33. using (CryptoStream cs = new CryptoStream(ms, des.CreateEncryptor(), CryptoStreamMode.Write))
  34. {
  35. cs.Write(inputByteArray, 0, inputByteArray.Length);
  36. cs.FlushFinalBlock();
  37. cs.Close();
  38. }
  39. string str = Convert.ToBase64String(ms.ToArray());
  40. ms.Close();
  41. return str;
  42. }
  43. }
  44. public static string DecryptDES(string pToDecrypt, string sKey)
  45. {
  46. try
  47. {
  48. //判斷是否為空值
  49. if (pToDecrypt == "")
  50. {
  51. return "";
  52. }
  53. byte[] inputByteArray = Convert.FromBase64String(pToDecrypt);
  54. using (DESCryptoServiceProvider des = new DESCryptoServiceProvider())
  55. {
  56. des.Key = ASCIIEncoding.ASCII.GetBytes(sKey);
  57. des.IV = ASCIIEncoding.ASCII.GetBytes(sKey);
  58. MemoryStream ms = new MemoryStream();
  59. using (CryptoStream cs = new CryptoStream(ms, des.CreateDecryptor(), CryptoStreamMode.Write))
  60. {
  61. cs.Write(inputByteArray, 0, inputByteArray.Length);
  62. cs.FlushFinalBlock();
  63. cs.Close();
  64. }
  65. string str = Encoding.UTF8.GetString(ms.ToArray());
  66. ms.Close();
  67. return str;
  68. }
  69. }
  70. catch (Exception ex)
  71. {
  72. return "";
  73. }
  74. }
  75. public static string EncryptDES(int pToEncrypt, string sKey)
  76. {
  77. return EncryptDES(pToEncrypt.ToString(), sKey);
  78. }
  79. #endregion
  80. #region 取得系統參數資料
  81. public static DataSet GetSystemArgument(string strSysArgumentClassID, string strLanguageID)
  82. {
  83. DataSet dsData = new DataSet();
  84. try
  85. {
  86. string strCommand = string.Format("Select ArgumentID,ArgumentValue,LanguageID,OrderByValue From OTB_SYS_Arguments Where ArgumentClassID='{0}'", strSysArgumentClassID);
  87. if (strLanguageID != "")
  88. {
  89. strCommand += string.Format(" And LanguageID = '{0}'", strLanguageID);
  90. }
  91. using (SqlConnection sqlConn = GetConn(MainForm.strAccountingBookID))
  92. {
  93. using (SqlDataAdapter sqlAdapter = new SqlDataAdapter(strCommand, sqlConn))
  94. {
  95. if (sqlConn.State == ConnectionState.Closed) //判斷連線狀態
  96. {
  97. sqlConn.Open();
  98. }
  99. sqlAdapter.Fill(dsData, "Arguments");
  100. //增加空白選項
  101. DataRow drData = dsData.Tables["Arguments"].NewRow();
  102. drData["ArgumentID"] = " ";
  103. drData["ArgumentValue"] = "請選擇";
  104. drData["OrderByValue"] = 0;
  105. dsData.Tables["Arguments"].Rows.Add(drData);
  106. //資料進行排序
  107. dsData.Tables["Arguments"].DefaultView.Sort = "OrderByValue ASC";
  108. }
  109. }
  110. return dsData;
  111. }
  112. catch (Exception ex)
  113. {
  114. throw ex;
  115. }
  116. }
  117. #endregion
  118. #region 取得組織結構
  119. public static DataSet GetOrgList()
  120. {
  121. DataSet dsData = new DataSet();
  122. try
  123. {
  124. string strCommand = string.Format("Select OrganizationID,OrganizationName From OTB_SYS_Organization Where Effective='Y'");
  125. using (SqlConnection sqlConn = GetConn(MainForm.strAccountingBookID))
  126. {
  127. using (SqlDataAdapter sqlAdapter = new SqlDataAdapter(strCommand, sqlConn))
  128. {
  129. if (sqlConn.State == ConnectionState.Closed) //判斷連線狀態
  130. {
  131. sqlConn.Open();
  132. }
  133. sqlAdapter.Fill(dsData, "Organizations");
  134. //增加空白選項
  135. DataRow drData = dsData.Tables["Organizations"].NewRow();
  136. drData["OrganizationID"] = " ";
  137. drData["OrganizationName"] = "請選擇";
  138. dsData.Tables["Organizations"].Rows.Add(drData);
  139. //資料進行排序
  140. dsData.Tables["Organizations"].DefaultView.Sort = "OrganizationID ASC";
  141. }
  142. }
  143. return dsData;
  144. }
  145. catch (Exception ex)
  146. {
  147. throw ex;
  148. }
  149. }
  150. public static DataSet GetOrganization()
  151. {
  152. DataSet dsData = new DataSet();
  153. try
  154. {
  155. string strCommand = string.Format("Select DepartmentID,DepartmentName,DepartmentShortName,ParentDepartmentID,LevelOfDepartment,OrderByValue From OTB_SYS_Departments Where Effective='Y'");
  156. using (SqlConnection sqlConn = GetConn(MainForm.strAccountingBookID))
  157. {
  158. using (SqlDataAdapter sqlAdapter = new SqlDataAdapter(strCommand, sqlConn))
  159. {
  160. if (sqlConn.State == ConnectionState.Closed) //判斷連線狀態
  161. {
  162. sqlConn.Open();
  163. }
  164. sqlAdapter.Fill(dsData, "Departments");
  165. //增加資料
  166. foreach (DataRow drDatas in dsData.Tables["Departments"].Rows)
  167. {
  168. drDatas["DepartmentName"] = GetOrgTree(drDatas["DepartmentID"].ToString());
  169. }
  170. //增加空白選項
  171. DataRow drData = dsData.Tables["Departments"].NewRow();
  172. drData["DepartmentID"] = " ";
  173. drData["DepartmentName"] = "請選擇";
  174. drData["OrderByValue"] = 0;
  175. dsData.Tables["Departments"].Rows.Add(drData);
  176. //資料進行排序
  177. dsData.Tables["Departments"].DefaultView.Sort = "LevelOfDepartment ASC, OrderByValue ASC";
  178. }
  179. }
  180. return dsData;
  181. }
  182. catch (Exception ex)
  183. {
  184. throw ex;
  185. }
  186. }
  187. public static string GetOrgTree(string strOrgID)
  188. {
  189. try
  190. {
  191. DataSet dsData = new DataSet();
  192. string strCommand = string.Format("Select DepartmentName,DepartmentShortName,ParentDepartmentID From OTB_SYS_Departments Where DepartmentID = '{0}'", strOrgID);
  193. using (SqlConnection sqlConn = GetConn(MainForm.strAccountingBookID))
  194. {
  195. using (SqlDataAdapter sqlAdapter = new SqlDataAdapter(strCommand, sqlConn))
  196. {
  197. if (sqlConn.State == ConnectionState.Closed) //判斷連線狀態
  198. {
  199. sqlConn.Open();
  200. }
  201. sqlAdapter.Fill(dsData, "Departments");
  202. if (dsData.Tables["Departments"].Rows[0]["ParentDepartmentID"].ToString().Trim() == "")
  203. {
  204. return dsData.Tables["Departments"].Rows[0]["DepartmentName"].ToString().Trim();
  205. }
  206. else
  207. {
  208. return GetOrgTree(dsData.Tables["Departments"].Rows[0]["ParentDepartmentID"].ToString().Trim()) + "-" + dsData.Tables["Departments"].Rows[0]["DepartmentName"].ToString().Trim();
  209. }
  210. }
  211. }
  212. }
  213. catch (Exception ex)
  214. {
  215. throw ex;
  216. }
  217. }
  218. #endregion
  219. #region 取得指定Table資料
  220. public static DataSet GetTable(string strTableName, string[] strColumnList , string strWhere, string strOrderBy)
  221. {
  222. DataSet dsData = new DataSet();
  223. try
  224. {
  225. string strColumns = "";
  226. foreach (string strColumn in strColumnList) //取得欄位陣列
  227. {
  228. if (strColumns != "")
  229. {
  230. strColumns += "," + strColumn.Trim();
  231. }
  232. else
  233. {
  234. strColumns = strColumn;
  235. }
  236. }
  237. string strCommand = string.Format("Select {0} From {1} ",strColumns, strTableName);
  238. if (strWhere != "") //設定過濾條件
  239. {
  240. strCommand += " Where " + strWhere;
  241. }
  242. if (strOrderBy != "") //取得排序欄位
  243. {
  244. strCommand += " Order By " + strOrderBy;
  245. }
  246. using (SqlConnection sqlConn = GetConn(MainForm.strAccountingBookID))
  247. {
  248. using (SqlDataAdapter sqlAdapter = new SqlDataAdapter(strCommand, sqlConn))
  249. {
  250. if (sqlConn.State == ConnectionState.Closed) //判斷連線狀態
  251. {
  252. sqlConn.Open();
  253. }
  254. sqlAdapter.Fill(dsData, "Result");
  255. }
  256. }
  257. return dsData;
  258. }
  259. catch (Exception ex)
  260. {
  261. throw ex;
  262. }
  263. }
  264. public static DataSet GetTable(string strTableName, string[] strColumnList, string strWhere)
  265. {
  266. return GetTable(strTableName, strColumnList, strWhere, "");
  267. }
  268. public static DataSet GetTable(string strTableName, string[] strColumnList)
  269. {
  270. return GetTable(strTableName, strColumnList,"","");
  271. }
  272. public static DataSet GetTable(string strTableName)
  273. {
  274. return GetTable(strTableName,new string[] {"*"}, "", "");
  275. }
  276. #endregion
  277. #region SQL命令相關程式集
  278. public static SqlConnection GetConn(string strOrg)
  279. {
  280. string strConn = "";
  281. SqlConnection sqlConn = null;
  282. switch(strOrg)
  283. {
  284. case "":
  285. strConn = System.Configuration.ConfigurationManager.ConnectionStrings["OrigtekSQLConn"].ToString();
  286. sqlConn = new SqlConnection(strConn);
  287. break;
  288. case "Origtek":
  289. strConn = System.Configuration.ConfigurationManager.ConnectionStrings["OrigtekSQLConn"].ToString();
  290. sqlConn = new SqlConnection(strConn);
  291. break;
  292. case "OrigtekEnergy":
  293. strConn = System.Configuration.ConfigurationManager.ConnectionStrings["OEnergySQLConn"].ToString();
  294. sqlConn = new SqlConnection(strConn);
  295. break;
  296. }
  297. return sqlConn;
  298. }
  299. public static SqlConnection GetConn()
  300. {
  301. return GetConn("");
  302. }
  303. public static DataSet GetSQLResult(string strSQL)
  304. {
  305. DataSet dsData = new DataSet();
  306. try
  307. {
  308. using (SqlConnection sqlConn = GetConn(MainForm.strAccountingBookID))
  309. {
  310. using (SqlDataAdapter sqlAdapter = new SqlDataAdapter(strSQL, sqlConn))
  311. {
  312. if (sqlConn.State == ConnectionState.Closed) //判斷連線狀態
  313. {
  314. sqlConn.Open();
  315. }
  316. sqlAdapter.Fill(dsData, "Result");
  317. }
  318. }
  319. return dsData;
  320. }
  321. catch(Exception ex)
  322. {
  323. throw ex;
  324. }
  325. }
  326. public static bool IsExist(string strSQL)
  327. {
  328. try
  329. {
  330. DataSet sdResult = GetSQLResult(strSQL);
  331. DataTable dtResult = sdResult.Tables[0];
  332. if (dtResult.Rows.Count > 0)
  333. { return true; }
  334. else
  335. { return false; }
  336. }
  337. catch (Exception ex)
  338. {
  339. throw ex;
  340. }
  341. }
  342. public static bool RunSQLNonReturn(string strSQL)
  343. {
  344. try
  345. {
  346. SqlConnection sqlConn = GetConn(MainForm.strAccountingBookID);
  347. SqlCommand sqlCmd = new SqlCommand(strSQL, sqlConn);
  348. if (sqlConn.State == ConnectionState.Closed) //判斷連線狀態
  349. {
  350. sqlConn.Open();
  351. }
  352. sqlCmd.ExecuteNonQuery();
  353. return true;
  354. }
  355. catch (Exception ex)
  356. {
  357. return false;
  358. }
  359. }
  360. #endregion
  361. #region 其它共用程式
  362. public static bool IsNumber(string strSource)
  363. {
  364. float output;
  365. return float.TryParse(strSource, out output);
  366. } //確認是否為數字
  367. public static bool IsDate(string strSource)
  368. {
  369. try
  370. {
  371. //System.Globalization.DateTimeFormatInfo dtInfo = new System.Globalization.DateTimeFormatInfo();
  372. //dtInfo.FullDateTimePattern = "yyyy/MM/dd";
  373. //DateTime dtOutput = DateTime.ParseExact(strSource, "F", dtInfo);
  374. DateTime dtOutput;
  375. if (DateTime.TryParse(strSource, out dtOutput))
  376. {
  377. return true;
  378. }
  379. else
  380. {
  381. return false;
  382. }
  383. }
  384. catch(Exception ex)
  385. {
  386. return false;
  387. }
  388. }
  389. public static string MarkNumber(double dbNumber,int intPoint) //將資料加上三位一撇
  390. {
  391. return string.Format("{0:N" + intPoint + "}", dbNumber);
  392. }
  393. public static string MarkNumber(int intNumber, int intPoint) //將資料加上三位一撇
  394. {
  395. return string.Format("{0:N" + intPoint + "}", intNumber);
  396. }
  397. public static string MarkNumber(string strNumber, int intPoint) //將資料加上三位一撇
  398. {
  399. if (strNumber.IndexOf("%") != -1)
  400. {
  401. return strNumber;
  402. }
  403. if (!string.IsNullOrEmpty(strNumber))
  404. {
  405. if (IsNumber(strNumber))
  406. {
  407. return MarkNumber(Convert.ToDouble(strNumber), intPoint);
  408. }
  409. }
  410. return "";
  411. }
  412. public static string MarkNumber(double dbNumber) //將資料加上三位一撇
  413. {
  414. return string.Format("{0:N0}", dbNumber);
  415. }
  416. public static string MarkNumber(int intNumber) //將資料加上三位一撇
  417. {
  418. return string.Format("{0:N0}", intNumber);
  419. }
  420. public static string MarkNumber(string strNumber) //將資料加上三位一撇
  421. {
  422. if (!string.IsNullOrEmpty(strNumber))
  423. {
  424. if (strNumber.IndexOf("%") != -1)
  425. {
  426. return strNumber;
  427. }
  428. if (IsNumber(strNumber))
  429. {
  430. return MarkNumber(Math.Round(Convert.ToDouble(strNumber)));
  431. }
  432. }
  433. return "";
  434. }
  435. public static DataTable GetAccountingSubjectByID(string strAccountingSubID, string strAccountingBookID)
  436. {
  437. try
  438. {
  439. DataTable dtTemp = new DataTable();
  440. if (strAccountingSubID.Trim() != "")
  441. {
  442. //宣告物件
  443. string strSQL = string.Format("Select AccountingSubID, AccountingClass, DCClass, AccountingSubName From OTB_FNC_AccountingSubjects Where AccountingSubID = '{0}' And AccountingBookID = '{1}'", strAccountingSubID, strAccountingBookID);
  444. using (SqlConnection sqlConn = GetConn(MainForm.strAccountingBookID))
  445. {
  446. using (SqlDataAdapter sqlAdapter = new SqlDataAdapter())
  447. {
  448. //添加參數
  449. sqlAdapter.SelectCommand = new SqlCommand();
  450. sqlAdapter.SelectCommand.Connection = sqlConn;
  451. sqlAdapter.SelectCommand.CommandText = strSQL;
  452. if (sqlConn.State == ConnectionState.Closed) //判斷連線狀態
  453. {
  454. sqlConn.Open();
  455. }
  456. //進行查詢
  457. dtTemp = UtilityClass.GetSQLResult(strSQL).Tables["Result"];
  458. }
  459. }
  460. }
  461. return dtTemp;
  462. }
  463. catch (Exception ex)
  464. {
  465. ErrorHandler.WriteErrorLog("UtilityClass.cs", ex);
  466. return null;
  467. }
  468. }
  469. public static DataTable GetAccountingSubjectByName(string strAccountingSubName)
  470. {
  471. try
  472. {
  473. DataTable dtTemp = new DataTable();
  474. if (strAccountingSubName.Trim() != "")
  475. {
  476. //宣告物件
  477. string strSQL = string.Format("Select AccountingSubID, AccountingClass, DCClass, AccountingSubName From OTB_FNC_AccountingSubjects Where AccountingSubName = '{0}'", strAccountingSubName);
  478. using (SqlConnection sqlConn = GetConn(MainForm.strAccountingBookID))
  479. {
  480. using (SqlDataAdapter sqlAdapter = new SqlDataAdapter())
  481. {
  482. //添加參數
  483. sqlAdapter.SelectCommand = new SqlCommand();
  484. sqlAdapter.SelectCommand.Connection = sqlConn;
  485. sqlAdapter.SelectCommand.CommandText = strSQL;
  486. if (sqlConn.State == ConnectionState.Closed) //判斷連線狀態
  487. {
  488. sqlConn.Open();
  489. }
  490. //進行查詢
  491. dtTemp = UtilityClass.GetSQLResult(strSQL).Tables["Result"];
  492. }
  493. }
  494. }
  495. return dtTemp;
  496. }
  497. catch (Exception ex)
  498. {
  499. ErrorHandler.WriteErrorLog("AccountingEntries.cs", ex);
  500. return null;
  501. }
  502. }
  503. public static string[] GetInsurance(string InsuranceAmount) //取得勞健保資料
  504. {
  505. string strSQL = "Select * From OTB_HR_Insurance Where InsuranceAmountStart <= " + InsuranceAmount + " And InsuranceAmountEnd > " + InsuranceAmount;
  506. string[] intInsurance = new string[6];
  507. DataSet dsData = new DataSet();
  508. try
  509. {
  510. using (SqlConnection sqlConn = GetConn(MainForm.strAccountingBookID))
  511. {
  512. using (SqlDataAdapter sqlAdapter = new SqlDataAdapter(strSQL, sqlConn))
  513. {
  514. if (sqlConn.State == ConnectionState.Closed) //判斷連線狀態
  515. {
  516. sqlConn.Open();
  517. }
  518. sqlAdapter.Fill(dsData, "Result");
  519. intInsurance[0] = dsData.Tables["Result"].Rows[0]["InsuranceLevel"].ToString(); //級距
  520. intInsurance[1] = dsData.Tables["Result"].Rows[0]["C_LaborProtection"].ToString(); //公司提列勞保
  521. intInsurance[2] = dsData.Tables["Result"].Rows[0]["S_LaborProtection"].ToString(); //自行提列勞保
  522. intInsurance[3] = dsData.Tables["Result"].Rows[0]["C_HealthInsuranceAmount"].ToString(); //公司提列健保
  523. intInsurance[4] = dsData.Tables["Result"].Rows[0]["S_HealthInsuranceAmount"].ToString(); //自行提列健保
  524. intInsurance[5] = dsData.Tables["Result"].Rows[0]["RetirementAmount"].ToString(); //勞退金
  525. }
  526. }
  527. return intInsurance;
  528. }
  529. catch (Exception ex)
  530. {
  531. return intInsurance;
  532. }
  533. }
  534. public static string[] GetInsuranceByLevel(string InsuranceLevel) //取得勞健保資料
  535. {
  536. string strSQL = "Select * From OTB_HR_Insurance Where InsuranceLevel = " + InsuranceLevel;
  537. string[] intInsurance = new string[6];
  538. DataSet dsData = new DataSet();
  539. try
  540. {
  541. using (SqlConnection sqlConn = GetConn(MainForm.strAccountingBookID))
  542. {
  543. using (SqlDataAdapter sqlAdapter = new SqlDataAdapter(strSQL, sqlConn))
  544. {
  545. if (sqlConn.State == ConnectionState.Closed) //判斷連線狀態
  546. {
  547. sqlConn.Open();
  548. }
  549. sqlAdapter.Fill(dsData, "Result");
  550. intInsurance[0] = dsData.Tables["Result"].Rows[0]["InsuranceLevel"].ToString(); //級距
  551. intInsurance[1] = dsData.Tables["Result"].Rows[0]["C_LaborProtection"].ToString(); //公司提列勞保
  552. intInsurance[2] = dsData.Tables["Result"].Rows[0]["S_LaborProtection"].ToString(); //自行提列勞保
  553. intInsurance[3] = dsData.Tables["Result"].Rows[0]["C_HealthInsuranceAmount"].ToString(); //公司提列健保
  554. intInsurance[4] = dsData.Tables["Result"].Rows[0]["S_HealthInsuranceAmount"].ToString(); //自行提列健保
  555. intInsurance[5] = dsData.Tables["Result"].Rows[0]["RetirementAmount"].ToString(); //勞退金
  556. }
  557. }
  558. return intInsurance;
  559. }
  560. catch (Exception ex)
  561. {
  562. return intInsurance;
  563. }
  564. }
  565. public static string[] GetAccountingYears(int intAmount) //取得會計年度選單
  566. {
  567. try
  568. {
  569. string[] strYears = new string[intAmount];
  570. DateTime dtNow = DateTime.Now;
  571. for (int intCount = 0; intCount < intAmount; intCount++)
  572. {
  573. strYears[intCount] = (dtNow.Year - intCount).ToString();
  574. }
  575. return strYears;
  576. }
  577. catch (Exception ex)
  578. {
  579. return null;
  580. }
  581. }
  582. public static void CreateDir(string strDirPath) //建立資料夾
  583. {
  584. string[] strDir = strDirPath.Split('\\');
  585. string strCreatePath = "";
  586. foreach (string strPath in strDir)
  587. {
  588. if(strPath != "")
  589. {
  590. strCreatePath += strPath + "\\";
  591. if (!Directory.Exists(strCreatePath))
  592. {
  593. Directory.CreateDirectory(strCreatePath);
  594. }
  595. }
  596. }
  597. }
  598. public static void WriteFile(string strFilePath ,string strContent) //撰寫檔案文字內容
  599. {
  600. using (StreamWriter swFile = new StreamWriter(strFilePath, true))
  601. {
  602. swFile.WriteLine(strContent);
  603. }
  604. }
  605. public static void WriteFile(string strFilePath, string[] strContent) //撰寫檔案文字內容
  606. {
  607. //判斷檔案是否存在
  608. string[] strPathArray = strFilePath.Split('\\');
  609. string strCHKPath = "";
  610. for (int intPath = 0; intPath < strPathArray.Length - 1; intPath ++ )
  611. {
  612. strCHKPath += strPathArray[intPath] + "\\";
  613. }
  614. //檢查資料夾是否存在
  615. if (!File.Exists(strCHKPath))
  616. {
  617. CreateDir(strCHKPath);
  618. }
  619. using (StreamWriter swFile = new StreamWriter(strFilePath, true))
  620. {
  621. foreach(string strContentText in strContent)
  622. {
  623. swFile.WriteLine(strContentText);
  624. }
  625. }
  626. }
  627. public static void SetGridColor(DataGridView dgvGrid) //處理欄位間隔顏色的改變
  628. {
  629. foreach (DataGridViewRow drColor in dgvGrid.Rows)
  630. {
  631. if (drColor.Index % 2 == 0)
  632. {
  633. drColor.DefaultCellStyle.BackColor = Color.LightGray;
  634. }
  635. else
  636. {
  637. drColor.DefaultCellStyle.BackColor = Color.White;
  638. }
  639. }
  640. }
  641. #endregion
  642. #region 計算財務相關公式
  643. #endregion
  644. }
  645. }