/// <summary> /// Get StatisticInfo By Position /// </summary> /// <param name="position"></param> /// <returns></returns> public static PositionStatistic GetPositionStatisticInfo(string position) { PositionStatistic t = new PositionStatistic(); t = PositionStatisticDataSet.Find((x) => { return(x.BasicInfo.isOpen && x.BasicInfo.Position == position); }); return(t); }
/// <summary> /// Get Statistic Info /// </summary> /// <param name="candideate"></param> /// <param name="t"></param> private static void Statistic(List <HiringTracking> candideate, PositionStatistic t) { t.Pipeline = candideate.Count(); var firstInterview = from p in candideate where p.FirstInterviewDate != DateTime.MinValue && !p.IsDel select p; var secondInterview = from p in candideate where p.SecondInterviewDate != DateTime.MinValue && !p.IsDel select p; var thirdInterview = from p in candideate where p.ThirdInterviewDate != DateTime.MinValue && !p.IsDel select p; var firstInterviewPass = from p in candideate where HiringTracking.InterviewPassCheck(p.FirstInterviewResult) && !p.IsDel select p; var secondInterviewPass = from p in candideate where HiringTracking.InterviewPassCheck(p.SecondInterviewResult) && !p.IsDel select p; var thirdInterviewPass = from p in candideate where HiringTracking.InterviewPassCheck(p.ThirdInterviewResult) && !p.IsDel select p; if (t.Pipeline != 0) { t.CVpass = t.Pipeline / firstInterview.Count(); } t.FirstInterviewCount = firstInterview.Count(); t.SecondInterviewCount = secondInterview.Count(); t.ThirdInterviewCount = thirdInterview.Count(); t.FirstPass = firstInterviewPass.Count(); t.SecondPass = secondInterviewPass.Count(); t.ThirdPass = thirdInterviewPass.Count(); var Onboard = from p in candideate where p.FinalStatus == HiringTracking.FinalStatusEnum.Onboard && !p.IsDel select p; t.Onboard = Onboard.Count(); var RejectOffer = from p in candideate where p.FinalStatus == HiringTracking.FinalStatusEnum.RejectOffer && !p.IsDel select p; t.RejectOffer = RejectOffer.Count(); var OpenOffer = from p in candideate where p.FinalStatus == HiringTracking.FinalStatusEnum.OpenOffer && !p.IsDel select p; t.OpenOffer = OpenOffer.Count(); var ANOB = from p in candideate where p.FinalStatus == HiringTracking.FinalStatusEnum.ANOB && !p.IsDel select p; t.ANOB = ANOB.Count(); }
/// <summary> /// Group By Position /// </summary> public static void ReCalulatePositionStatisti(ViewControl.PositionDelegate condition) { PositionStatisticDataSet.Clear(); //Total Rec List <HiringTracking> candideate = new List <HiringTracking>(); PositionStatistic total = new PositionStatistic(); total.BasicInfo = new PositionBasicInfo(); total.BasicInfo.Position = SystemManager.strTotal; total.BasicInfo.Target = PositionBasicDataSet.Sum((x) => { if (x.isOpen && condition(x)) { candideate.AddRange((from p in HiringTrackingDataSet where !p.IsDel && p.Position == x.Position select p).ToList()); return(x.Target); } else { return(0); } }); ///Total Info Statistic Statistic(candideate.ToList(), total); PositionStatisticDataSet.Add(total); foreach (var item in PositionBasicDataSet) { if (!item.isOpen) { continue; } PositionStatistic t = new PositionStatistic(); t.BasicInfo = item; var posItems = from p in HiringTrackingDataSet where p.Position == item.Position && !p.IsDel select p; ///Position Info Statistic Statistic(posItems.ToList(), t); PositionStatisticDataSet.Add(t); } }
/// <summary> /// Group By Position /// </summary> public static void ReCompute() { PositionStatisticDataSet.Clear(); //Total Rec PositionStatistic total = new PositionStatistic(); total.BasicInfo = new PositionBasicInfo(); total.BasicInfo.No = SystemManager.strTotal; total.BasicInfo.Target = PositionBasicDataSet.Sum((x) => { if (x.isOpen) { return(x.Target); } else { return(0); } }); var pos = from p in HiringTrackingDataSet where !p.IsDel select p; Statistic(pos.ToList(), total); PositionStatisticDataSet.Add(total); foreach (var item in PositionBasicDataSet) { if (!item.isOpen) { continue; } PositionStatistic t = new PositionStatistic(); t.BasicInfo = item; var posItems = from p in HiringTrackingDataSet where p.Position == item.Position && !p.IsDel select p; Statistic(posItems.ToList(), t); PositionStatisticDataSet.Add(t); } }
/// <summary> /// Get Statistic Info /// </summary> /// <param name="candideate"></param> /// <param name="t"></param> private static void Statistic(List<HiringTracking> candideate, PositionStatistic t) { t.Pipeline = candideate.Count(); var firstInterview = from p in candideate where p.FirstInterviewDate != DateTime.MinValue && !p.IsDel select p; var secondInterview = from p in candideate where p.SecondInterviewDate != DateTime.MinValue && !p.IsDel select p; var thirdInterview = from p in candideate where p.ThirdInterviewDate != DateTime.MinValue && !p.IsDel select p; var firstInterviewPass = from p in candideate where HiringTracking.InterviewPassCheck(p.FirstInterviewResult) && !p.IsDel select p; var secondInterviewPass = from p in candideate where HiringTracking.InterviewPassCheck(p.SecondInterviewResult) && !p.IsDel select p; var thirdInterviewPass = from p in candideate where HiringTracking.InterviewPassCheck(p.ThirdInterviewResult) && !p.IsDel select p; if (t.Pipeline != 0) { t.CVpass = t.Pipeline / firstInterview.Count(); } t.FirstInterviewCount = firstInterview.Count(); t.SecondInterviewCount = secondInterview.Count(); t.ThirdInterviewCount = thirdInterview.Count(); t.FirstPass = firstInterviewPass.Count(); t.SecondPass = secondInterviewPass.Count(); t.ThirdPass = thirdInterviewPass.Count(); var Onboard = from p in candideate where p.FinalStatus == HiringTracking.FinalStatusEnum.Onboard && !p.IsDel select p; t.Onboard = Onboard.Count(); var RejectOffer = from p in candideate where p.FinalStatus == HiringTracking.FinalStatusEnum.RejectOffer && !p.IsDel select p; t.RejectOffer = RejectOffer.Count(); var OpenOffer = from p in candideate where p.FinalStatus == HiringTracking.FinalStatusEnum.OpenOffer && !p.IsDel select p; t.OpenOffer = OpenOffer.Count(); var ANOB = from p in candideate where p.FinalStatus == HiringTracking.FinalStatusEnum.ANOB && !p.IsDel select p; t.ANOB = ANOB.Count(); }
/// <summary> /// Group By Position /// </summary> public static void ReCalulatePositionStatisti(ViewControl.PositionDelegate condition) { PositionStatisticDataSet.Clear(); //Total Rec List<HiringTracking> candideate = new List<HiringTracking>(); PositionStatistic total = new PositionStatistic(); total.BasicInfo = new PositionBasicInfo(); total.BasicInfo.Position = SystemManager.strTotal; total.BasicInfo.Target = PositionBasicDataSet.Sum((x) => { if (x.isOpen && condition(x)) { candideate.AddRange((from p in HiringTrackingDataSet where !p.IsDel && p.Position == x.Position select p).ToList()); return x.Target; } else { return 0; } }); ///Total Info Statistic Statistic(candideate.ToList(), total); PositionStatisticDataSet.Add(total); foreach (var item in PositionBasicDataSet) { if (!item.isOpen) continue; PositionStatistic t = new PositionStatistic(); t.BasicInfo = item; var posItems = from p in HiringTrackingDataSet where p.Position == item.Position && !p.IsDel select p; ///Position Info Statistic Statistic(posItems.ToList(), t); PositionStatisticDataSet.Add(t); } }
/// <summary> /// Get StatisticInfo By Position /// </summary> /// <param name="position"></param> /// <returns></returns> public static PositionStatistic GetPositionStatisticInfo(string position) { PositionStatistic t = new PositionStatistic(); t = PositionStatisticDataSet.Find((x) => { return x.BasicInfo.isOpen && x.BasicInfo.Position == position; }); return t; }
/// <summary> /// 数据绑定 /// </summary> /// <param name="item"></param> /// <param name="record"></param> private static void BindPositionListViewItem(ListViewItem item, PositionStatistic record) { if (CurrentPositionViewFields.ToList().Contains("No")) { item.Text = record.BasicInfo.No; } if (CurrentPositionViewFields.ToList().Contains("Hiring Manager")) { item.SubItems.Add(record.BasicInfo.HiringManager); } if (CurrentPositionViewFields.ToList().Contains("Position")) { item.SubItems.Add(record.BasicInfo.Position.ToString()); } if (CurrentPositionViewFields.ToList().Contains("Hiring Type")) { if (record.BasicInfo.Position == SystemManager.strTotal) { item.SubItems.Add("-"); } else { item.SubItems.Add(record.BasicInfo.HiringType.ToString()); } } if (CurrentPositionViewFields.ToList().Contains("Band")) { string strBand = string.Empty; if (record.BasicInfo.BandLBound == record.BasicInfo.BandHBound) { strBand = record.BasicInfo.BandLBound.ToDisplayString(); } else { strBand = record.BasicInfo.BandLBound.ToDisplayString() + " - " + record.BasicInfo.BandHBound.ToDisplayString(); } if (record.BasicInfo.Position == SystemManager.strTotal) { strBand = "-"; } item.SubItems.Add(strBand); } if (CurrentPositionViewFields.ToList().Contains("Target")) { item.SubItems.Add(record.BasicInfo.Target.ToString()); } if (CurrentPositionViewFields.ToList().Contains("Gap")) { item.SubItems.Add(record.Gap.ToString()); } if (CurrentPositionViewFields.ToList().Contains("Open Date")) { if (record.BasicInfo.Position == SystemManager.strTotal) { item.SubItems.Add("-"); } else { item.SubItems.Add(record.BasicInfo.OpenDate.ToString(SystemManager.DataTimeFormat)); } } if (CurrentPositionViewFields.ToList().Contains("Approved Date")) { if (record.BasicInfo.Position == SystemManager.strTotal) { item.SubItems.Add("-"); } else { item.SubItems.Add(record.BasicInfo.ApprovedDate.ToString(SystemManager.DataTimeFormat)); } } if (CurrentPositionViewFields.ToList().Contains("Pipeline")) { item.SubItems.Add(record.Pipeline.ToString()); } if (CurrentPositionViewFields.ToList().Contains("CV pass")) { item.SubItems.Add(record.CVpass.ToString()); } if (CurrentPositionViewFields.ToList().Contains("1st Interview")) { item.SubItems.Add(record.FirstInterviewCount.ToString()); } if (CurrentPositionViewFields.ToList().Contains("1st Pass")) { item.SubItems.Add(record.FirstPass.ToString()); } if (CurrentPositionViewFields.ToList().Contains("1st PassRatio")) { item.SubItems.Add(Math.Round(record.FirstPassRatio * 100, 2) + "%"); } if (CurrentPositionViewFields.ToList().Contains("2nd Interview")) { item.SubItems.Add(record.SecondInterviewCount.ToString()); } if (CurrentPositionViewFields.ToList().Contains("2nd Pass")) { item.SubItems.Add(record.SecondPass.ToString()); } if (CurrentPositionViewFields.ToList().Contains("2nd PassRatio")) { item.SubItems.Add(System.Math.Round(record.SecondPassRatio * 100, 2) + "%"); } if (CurrentPositionViewFields.ToList().Contains("3rd Interview")) { item.SubItems.Add(record.ThirdInterviewCount.ToString()); } if (CurrentPositionViewFields.ToList().Contains("3rd Pass")) { item.SubItems.Add(record.ThirdPass.ToString()); } if (CurrentPositionViewFields.ToList().Contains("3rd PassRatio")) { item.SubItems.Add(System.Math.Round(record.ThirdPassRatio * 100, 2) + "%"); } if (CurrentPositionViewFields.ToList().Contains("Open Offer")) { item.SubItems.Add(record.OpenOffer.ToString()); } if (CurrentPositionViewFields.ToList().Contains("ANOB")) { item.SubItems.Add(record.ANOB.ToString()); } if (CurrentPositionViewFields.ToList().Contains("Reject Offer")) { item.SubItems.Add(record.RejectOffer.ToString()); } if (CurrentPositionViewFields.ToList().Contains("Onboard")) { item.SubItems.Add(record.Onboard.ToString()); } if (CurrentPositionViewFields.ToList().Contains("Channel Mix")) { item.SubItems.Add(record.ChannelMix.ToString()); } }
/// <summary> /// 数据绑定 /// </summary> /// <param name="item"></param> /// <param name="record"></param> private static void BindPositionListViewItem(ListViewItem item, PositionStatistic record) { if (CurrentPositionViewFields.ToList().Contains("No")) item.Text = record.BasicInfo.No; if (CurrentPositionViewFields.ToList().Contains("Hiring Manager")) item.SubItems.Add(record.BasicInfo.HiringManager); if (CurrentPositionViewFields.ToList().Contains("Position")) item.SubItems.Add(record.BasicInfo.Position.ToString()); if (CurrentPositionViewFields.ToList().Contains("Hiring Type")) { if (record.BasicInfo.Position == SystemManager.strTotal) { item.SubItems.Add("-"); } else { item.SubItems.Add(record.BasicInfo.HiringType.ToString()); } } if (CurrentPositionViewFields.ToList().Contains("Band")) { string strBand = string.Empty; if (record.BasicInfo.BandLBound == record.BasicInfo.BandHBound) { strBand = record.BasicInfo.BandLBound.ToDisplayString(); } else { strBand = record.BasicInfo.BandLBound.ToDisplayString() + " - " + record.BasicInfo.BandHBound.ToDisplayString(); } if (record.BasicInfo.Position == SystemManager.strTotal) strBand = "-"; item.SubItems.Add(strBand); } if (CurrentPositionViewFields.ToList().Contains("Target")) item.SubItems.Add(record.BasicInfo.Target.ToString()); if (CurrentPositionViewFields.ToList().Contains("Gap")) item.SubItems.Add(record.Gap.ToString()); if (CurrentPositionViewFields.ToList().Contains("Open Date")) { if (record.BasicInfo.Position == SystemManager.strTotal) { item.SubItems.Add("-"); } else { item.SubItems.Add(record.BasicInfo.OpenDate.ToString(SystemManager.DataTimeFormat)); } } if (CurrentPositionViewFields.ToList().Contains("Approved Date")) { if (record.BasicInfo.Position == SystemManager.strTotal) { item.SubItems.Add("-"); } else { item.SubItems.Add(record.BasicInfo.ApprovedDate.ToString(SystemManager.DataTimeFormat)); } } if (CurrentPositionViewFields.ToList().Contains("Pipeline")) item.SubItems.Add(record.Pipeline.ToString()); if (CurrentPositionViewFields.ToList().Contains("CV pass")) item.SubItems.Add(record.CVpass.ToString()); if (CurrentPositionViewFields.ToList().Contains("1st Interview")) item.SubItems.Add(record.FirstInterviewCount.ToString()); if (CurrentPositionViewFields.ToList().Contains("1st Pass")) item.SubItems.Add(record.FirstPass.ToString()); if (CurrentPositionViewFields.ToList().Contains("1st PassRatio")) { item.SubItems.Add(Math.Round(record.FirstPassRatio * 100, 2) + "%"); } if (CurrentPositionViewFields.ToList().Contains("2nd Interview")) item.SubItems.Add(record.SecondInterviewCount.ToString()); if (CurrentPositionViewFields.ToList().Contains("2nd Pass")) item.SubItems.Add(record.SecondPass.ToString()); if (CurrentPositionViewFields.ToList().Contains("2nd PassRatio")) { item.SubItems.Add(System.Math.Round(record.SecondPassRatio * 100, 2) + "%"); } if (CurrentPositionViewFields.ToList().Contains("3rd Interview")) item.SubItems.Add(record.ThirdInterviewCount.ToString()); if (CurrentPositionViewFields.ToList().Contains("3rd Pass")) item.SubItems.Add(record.ThirdPass.ToString()); if (CurrentPositionViewFields.ToList().Contains("3rd PassRatio")) { item.SubItems.Add(System.Math.Round(record.ThirdPassRatio * 100, 2) + "%"); } if (CurrentPositionViewFields.ToList().Contains("Open Offer")) item.SubItems.Add(record.OpenOffer.ToString()); if (CurrentPositionViewFields.ToList().Contains("ANOB")) item.SubItems.Add(record.ANOB.ToString()); if (CurrentPositionViewFields.ToList().Contains("Reject Offer")) item.SubItems.Add(record.RejectOffer.ToString()); if (CurrentPositionViewFields.ToList().Contains("Onboard")) item.SubItems.Add(record.Onboard.ToString()); if (CurrentPositionViewFields.ToList().Contains("Channel Mix")) item.SubItems.Add(record.ChannelMix.ToString()); }