Beispiel #1
0
        private void link_bianji_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            //获得通知公告表中标题对应的信息,实例化一个jjtongzhiinfo
            string biaoti  = lbl_mingcheng.Text;
            string leixing = lbl_leixing.Text;
            //实例化一个mftongzhigonggao,把jjtongzhiinfo传递进来,mftongzhigonggao的状态设置为编辑模式(还有一个是创建模式)
            string str_sql = $"select * from jjdbrenwutaizhang.通知公告表 " +
                             $"where 标题='{biaoti}'";
            DataTable     mydt        = _mysql.ExecuteDataTable(str_sql);
            List <string> list_fanwei = new List <string>();

            foreach (DataRow dataRow in mydt.Rows)
            {
                list_fanwei.Add(dataRow["阅读范围"].ToString());
            }
            JJTongzhiInfo myinfo = new JJTongzhiInfo()
            {
                _biaoti          = mydt.Rows[0]["标题"].ToString(),
                _qianfaren       = mydt.Rows[0]["签发人"].ToString(),
                _qingzhonghuanji = mydt.Rows[0]["轻重缓急"].ToString(),
                _neirongpath     = mydt.Rows[0]["内容"].ToString(),
                _shixian         = mydt.Rows[0]["时限"].ToString(),
                _fujian          = mydt.Rows[0]["附件"].ToString(),
                _chuangjianren   = mydt.Rows[0]["创建人"].ToString(),
                _yuedufanwei     = string.Join(",", list_fanwei)
            };
            WFtongzhigonggao mywin = new WFtongzhigonggao(myinfo);

            mywin.mode = "编辑";
            if (mywin.ShowDialog() == DialogResult.OK)
            {
                JJMethod.a_shuaxinzhuye(null, null);
            }
        }
Beispiel #2
0
 /// <summary>
 /// 点击钉子按钮时触发的事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void pb_dingzi_Click(object sender, EventArgs e)
 {
     WinForm.WFgongzuoqingdan mywinform = new WinForm.WFgongzuoqingdan();
     if (mywinform.ShowDialog() == DialogResult.OK)
     {
         JJMethod.a_shuaxinzhuye(null, null);
     }
 }
Beispiel #3
0
        /// <summary>
        /// 点击删除图片时触发的事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void lbl_shanchu_Click(object sender, EventArgs e)
        {
            //工作清单删除=0
            bool b = _myc.DeleteGongzuoqingdan(task);

            if (b)
            {
                JJMethod.a_shuaxinzhuye(null, null);
                MessageBox.Show("工作清单已删除!");
            }
        }
Beispiel #4
0
        /// <summary>
        /// 点击销项按钮时触发的事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void lbl_xiaoxiang_Click(object sender, EventArgs e)
        {
            //显示心得体会窗口
            WinFormXiaoxiang mywin = new WinFormXiaoxiang(task)
            {
                StartPosition = FormStartPosition.CenterParent
            };

            //刷新数据
            if (mywin.ShowDialog() == DialogResult.OK)
            {
                JJMethod.a_shuaxinzhuye(null, null);
            }
        }
Beispiel #5
0
        /// <summary>
        /// 点击删除按钮时出发的事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void link_shanchu_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            //显示提示框,是否确认删除
            DialogResult mydr = MessageBox.Show("确认删除?", "删除信息", MessageBoxButtons.YesNo);

            if (mydr == DialogResult.Yes)
            {
                //从通知公告表中删除通知
                string name    = lbl_mingcheng.Text;
                string str_sql = $"delete from jjdbrenwutaizhang.通知公告表 where 标题='{name}'";
                _mysql.ExecuteNonQuery(str_sql);
                //刷新主界面
                JJMethod.a_shuaxinzhuye(null, null);
                //显示删除成功
                MessageBox.Show("通知公告已删除!");
            }
        }
