Beispiel #1
0
		public DataSet GetContiAbsForMess(string getGrade,string getClass,
			string getName,string getNumber,DateTime balanceMonth,FinanInfo finanInfo)
		{
			using ( FinanInfoDataAccess finanInfoDataAccess = new FinanInfoDataAccess() )
			{
				try
				{
					DataSet dsFinanBuild = finanInfoDataAccess.SetFinanStuInfo(getGrade,getClass,getName,getNumber);
					DataSet dsAdmRestoreDays = finanInfoDataAccess.SetContiAbsForMess(true,getGrade,getClass,
						getName,getNumber,balanceMonth,finanInfo.GetMessRestoreDays);
					DataSet dsMessRestoreDays = finanInfoDataAccess.SetContiAbsForMess(false,getGrade,getClass,
						getName,getNumber,balanceMonth,finanInfo.GetMessRestoreDays);
					DataColumn needHandDaysColumn = new DataColumn("info_needHandDays");
					needHandDaysColumn.DataType = System.Type.GetType("System.Int32");
					dsFinanBuild.Tables[0].Columns.Add(needHandDaysColumn);
					DataColumn messStopDaysColumn = new DataColumn("info_messStopDays");
					messStopDaysColumn.DataType = System.Type.GetType("System.Int32");
					dsFinanBuild.Tables[0].Columns.Add(messStopDaysColumn);
					dsFinanBuild.Tables[0].Columns.AddRange(new DataColumn[]{
																				new DataColumn("info_admCharge"),new DataColumn("info_messCharge"),
																				new DataColumn("info_nightCharge"),new DataColumn("info_commCharge"),
																				new DataColumn("info_milkCharge"),new DataColumn("info_extraCharge"),
																				new DataColumn("info_admRestoreCharge"),new DataColumn("info_messRestoreCharge"),
																				new DataColumn("info_currency"),new DataColumn("info_remark")});
					for ( int finanRow = 0; finanRow < dsFinanBuild.Tables[0].Rows.Count; finanRow ++ )
					{
						//应交天数
						dsFinanBuild.Tables[0].Rows[finanRow][3] = GetWorkDays(balanceMonth);

						//停伙天数及退伙食费
						dsFinanBuild.Tables[0].Rows[finanRow][4] = 0;
						dsFinanBuild.Tables[0].Rows[finanRow][12] = "0.00¥";
						foreach(DataRow messRow in dsMessRestoreDays.Tables[0].Rows)
						{
							if ( dsFinanBuild.Tables[0].Rows[finanRow][0].ToString().Equals(messRow[0].ToString()) )
							{
								dsFinanBuild.Tables[0].Rows[finanRow][4] = messRow[1];
								dsFinanBuild.Tables[0].Rows[finanRow][12] = (finanInfo.GetMessCharge/GetWorkDays(balanceMonth)*
									Convert.ToDouble(messRow[1])).ToString("0.00")+"¥";
								getMessRestoreCharge = finanInfo.GetMessCharge/GetWorkDays(balanceMonth)*
									Convert.ToDouble(messRow[1]);
								break;
							}
							else
							{
								dsFinanBuild.Tables[0].Rows[finanRow][4] = 0;
								dsFinanBuild.Tables[0].Rows[finanRow][12] = "0.00¥";
								getMessRestoreCharge = 0;
							}
						}

						//管理费		
						dsFinanBuild.Tables[0].Rows[finanRow][5] = finanInfo.GetAdmCharge.ToString("0.00")+"¥";
						dsFinanBuild.Tables[0].Rows[finanRow][11] = "0.00¥";
						foreach(DataRow admRow in dsAdmRestoreDays.Tables[0].Rows)
						{
							if ( dsFinanBuild.Tables[0].Rows[finanRow][0].ToString().Equals(admRow[0].ToString()))
							{
								if ( Convert.ToInt32(admRow[1]) >= finanInfo.GetAdmRestoreDays )
								{
									dsFinanBuild.Tables[0].Rows[finanRow][11] = (finanInfo.GetAdmCharge/2).ToString("0.00")+"¥";
									getAdmRestoreCharge = finanInfo.GetAdmCharge/2;
									break;
								}
								else
								{
									dsFinanBuild.Tables[0].Rows[finanRow][11] = "0.00¥";
									getAdmRestoreCharge = 0;
								}
							}
//							else
//							{
//								dsFinanBuild.Tables[0].Rows[finanRow][5] = finanInfo.GetAdmCharge.ToString("0.00")+"¥";
//								dsFinanBuild.Tables[0].Rows[finanRow][11] = "0.00¥";
//								getAdmRestoreCharge = 0;
//							}
						}

						//伙食费
						dsFinanBuild.Tables[0].Rows[finanRow][6] = finanInfo.GetMessCharge.ToString("0.00")+"¥";
 
						//晚托费
						dsFinanBuild.Tables[0].Rows[finanRow][7] = finanInfo.GetNightCharge.ToString("0.00")+"¥";

						//代办费
						dsFinanBuild.Tables[0].Rows[finanRow][8] = finanInfo.GetCommCharge.ToString("0.00")+"¥";
						
						//牛奶费
						dsFinanBuild.Tables[0].Rows[finanRow][9] = finanInfo.GetMilkCharge.ToString("0.00")+"¥";

						//附加费
						dsFinanBuild.Tables[0].Rows[finanRow][10] = finanInfo.GetExtraCharge.ToString("0.00")+"¥";

						//实收金额
						dsFinanBuild.Tables[0].Rows[finanRow][13] = (finanInfo.GetMessCharge + finanInfo.GetAdmCharge +
							finanInfo.GetNightCharge + finanInfo.GetMilkCharge + finanInfo.GetCommCharge +finanInfo.GetExtraCharge - 
							getMessRestoreCharge - getAdmRestoreCharge).ToString("0.00")+"¥";

						//备注
						dsFinanBuild.Tables[0].Rows[finanRow][14] = finanInfo.GetRemark;
					}
					
					return dsFinanBuild;
				}
				catch(Exception e)
				{
					Util.WriteLog(e.Message,Util.EXCEPTION_LOG_TITLE);
					return null;
				}
			}
		}
