/// <summary> /// 作用:验证时间逻辑 /// 作者:汪建龙 /// 编写时间:2016年12月11日14:25:21 /// </summary> /// <param name="billTwo"></param> /// <param name="year"></param> /// <param name="month"></param> /// <returns></returns> public static bool CheckTime(BillTwo billTwo, int year, int month) { if (billTwo == null || year == 0 || month == 0) { return(false); } if (billTwo.Time.HasValue) { if (billTwo.Time.Value.Year == year && billTwo.Time.Value.Month == month) { return(true); } } return(false); }
/// <summary> /// 作用:验证规划公司银行对账逻辑 规划公司 /// 作者:汪建龙 /// 编写时间:2016年12月11日14:22:02 /// </summary> /// <param name="billTwo"></param> /// <param name="pre"></param> /// <returns></returns> public static bool CheckLogic(BillTwo billTwo, BillTwo pre) { if (billTwo == null || pre == null) { return(false); } if (billTwo.SerialNumber == (pre.SerialNumber + 1)) { if (billTwo.Budget == Budget.Income && Math.Abs(pre.Balance + billTwo.Money - billTwo.Balance) < 0.01) { return(true); } else if (billTwo.Budget == Budget.Expense && Math.Abs(pre.Balance - billTwo.Money - billTwo.Balance) < 0.01) { return(true); } } return(false); }
/// <summary> /// 作用:分析获得billTwo对象实例 /// 作者:汪建龙 /// 编写时间:2016年12月11日13:14:33 /// </summary> /// <param name="row"></param> /// <returns></returns> private static BillTwo AnalyzeProject(IRow row) { if (row == null) { return(null); } var array = GetCellValue(row, CurrentHead2.Length); var a = 0; var b = .0; var entry = new BillTwo { SerialNumber = int.TryParse(array[0], out a) ? a : 0, Date = array[1], TimeStamp = array[2], Time = GetDateTime(array[1]), Balance = double.TryParse(array[5], out b) ? b : .0, CommissionCharge = double.TryParse(array[6], out b) ? b : .0, Way = array[7], Bank = array[8], Type = array[9], Address = array[10], Account = array[11], Name = array[12], Remark = array[13], Summary = array[14], PostScript = array[15] }; if (!string.IsNullOrEmpty(array[3]) && double.TryParse(array[3], out b) && b > 0.01) { entry.Budget = Budget.Income; entry.Money = b; } else if (!string.IsNullOrEmpty(array[4]) && double.TryParse(array[4], out b) && b > 0.01) { entry.Budget = Budget.Expense; entry.Money = b; } return(entry); }