Exemplo n.º 1
0
        private void pictureBox3_Click(object sender, EventArgs e)
        {
            if (this.comment_textBox.Text.Trim().Length > 0)
            {
                StaffLog staffLog = (StaffLog)htmlEditor1.Tag;
                Comments comment  = new Comments();
                comment.Content           = comment_textBox.Text.Trim();
                comment.CommentPersonName = this.CommentPersonName;
                comment.State             = (int)IEntity.stateEnum.Normal;
                comment.TimeStamp         = DateTime.Now.Ticks;
                staffLog.Comments.Add(comment);
                baseService.SaveOrUpdateEntity(staffLog);
                initCommentList(staffLog.Comments);
                this.comment_textBox.Text = "";


                #region 向服务中发送数据
                try
                {
                    KjqbService.Service1Client ser = new KjqbService.Service1Client();
                    if (comment.CommentPersonName != "")
                    {
                        KjqbService.CommentInService ll = new KjqbService.CommentInService();
                        ll.LogId           = staffLog.Id;
                        ll.CommentUserName = this.CommentPersonName;
                        ll.LogUserId       = staffLog.Staff.Id;
                        ll.TimeStamp       = DateTime.Now.Ticks;
                        ser.SaveInCommentListInService(ll);
                    }
                }
                catch
                {
                }
                #endregion

                this.labelMessageBox1.MessageageShow("评论成功!");
            }
            else
            {
                this.labelMessageBox1.MessageageShow("您的评论内容为空……");
            }
        }
Exemplo n.º 2
0
        void l1_Click(object sender, EventArgs e)
        {
            LinkLabel l1 = (LinkLabel)sender;

            if (l1.Tag.GetType() == typeof(KjqbService.LogInService))
            {
                KjqbService.LogInService ll = (KjqbService.LogInService)l1.Tag;
                StaffLog ss = new StaffLog();
                ss = (StaffLog)baseService.loadEntity(ss, ll.LogId);
                if (ss.State == 0)
                {
                    writeLog wl = new writeLog();
                    wl.User              = ss.Staff;
                    wl.LogDate           = new DateTime(ss.WriteTime);
                    wl.IsComment         = true;
                    wl.CommentPersonName = this.User.KuName;
                    wl.ShowDialog();
                }
                else
                {
                    MessageBox.Show("该篇日志作者已经删除");
                }
            }
            else if (l1.Tag.GetType() == typeof(KjqbService.CommentInService))
            {
                KjqbService.CommentInService ll = (KjqbService.CommentInService)l1.Tag;
                StaffLog ss = new StaffLog();
                ss = (StaffLog)baseService.loadEntity(ss, ll.LogId);
                if (ss.State == 0)
                {
                    writeLog wl = new writeLog();
                    wl.User              = ss.Staff;
                    wl.LogDate           = new DateTime(ss.WriteTime);
                    wl.IsComment         = true;
                    wl.CommentPersonName = this.User.KuName;
                    wl.ShowDialog();
                }
                else
                {
                    MessageBox.Show("该篇日志作者已经删除");
                }
            }
            else if (l1.Tag.GetType() == typeof(KjqbService.ScheduleInService))
            {
                KjqbService.ScheduleInService ll = (KjqbService.ScheduleInService)l1.Tag;
                StaffSchedule ss = new StaffSchedule();
                ss = (StaffSchedule)baseService.loadEntity(ss, ll.ScheduleId);
                DateTime dt = new DateTime(ss.ScheduleTime);
                MessageBox.Show(dt.ToString("yyyy-MM-dd HH:mm:ss") + " :" + ss.Content);
            }
            else if (l1.Tag.GetType() == typeof(KjqbService.LeaveInService))
            {
                //KjqbService.LeaveInService ll = (KjqbService.LeaveInService)l1.Tag;
                //LeaveManage tt = new LeaveManage();
                //tt = (LeaveManage)baseService.loadEntity(tt, ll.LeaveId);

                if (leaveWindow == null || leaveWindow.IsDisposed)
                {
                    leaveWindow          = new Leave();
                    leaveWindow.Leaveman = this.user;
                    leaveWindow.Role     = role;
                }
                if (!leaveWindow.Created)
                {
                    leaveWindow.Show();
                }
                else
                {
                    leaveWindow.WindowState = FormWindowState.Normal;
                    leaveWindow.Focus();
                }
            }
            else if (l1.Tag.GetType() == typeof(KjqbService.BusinessService))
            {
                if (businessManagement == null || businessManagement.IsDisposed)
                {
                    businessManagement = new BusinessManagement();
                }
                if (!businessManagement.Created)
                {
                    businessManagement.User = this.User;
                    businessManagement.Role = this.Role;
                    businessManagement.Show();
                }
                else
                {
                    businessManagement.WindowState = FormWindowState.Normal;
                    businessManagement.Focus();
                }
            }
        }