//private DataTable GetStatisticsCharge(DateTime beginTime, DateTime endTime) //{ // if (m_StatisticsCharge == null) // m_StatisticsCharge = m_DAL.GetALLStatisticsCharge(beginTime, endTime); // return m_StatisticsCharge; //} #region 获取个人业务 public PersonalStatisticsInfo GetPersonalStatisticsDD(DateTime beginTime, DateTime endTime) { string selfWorkCode = UserOperateContext.Current.Session_UsrInfo.WorkCode; DataTable tableall = GetStatisticsDD(beginTime, endTime); //在表里循环遍历,当某一行的PersonalCode跟session 中获取的ID 相等时,将那一行的数据取出,赋给Model,Return PersonalStatisticsInfo AEinfo = new PersonalStatisticsInfo(); foreach (DataRow dr in tableall.Rows) { if (Convert.ToString(dr["WorkCode"]) == selfWorkCode) { AEinfo.PersonName = DBConvert.ConvertStringToString(dr["Name"]); AEinfo.PTaskTimes = DBConvert.ConvertStringToString(dr["SendCarTimes"]); AEinfo.PFirstAidTimes = DBConvert.ConvertStringToString(dr["FirstAidTimes"]); AEinfo.PTransTimes = DBConvert.ConvertStringToString(dr["TransTimes"]); AEinfo.PGoHomeTimes = DBConvert.ConvertStringToString(dr["GoHomeTimes"]); AEinfo.PDays = DBConvert.ConvertStringToString(dr["Days"]); AEinfo.PTaskTimesEveryDay = DBConvert.ConvertStringToString(dr["AvgDaySendCarTimes"]); AEinfo.PAvgSendTime = DBConvert.ConvertStringToString(dr["AvgSendCarTime"]); AEinfo.PAvgArriveTime = DBConvert.ConvertStringToString(dr["AvgArrivingSceneTime"]); AEinfo.PAvgLocalAidTime = DBConvert.ConvertStringToString(dr["AvgSceneRescueTime"]); AEinfo.PAvgTransTime = DBConvert.ConvertStringToString(dr["AvgTransportTime"]); AEinfo.PAvgHospitalTransTime = DBConvert.ConvertStringToString(dr["AvgHospitalDeliveryTime"]); AEinfo.PAvgReactTime = DBConvert.ConvertStringToString(dr["AvgResponseTime"]); AEinfo.PAvgTurnTime = DBConvert.ConvertStringToString(dr["AvgRevolveTime"]); } } return(AEinfo); }
//获取个人管理块收费 public PersonalStatisticsInfo GetPersonalStatisticsGLCharge(DateTime beginTime, DateTime endTime) { // long start = DateTime.Now.Ticks; List <int> role = UserOperateContext.Current.Session_UsrRole; string selfName = UserOperateContext.Current.Session_UsrInfo.Name; string selfWorkCode = UserOperateContext.Current.Session_UsrInfo.WorkCode; //司机 if (role.Contains(10)) { PersonalStatisticsInfo AEinfo = new PersonalStatisticsInfo(); int PKilometer = 0; int PChargeCarFee = 0; int PChargeWaitFee = 0; int PChargeAidFee = 0; int PCharge = 0; DataTable tableall = GetStatisticsCharge(beginTime, endTime); foreach (DataRow dr in tableall.Rows) { if (Convert.ToString(dr["Driver"]) == selfName) { PKilometer += Convert.ToInt32(dr["收费公里数"]); PChargeCarFee += Convert.ToInt32(dr["车费"]); PChargeWaitFee += Convert.ToInt32(dr["等候费"]); PChargeAidFee += Convert.ToInt32(dr["治疗费"]); PCharge += Convert.ToInt32(dr["收费金额"]); } } AEinfo.PKilometer = Convert.ToString(PKilometer); AEinfo.PChargeCarFee = Convert.ToString(PChargeCarFee); AEinfo.PChargeWaitFee = Convert.ToString(PChargeWaitFee); AEinfo.PChargeAidFee = Convert.ToString(PChargeAidFee); AEinfo.PCharge = Convert.ToString(PCharge); return(AEinfo); } //医生,护士 else if (role.Contains(1) || role.Contains(3)) { PersonalStatisticsInfo AEinfo = new PersonalStatisticsInfo(); int PKilometer = 0; int PChargeCarFee = 0; int PChargeWaitFee = 0; int PChargeAidFee = 0; int PCharge = 0; DataTable tableall = GetStatisticsCharge(beginTime, endTime); foreach (DataRow dr in tableall.Rows) { if (Convert.ToString(dr["DoctorAndNurse"]) == selfName) { PKilometer += Convert.ToInt32(dr["收费公里数"]); PChargeCarFee += Convert.ToInt32(dr["车费"]); PChargeWaitFee += Convert.ToInt32(dr["等候费"]); PChargeAidFee += Convert.ToInt32(dr["治疗费"]); PCharge += Convert.ToInt32(dr["收费金额"]); } } AEinfo.PKilometer = Convert.ToString(PKilometer); AEinfo.PChargeCarFee = Convert.ToString(PChargeCarFee); AEinfo.PChargeWaitFee = Convert.ToString(PChargeWaitFee); AEinfo.PChargeAidFee = Convert.ToString(PChargeAidFee); AEinfo.PCharge = Convert.ToString(PCharge); return(AEinfo); } //担架工 else if (role.Contains(28)) { PersonalStatisticsInfo AEinfo = new PersonalStatisticsInfo(); int PKilometer = 0; int PChargeCarFee = 0; int PChargeWaitFee = 0; int PChargeAidFee = 0; int PCharge = 0; DataTable tableall = GetStatisticsCharge(beginTime, endTime); foreach (DataRow dr in tableall.Rows) { if (Convert.ToString(dr["StretcherBearersI"]) == selfName) { PKilometer += Convert.ToInt32(dr["收费公里数"]); PChargeCarFee += Convert.ToInt32(dr["车费"]); PChargeWaitFee += Convert.ToInt32(dr["等候费"]); PChargeAidFee += Convert.ToInt32(dr["治疗费"]); PCharge += Convert.ToInt32(dr["收费金额"]); } } AEinfo.PKilometer = Convert.ToString(PKilometer); AEinfo.PChargeCarFee = Convert.ToString(PChargeCarFee); AEinfo.PChargeWaitFee = Convert.ToString(PChargeWaitFee); AEinfo.PChargeAidFee = Convert.ToString(PChargeAidFee); AEinfo.PCharge = Convert.ToString(PCharge); return(AEinfo); } else { return(new PersonalStatisticsInfo()); } // long aaa= DateTime.Now.Ticks - start; }