public UCPlanMain(VMMainWindow vmMain) { this.InitializeComponent(); VMPlan = new VMPlanMain();//DataContext //创建三个UC ucPlans = new UCPlans(); ucEmpInfo = new UCEmpInfo(); ucMonthPLan = new UCMonthPLan();//月计划 //只能定到下个月的计划 if (VMPlan.MonthThis == "12") { dpStart.DisplayDateEnd = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-01")).AddMonths(1).AddDays(-1); dpEnd.DisplayDateEnd = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-01")).AddMonths(1).AddDays(-1); } else { dpStart.DisplayDateEnd = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-01")).AddMonths(2).AddDays(-1); dpEnd.DisplayDateEnd = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-01")).AddMonths(2).AddDays(-1); } //ComBox源数据 VMPlan.CollectionDeptment = vmMain.CollectionDeptment; VMPlan.CollectionDuty = vmMain.CollectionDuty; VMPlan.CollectionWorkType = vmMain.CollectionWorkType; }
public WinPlanEmp(VMPlanMain vmPlan, double x, double y) : this() { VMPlan = vmPlan; left = x; top = y; VMPlan.ChangePlanCompleteEvent += VMPlan_ChangePlanCompleteEvent; }
public WinChangePlan(VMPlanMain vmPlan) : this() { VMPlan = vmPlan; VMPlan.ChangePlanCompleteEvent += VMPlan_ChangePlanCompleteEvent; //只能变更本月的计划 string datestr = VMPlan.SelectedPlan.PlanDate; DateTime date = Convert.ToDateTime(datestr); dp.DisplayDateStart = DateTime.Parse(date.ToString("yyyy-MM-01")); dp.DisplayDateEnd = DateTime.Parse(date.ToString("yyyy-MM-01")).AddMonths(1).AddDays(-1); }
public WinAddPlan(VMPlanMain vmPlan) : this() { VMPlan = vmPlan; //只能定到下个月的计划 if (VMPlan.MonthThis == "12") { dp.DisplayDateEnd = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-01")).AddMonths(1).AddDays(-1); } else { dp.DisplayDateEnd = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-01")).AddMonths(2).AddDays(-1); } VMPlan.ChangePlanCompleteEvent += vmPlan_ChangePlanCompleteEvent; }