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 UCLeaderInfo(VMMainWindow vmMain) { this.InitializeComponent(); VMEmp.CollectionDeptment = vmMain.CollectionDeptment; VMEmp.CollectionDuty = vmMain.CollectionDuty; VMEmp.CollectionWorkType = vmMain.CollectionWorkType; }
public MainWindow() { InitializeComponent(); VMMain = new VMMainWindow(); InitUserControl(); WindowHelper.RepairWindowBehavior(this);//防止窗体遮盖任务栏 VMMain.AlertEvent += new Action<bool>(VMMain_AlertEvent); InitIcon(); }
public UCHisAttendance(VMMainWindow vmMain) { this.InitializeComponent(); VMHisA.CollectionDeptment = vmMain.CollectionDeptment; VMHisA.CollectionDuty = vmMain.CollectionDuty; VMHisA.CollectionWorkType = vmMain.CollectionWorkType; //只能查询到当前月 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); }