/// <summary> /// 审核不通过 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button2_Click(object sender, EventArgs e) { DateTime tt = new DateTime(this.dateTimePicker1.Value.Year, dateTimePicker1.Value.Month, 1); string sql = "select u from TimeArrangeForManager u where " + " u.TimeMonth = " + tt.Ticks + " and u.State = " + (int)IEntity.stateEnum.Normal + " and u.IsDone = 1 "; IList timemananer = baseService.loadEntityList(sql); if (timemananer != null && timemananer.Count > 0) { TimeArrangeForManager timeman = (TimeArrangeForManager)timemananer[0]; if (timeman.ExamineState == 0) { if (MessageBox.Show("确定要不通过吗?", "提示", MessageBoxButtons.OKCancel) == DialogResult.OK) { timeman.ExamineState = 2; baseService.SaveOrUpdateEntity(timeman); try { KjqbService.Service1Client ser = new KjqbService.Service1Client(); KjqbService.TimeArrangeForManagerInService tfmservice = new KjqbService.TimeArrangeForManagerInService(); tfmservice.ExamineOrExamineresult = 2; tfmservice.SendUserId = this.user.Id; tfmservice.UserId = timeman.UserId.Id; tfmservice.TimeArrangeForManagerId = timeman.Id; ser.SaveInTimeArrangeForManagerInService(tfmservice); } catch { } this.CheckState.Text = "审核状态:审核不通过"; } } else { MessageBox.Show("您已经审核过了"); } } else { MessageBox.Show("值班尚未安排!"); } }
private void dateTimePicker1_ValueChanged(object sender, EventArgs e) { DateTime tt = new DateTime(this.dateTimePicker1.Value.Year, dateTimePicker1.Value.Month, 1); string sql1 = "Select u from OnDutyTable u where u.State = " + (int)IEntity.stateEnum.Normal + " and u.Time > " + tt.AddDays(-16).Ticks + " and u.Time <= " + tt.AddDays(16).Ticks; dutyDayLis = baseService.loadEntityList(sql1); dateTimePicker1.Cursor = Cursors.WaitCursor; if (this.dateTimePicker1.Value.Ticks > DateTime.Now.Ticks) { //查询这个月是否自己排班 string sql = "select u from TimeArrangeForManager u where u.UserId = " + user.Id + " and u.TimeMonth = " + tt.Ticks + " and u.State = " + (int)IEntity.stateEnum.Normal; IList timemananer = baseService.loadEntityList(sql); if (TfM == null) { TfM = new TimeArrangeForManager(); } if (timemananer != null && timemananer.Count > 0) { TfM = (TimeArrangeForManager)timemananer[0]; this.initCalendar(this.dateTimePicker1.Value.Year, this.dateTimePicker1.Value.Month, true); switch (TfM.ExamineState) { case 0: this.CheckState.Text = "审核状态:未审核"; break; case 1: this.CheckState.Text = "审核状态:审核通过"; break; case 2: this.CheckState.Text = "审核状态:审核未通过"; break; } } else { this.initCalendar(this.dateTimePicker1.Value.Year, this.dateTimePicker1.Value.Month, false); this.CheckState.Text = ""; } if (Therole != 0) { string sqll = "select u from TimeArrangeForManager u where u.TimeMonth = " + tt.Ticks + " and u.State = " + (int)IEntity.stateEnum.Normal; IList listss = baseService.loadEntityList(sqll); if (listss != null && listss.Count > 0) { this.PanelOfTwoButtons.Visible = true; switch (TfM.ExamineState) { case 0: this.CheckState.Text = "审核状态:未审核"; break; case 1: this.CheckState.Text = "审核状态:审核通过"; break; case 2: this.CheckState.Text = "审核状态:审核未通过"; break; } } else { this.PanelOfTwoButtons.Visible = false; } } } else { this.initCalendar(this.dateTimePicker1.Value.Year, this.dateTimePicker1.Value.Month, false); this.CheckState.Text = ""; this.PanelOfTwoButtons.Visible = false; } dateTimePicker1.Cursor = Cursors.Hand; }
private void NewMessageWindow_Load(object sender, EventArgs e) { if (this.formLocation != null) { this.Location = formLocation; } if (loglist != null && loglist.Count > 0) { loglist.Reverse(); foreach (KjqbService.LogInService ll in Loglist) { StaffLog ss = new StaffLog(); ss = (StaffLog)baseService.loadEntity(ss, ll.LogId); LinkLabel l1 = new LinkLabel(); l1.Text = ss.Staff.KuName + "分享给您的日志"; l1.Width = this.flowLayoutPanel1.Width - 10; l1.Height = 30; l1.Top = 10; l1.Tag = ll; l1.Click += l1_Click; l1.Parent = flowLayoutPanel1; l1.DoubleClick += l1_DoubleClick; } } if (schedulelist != null && schedulelist.Count > 0) { schedulelist.Reverse(); foreach (KjqbService.ScheduleInService ll in schedulelist) { StaffSchedule ss = new StaffSchedule(); //string sql = "select u from StaffLog u where u.Id = " + ll.LogId; ss = (StaffSchedule)baseService.loadEntity(ss, ll.ScheduleId); LinkLabel l1 = new LinkLabel(); l1.Width = this.flowLayoutPanel1.Width - 10; l1.Height = 30; l1.Top = 10; l1.Tag = ll; l1.Click += l1_Click; l1.Parent = flowLayoutPanel1; l1.DoubleClick += l1_DoubleClick; if (ss.Staff.Id == ss.ArrangeMan.Id) { l1.Text = ss.Staff.KuName + "分享给您的日程"; } else if (ss.Staff.Id != ss.ArrangeMan.Id) { l1.Text = ss.ArrangeMan.KuName + "给您安排的日程"; } } } if (commentList != null && commentList.Count > 0) { commentList.Reverse(); foreach (KjqbService.CommentInService ll in commentList) { StaffLog ss = new StaffLog(); //string sql = "select u from StaffLog u where u.Id = " + ll.LogId; ss = (StaffLog)baseService.loadEntity(ss, ll.LogId); LinkLabel l1 = new LinkLabel(); l1.Text = ll.CommentUserName + "评论了您的日志"; l1.Width = this.flowLayoutPanel1.Width - 10; l1.Height = 30; l1.Top = 10; l1.Tag = ll; l1.Click += l1_Click; l1.DoubleClick += l1_DoubleClick; l1.Parent = flowLayoutPanel1; } } if (tfmlist != null && tfmlist.Count > 0) { tfmlist.Reverse(); foreach (KjqbService.TimeArrangeForManagerInService tfm in tfmlist) { TimeArrangeForManager tt = new TimeArrangeForManager(); tt = (TimeArrangeForManager)baseService.loadEntity(tt, tfm.TimeArrangeForManagerId); LinkLabel l1 = new LinkLabel(); l1.Width = this.flowLayoutPanel1.Width - 10; l1.Height = 30; l1.Top = 10; l1.Tag = tfm; l1.Click += l1_Click; l1.DoubleClick += l1_DoubleClick; l1.Parent = flowLayoutPanel1; DateTime dt = new DateTime(tt.TimeMonth); if (tfm.ExamineOrExamineresult == 0) { l1.Text = dt.ToString("yyyy年MM月") + " " + "排班待您审核"; } if (tfm.ExamineOrExamineresult == 1) { l1.Text = dt.ToString("yyyy年MM月") + " " + "排班审核通过"; } if (tfm.ExamineOrExamineresult == 2) { l1.Text = dt.ToString("yyyy年MM月") + " " + "排班审核未通过"; } if (tfm.ExamineOrExamineresult == 3) { l1.Text = "请您安排" + dt.ToString("yyyy年MM月") + "的值班"; } } } if (levlist != null && levlist.Count > 0) { levlist.Reverse(); foreach (KjqbService.LeaveInService tfm in levlist) { LeaveManage tt = new LeaveManage(); tt = (LeaveManage)baseService.loadEntity(tt, tfm.LeaveId); LinkLabel l1 = new LinkLabel(); l1.Width = this.flowLayoutPanel1.Width - 10; l1.Height = 30; l1.Top = 10; l1.Tag = tfm; l1.Click += l1_Click; l1.DoubleClick += l1_DoubleClick; l1.Parent = flowLayoutPanel1; if (tfm.ExamineOrExamineresult == 0) { l1.Text = tt.Ku_Id.KuName + "请假申请待您审核"; } DateTime dt1 = new DateTime(tt.StartTime); DateTime dt2 = new DateTime(tt.EndTime); if (tfm.ExamineOrExamineresult == 1) { l1.Text = "您提交的" + tt.LeaveType + "申请审核通过"; } if (tfm.ExamineOrExamineresult == 2) { l1.Text = "您提交的" + tt.LeaveType + "申请审核未通过"; } } } if (buslist != null && buslist.Count > 0) { buslist.Reverse(); foreach (KjqbService.BusinessService tfm in buslist) { // tt = new LeaveManage(); //tt = (LeaveManage)baseService.loadEntity(tt, tfm.LeaveId); LinkLabel l1 = new LinkLabel(); l1.Width = this.flowLayoutPanel1.Width - 10; l1.Height = 30; l1.Top = 10; l1.Tag = tfm; l1.Click += l1_Click; l1.DoubleClick += l1_DoubleClick; l1.Parent = flowLayoutPanel1; if (tfm.Type == 0) { l1.Text = "您有一条出差信息待审批"; } else if (tfm.Type == 1) { l1.Text = "您的出差申请被退回"; } else if (tfm.Type == 2) { l1.Text = "您的出差申请被撤销"; } else if (tfm.Type == 3) { l1.Text = "您的出差申请审核通过"; } } } }