Beispiel #6
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            //获得新消息,如果数量大于一,在 我的任务右侧显示红点
            int num = JJLoginInfo.GetWeiduTaskNum();

            if (num > 0)
            {
                lbl_newtask.Visible = true;
                lbl_newtask.Text    = $"{num}";
                //判断软件目前界面是否为我的主页,如果是的话需要刷新
                if (lbl_wodezhuye.BackColor == Color.White)
                {
                    if (num > JJLoginInfo.newmsgnum)
                    {
                        JJMethod.a_shuaxinzhuye(null, null);
                        JJLoginInfo.newmsgnum = num;
                    }
                }
            }
            else
            {
                lbl_newtask.Visible = false;
            }
        }
Beispiel #7
0
        /// <summary>
        /// 点击名称时触发的事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void label2_Click(object sender, EventArgs e)
        {
            //判断uc的类型,工作清单,通知公告,待办任务
            if (task is JJTaskInfo)
            {
                var myti = task as JJTaskInfo;
                //如果myti的状态是未读,就把状态变成未处理,然后让信封消失
                if (myti._zhuangtai.Equals("未读"))
                {
                    lbl_zhuangtai.Visible = false;
                    myti._zhuangtai       = "办理中";
                    _myc.UpdateZhuangtai(myti);
                }
                //判断未读任务数量,如果是0,要取消主界面我的任务右侧的红点

                int num = JJLoginInfo.GetWeiduTaskNum();
                if (num > 0)
                {
                    (this.ParentForm as Form1).lbl_newtask.Visible = true;

                    (this.ParentForm as Form1).lbl_newtask.Text = $"{num}";
                }
                else
                {
                    (this.ParentForm as Form1).lbl_newtask.Visible = false;
                }
                //在这里,不能直接使用转换后的task,因为信息不完整,应当根据类型和名称获得状态为“保存的”taskinfo
                JJTaskInfo info0 = task as JJTaskInfo;
                JJTaskInfo info  = GetBaocunTask(info0);
                Form       mywin = null;
                if (info._leixing.Equals("OKR事项"))
                {
                    mywin = new WFokrshixiang(info)
                    {
                        StartPosition = FormStartPosition.CenterParent
                    };
                }
                else if (info._leixing.Equals("常规事项"))
                {
                    mywin = new WFchangguishixiang(info)
                    {
                        StartPosition = FormStartPosition.CenterParent
                    };
                }
                else if (info._leixing.Equals("请休假单"))
                {
                    mywin = new WFqingxiujiadan(info)
                    {
                        StartPosition = FormStartPosition.CenterParent
                    };
                }
                else if (info._leixing.Equals("意见建议"))
                {
                    mywin = new WFyijianjianyi(info)
                    {
                        StartPosition = FormStartPosition.CenterParent
                    };
                }
                if (mywin.ShowDialog() == DialogResult.OK)
                {
                    //刷新数据
                    JJMethod.a_shuaxinzhuye(null, null);
                }
            }
            //如果是通知公告类型
            if (task is JJTongzhiInfo)
            {
                //将该任务的状态变为已读,,字体从粗体变为常规
                this.lbl_mingcheng.Font = new System.Drawing.Font(this.Font.Name, 9, FontStyle.Regular);
                JJTongzhiInfo info = task as JJTongzhiInfo;

                _myc.Yidu(info);//将状态从未读变为已读
                WinFormTongzhi mywin = new WinFormTongzhi(info)
                {
                    StartPosition = FormStartPosition.CenterParent
                };
                if (mywin.ShowDialog() == DialogResult.OK)
                {
                    JJMethod.a_shuaxinzhuye(null, null);
                }


                //WFtongzhigonggao mywin = new WFtongzhigonggao(info);
                //if (mywin.ShowDialog() == DialogResult.OK)
                //{
                //    //刷新数据
                //    _updatemaindata(null, null);

                //}
            }
            //如果是工作清单类型
            if (task is JJQingdanInfo)
            {
                JJQingdanInfo    ci    = task as JJQingdanInfo;
                WFgongzuoqingdan mywin = new WFgongzuoqingdan(ci)
                {
                    StartPosition = FormStartPosition.CenterParent
                };
                if (mywin.ShowDialog() == DialogResult.OK)
                {
                    //刷新数据
                    JJMethod.a_shuaxinzhuye(null, null);
                }
            }
        }