Beispiel #2
0
		public DataSet ModifyFinanInfo(FinanInfo finanInfo,DataSet getDS,string getNumber,DateTime balanceMonth)
		{
			using ( FinanInfoDataAccess finanInfoDataAccess = new FinanInfoDataAccess() )
			{
				try
				{
					DataSet dsModifyMessInfo = finanInfoDataAccess.SetContiAbsForMess(false,"","","",getNumber,
						balanceMonth,finanInfo.GetMessRestoreDays);
					DataSet dsModifyAdmInfo = finanInfoDataAccess.SetContiAbsForMess(true,"","","",getNumber,
						balanceMonth,finanInfo.GetMessRestoreDays);
					foreach(DataRow modifyRow in getDS.Tables[0].Rows)
					{
						if ( modifyRow[0].ToString().Equals(getNumber) )
						{
							modifyRow[4] = 0;
							modifyRow[12] = "0.00¥";
							if ( dsModifyMessInfo.Tables[0].Rows.Count != 0)
							{
								modifyRow[4] = dsModifyAdmInfo.Tables[0].Rows[0][1];
								modifyRow[12] = (finanInfo.GetMessCharge/GetWorkDays(balanceMonth)*
									Convert.ToDouble(dsModifyAdmInfo.Tables[0].Rows[0][1])).ToString("0.00")+"¥";
								getModifyMessRestoreCharge = finanInfo.GetMessCharge/GetWorkDays(balanceMonth)*
									Convert.ToDouble(dsModifyAdmInfo.Tables[0].Rows[0][1]);
							}
							modifyRow[5] = finanInfo.GetAdmCharge.ToString("0.00")+"¥";
							modifyRow[11] = "0.00¥";
							if ( dsModifyAdmInfo.Tables[0].Rows.Count !=0 )
							{
								if ( Convert.ToInt32(dsModifyAdmInfo.Tables[0].Rows[0][1]) >= finanInfo.GetAdmRestoreDays )
								{
									modifyRow[11] = (finanInfo.GetAdmCharge/2).ToString("0.00")+"¥";
									getModifyAdmRestoreCharge = finanInfo.GetAdmCharge/2;
								}
							}
							modifyRow[6] = finanInfo.GetMessCharge.ToString("0.00")+"¥";
							modifyRow[7] = finanInfo.GetNightCharge.ToString("0.00")+"¥";
							modifyRow[8] = finanInfo.GetCommCharge.ToString("0.00")+"¥";
							modifyRow[9] = finanInfo.GetMilkCharge.ToString("0.00")+"¥";
							modifyRow[10] = finanInfo.GetExtraCharge.ToString("0.00")+"¥";
							modifyRow[13] = (finanInfo.GetMessCharge + finanInfo.GetAdmCharge +
								finanInfo.GetNightCharge + finanInfo.GetMilkCharge + finanInfo.GetCommCharge +finanInfo.GetExtraCharge - 
								getModifyMessRestoreCharge - getModifyAdmRestoreCharge).ToString("0.00")+"¥";
							modifyRow[14] = finanInfo.GetRemark;
						}
					}
					return getDS;
				}
				catch(Exception e)
				{
					Util.WriteLog(e.Message,Util.EXCEPTION_LOG_TITLE);
					return null;
				}
			}
		}