Esempio n. 1
0
        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;
        }
Esempio n. 2
0
        public void DataGridView4RowsAdd(TimeArrangeForManager tgm)
        {
            if(tgm != null)
            {
                DateTime dt = new DateTime (tgm.TimeMonth);
                if(tgm.ExamineState == 0)
                {
                    this.dataGridView4.Rows.Add(dt.ToString("yyyy年MM月"), tgm.UserId.KuName, tgm.ArrangeUserId.KuName, tgm.DutyType == 0 ? "行政班" : "网络班","未审核", tgm.IsDone == 1 ? "" : "删除");
                }
                else if(tgm.ExamineState == 1)
                {
                    this.dataGridView4.Rows.Add(dt.ToString("yyyy年MM月"), tgm.UserId.KuName, tgm.ArrangeUserId.KuName, tgm.DutyType == 0 ? "行政班" : "网络班","审核通过", tgm.IsDone == 1 ? "" : "删除");
                }
                else if(tgm.ExamineState == 2)
                {
                    this.dataGridView4.Rows.Add(dt.ToString("yyyy年MM月"), tgm.UserId.KuName, tgm.ArrangeUserId.KuName, tgm.DutyType == 0 ? "行政班" : "网络班","审核为通过", tgm.IsDone == 1 ? "" : "删除");
                }

                this.dataGridView4.Rows[this.dataGridView4.Rows.Count - 1].Tag = tgm;
            }
        }
        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 = "您的出差申请审核通过";
                    }

                }
            }
        }
Esempio n. 4
0
        /// <summary>
        /// 确定按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button3_Click(object sender, EventArgs e)
        {
            this.button3.Cursor = Cursors.WaitCursor;
            DateTime dt = new DateTime(dateTimePicker1.Value.Year, dateTimePicker1.Value.Month, 1);
            //判断这个月是否安排
            string sql = "select u from  TimeArrangeForManager u where u.TimeMonth = " + dt.Ticks +
                " and u.DutyType = "+this.comboBox3.SelectedIndex+
                " and u.State = "+ (int)IEntity.stateEnum.Normal;
            IList i = baseService.loadEntityList(sql);
            if(i!= null &&i.Count>0)
            {
                MessageBox.Show("该月份已经安排过了");
                this.button3.Cursor = Cursors.Hand;
                return;
            }

            if(this.comboBox1.Text != "" && this.comboBox2.Text != "")
            {
                TimeArrangeForManager tgm = new TimeArrangeForManager();
                tgm.ArrangeUserId = User;
                tgm.UserId = theusers[this.comboBox2.SelectedIndex];
                tgm.State = (int)IEntity.stateEnum.Normal;
                tgm.TimeStamp = DateTime.Now.Ticks;

                tgm.TimeMonth = dt.Ticks;
                tgm.IsDone = 0;
                tgm.DutyType = this.comboBox3.SelectedIndex;
                tgm.ExamineState = 0;
                object be = baseService.saveEntity(tgm);

                try
                {
                    KjqbService.Service1Client ser = new KjqbService.Service1Client();
                    KjqbService.TimeArrangeForManagerInService tfmservice = new KjqbService.TimeArrangeForManagerInService();
                    tfmservice.TimeArrangeForManagerId = int.Parse(be.ToString());
                    tfmservice.UserId = tgm.UserId.Id;
                    tfmservice.SendUserId = user.Id;
                    tfmservice.ExamineOrExamineresult = 3;
                    ser.SaveInTimeArrangeForManagerInService(tfmservice);

                }
                catch { }

                DataGridView4RowsAdd(tgm);
                MessageBox.Show("添加成功!");
            }
            this.button3.Cursor = Cursors.Hand;
        }