예제 #1
0
        //发布
        protected void Use_Click(object sender, EventArgs e)
        {
            string cal  = "";
            string call = "";
            int    i    = 0;

            for (i = 0; i <= GridView1.Rows.Count - 1; i++)
            {
                CheckBox cb = (CheckBox)GridView1.Rows[i].Cells[1].FindControl("del");
                if (cb.Checked == true)
                {
                    if (string.IsNullOrEmpty(cal))
                    {
                        cal = GridView1.DataKeys[i].Value.ToString();
                    }
                    else
                    {
                        cal = cal + "','" + GridView1.DataKeys[i].Value.ToString();
                    }

                    if (string.IsNullOrEmpty(call))
                    {
                        call = GridView1.DataKeys[i].Value.ToString();
                    }
                    else
                    {
                        call = call + "," + GridView1.DataKeys[i].Value.ToString();
                    }
                }
            }

            if (!string.IsNullOrEmpty(cal))
            {
                int j = 0;
                for (j = 0; j < (call.Split(',')).Length; j++)
                {
                    string mestr   = "";
                    string rwdhstr = "";
                    string rwstr   = "";

                    SqlDataReader datar = SqlHelper.ExecuteReader("select jsid,jsr from OA_RWD02 where ssrwid='" + call.Split(',')[j] + "'");
                    while (datar.Read())
                    {
                        mestr = mestr + "," + datar["jsr"].ToString();
                    }
                    datar.Close();

                    SqlDataReader datar1 = SqlHelper.ExecuteReader("select rwdh,rwbt from OA_RWD01 where rwid='" + call.Split(',')[j] + "'");
                    if (datar1.Read())
                    {
                        rwdhstr = rwdhstr + "," + "[" + datar1["rwdh"].ToString() + "]" + datar1["rwbt"].ToString();
                        rwstr   = rwstr + "," + datar1["rwbt"].ToString();
                    }
                    datar1.Close();

                    //Msg
                    if (xxtz.Checked == true | dxtz.Checked == true)
                    {
                        string message       = "请您尽快接收" + rwdhstr.Substring(1) + "任务单!" + this.Session["username"].ToString();
                        string templateParam = "{\"name\":\"" + rwstr.Substring(1) + "\",\"status\":" + "\"待接收\"" + "}";
                        if (!string.IsNullOrEmpty(mestr))
                        {
                            //hkdb.SendMsg(xxtz.Checked, dxtz.Checked, this.Session["userid"].ToString(), mestr.Substring(1), message);
                            hkdb.SendAliSMS(xxtz.Checked, dxtz.Checked, this.Session["userid"].ToString(), mestr.Substring(1), message, templateParam);
                        }
                        else
                        {
                            hkdb.SendMsg(xxtz.Checked, dxtz.Checked, this.Session["userid"].ToString(), mestr, message);
                        }
                    }
                    else
                    {
                        mydb.Alert("发布失败,请选择站内消息或手机短信任意一种!");
                        return;
                    }
                }

                SqlHelper.ExecuteSql("update OA_RWD01 set rwzt='已发布' where rwid in ('" + cal + "')");
                mydb.Alert("发布成功!");
                GridViewBind();
            }
            else
            {
                mydb.Alert("发布失败,请先选中记录!");
            }
        }
예제 #2
0
        //通知
        protected void Send_Click(object sender, EventArgs e)
        {
            string cal   = "";
            string mestr = "";
            int    i     = 0;

            for (i = 0; i <= GridView1.Rows.Count - 1; i++)
            {
                CheckBox cb = (CheckBox)GridView1.Rows[i].Cells[1].FindControl("del");
                if (cb.Checked == true)
                {
                    if (string.IsNullOrEmpty(cal))
                    {
                        cal = GridView1.DataKeys[i].Value.ToString();
                    }
                    else
                    {
                        cal = cal + "," + GridView1.DataKeys[i].Value.ToString();
                    }
                }
            }

            if (!string.IsNullOrEmpty(cal))
            {
                int j = 0;
                for (j = 0; j < (cal.Split(',')).Length; j++)
                {
                    SqlDataReader datar = SqlHelper.ExecuteReader("select jsid,jsr from OA_RWD02 where jsid='" + cal.Split(',')[j] + "'");
                    if (datar.Read())
                    {
                        mestr = mestr + "," + datar["jsr"].ToString();
                    }
                    datar.Close();
                }
            }

            if (string.IsNullOrEmpty(mestr))
            {
                mydb.Alert("请先选择接收人员,再执行任务催办!");
            }
            else
            {
                //Msg

                //SqlHelper.ExecuteSql("insert into OA_Rwd01(cbyy) values('" + hkdb.GetStr(cbreason.Text) + "',GETDATE())");
                var arr = mestr.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                for (i = 0; i < arr.Length; i++)
                {
                    SqlHelper.ExecuteSql("insert into OA_RwCb(rwid,reason,person,createuser,createtime) values ('" + hkdb.GetStr(rwidstr.Text) + "','" + hkdb.GetStr(cbreason.Text) + "','" + arr[i] + "','" + this.Session["userid"] + "', GETDATE())");
                }
                mydb.Alert_Close("已成功催办!");

                if (xxtz.Checked == true | dxtz.Checked == true)
                {
                    string message       = "请尽快接收[" + hkdb.GetStr(rwdh.Text) + "-" + lblrwbt.Text + "]任务单!" + this.Session["username"].ToString();
                    string templateParam = "{\"name\":\"" + lblrwbt.Text + "\",\"status\":" + "\"催办\"" + "}";
                    hkdb.SendAliSMS(xxtz.Checked, dxtz.Checked, this.Session["userid"].ToString(), mestr.Substring(1), message, templateParam);
                    //hkdb.SendMsg(xxtz.Checked, dxtz.Checked, this.Session["userid"].ToString(), mestr.Substring(1), message);
                    mydb.Alert_Close("己成功通知任务接收人员!");
                }
                else
                {
                    mydb.Alert("请先选择站内消息或手机短信任意一种,再执行任务催办!");
                }
            }
        }
예제 #3
0
        //问责
        protected void Send_Click1(object sender, EventArgs e)
        {
            string cal = "";
            string ca2 = "";
            string ca3 = "";
            string ca4 = "";

            string mestr = "";
            int    i     = 0;

            for (i = 0; i <= GridView1.Rows.Count - 1; i++)
            {
                CheckBox cb = (CheckBox)GridView1.Rows[i].Cells[1].FindControl("del");


                if (cb.Checked == true)
                {
                    if (string.IsNullOrEmpty(cal))
                    {
                        cal = GridView1.DataKeys[i].Value.ToString();
                    }
                    else
                    {
                        cal = cal + "," + GridView1.DataKeys[i].Value.ToString();
                    }
                }
            }
            for (i = 0; i <= GridView2.Rows.Count - 1; i++)
            {
                CheckBox cb1 = (CheckBox)GridView2.Rows[i].Cells[1].FindControl("del1");
                if (cb1.Checked == true)
                {
                    if (string.IsNullOrEmpty(ca2))
                    {
                        ca2 = GridView2.DataKeys[i].Value.ToString();
                    }
                    else
                    {
                        ca2 = ca2 + "," + GridView2.DataKeys[i].Value.ToString();
                    }
                }
            }
            for (i = 0; i <= GridView3.Rows.Count - 1; i++)
            {
                CheckBox cb2 = (CheckBox)GridView3.Rows[i].Cells[1].FindControl("del2");
                if (cb2.Checked == true)
                {
                    if (string.IsNullOrEmpty(ca3))
                    {
                        ca3 = GridView3.DataKeys[i].Value.ToString();
                    }
                    else
                    {
                        ca3 = ca3 + "," + GridView3.DataKeys[i].Value.ToString();
                    }
                }
            }

            for (i = 0; i <= GridView4.Rows.Count - 1; i++)
            {
                CheckBox cb3 = (CheckBox)GridView4.Rows[i].Cells[1].FindControl("del3");
                if (cb3.Checked == true)
                {
                    if (string.IsNullOrEmpty(ca4))
                    {
                        ca4 = GridView4.DataKeys[i].Value.ToString();
                    }
                    else
                    {
                        ca4 = ca4 + "," + GridView4.DataKeys[i].Value.ToString();
                    }
                }
            }
            if (!string.IsNullOrEmpty(cal))
            {
                int j = 0;
                for (j = 0; j < (cal.Split(',')).Length; j++)
                {
                    SqlDataReader datar = SqlHelper.ExecuteReader("select jsid,jsr from OA_RWD02 where jsid='" + cal.Split(',')[j] + "'");
                    if (datar.Read())
                    {
                        mestr = mestr + "," + datar["jsr"].ToString();
                    }
                    datar.Close();
                }
            }

            if (!string.IsNullOrEmpty(ca2))
            {
                string message       = "您办理的[" + hkdb.GetStr(rwdh.Text) + "]" + lblrwbt.Text + ";任务被问责!" + this.Session["username"].ToString();
                string templateParam = "{\"name\":\"" + lblrwbt.Text + "\",\"status\":" + "\"被问责\"" + "}";
                hkdb.SendAliSMS(xxtz.Checked, dxtz.Checked, this.Session["userid"].ToString(), ca2, message, templateParam);
                var arr = ca2.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                for (i = 0; i < arr.Length; i++)
                {
                    string s  = Convert.ToString(SqlHelper.ExecuteScalar("select score from yh WHERE ui_id ='" + arr[i] + "'"));
                    int    ss = Convert.ToInt32(s);
                    SqlHelper.ExecuteSql("Update yh set score='" + (ss - 3) + "' WHERE ui_id='" + arr[i] + "'");
                    SqlHelper.ExecuteSql("insert into OA_RwPunish (rwid,reason,person,createuser,createtime) values ('" + hkdb.GetStr(rwidstr.Text) + "','" + hkdb.GetStr(reason.Text) + "','" + arr[i] + "','" + this.Session["userid"] + "', GETDATE())");
                }
                mydb.Alert_Close("己成功问责!");
            }
            if (!string.IsNullOrEmpty(ca3))
            {
                string message       = "您办理的[" + hkdb.GetStr(rwdh.Text) + "]" + lblrwbt.Text + ";任务被问责!" + this.Session["username"].ToString();
                string templateParam = "{\"name\":\"" + lblrwbt.Text + "\",\"status\":" + "\"被问责\"" + "}";
                hkdb.SendAliSMS(xxtz.Checked, dxtz.Checked, this.Session["userid"].ToString(), ca3, message, templateParam);
                var arr = ca3.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                for (i = 0; i < arr.Length; i++)
                {
                    string s  = Convert.ToString(SqlHelper.ExecuteScalar("select score from yh WHERE ui_id ='" + arr[i] + "'"));
                    int    ss = Convert.ToInt32(s);
                    SqlHelper.ExecuteSql("Update yh set score='" + (ss - 3) + "' WHERE ui_id='" + arr[i] + "'");
                    SqlHelper.ExecuteSql("insert into OA_RwPunish (rwid,reason,person,createuser,createtime) values ('" + hkdb.GetStr(rwidstr.Text) + "','" + hkdb.GetStr(reason.Text) + "','" + arr[i] + "','" + this.Session["userid"] + "', GETDATE())");
                }
                mydb.Alert_Close("己成功问责!");
            }
            if (!string.IsNullOrEmpty(ca4))
            {
                string message       = "您办理的[" + hkdb.GetStr(rwdh.Text) + "]" + lblrwbt.Text + ";任务被问责!" + this.Session["username"].ToString();
                string templateParam = "{\"name\":\"" + lblrwbt.Text + "\",\"status\":" + "\"被问责\"" + "}";
                hkdb.SendAliSMS(xxtz.Checked, dxtz.Checked, this.Session["userid"].ToString(), ca4, message, templateParam);
                var arr = ca4.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                for (i = 0; i < arr.Length; i++)
                {
                    string s  = Convert.ToString(SqlHelper.ExecuteScalar("select score from yh WHERE ui_id ='" + arr[i] + "'"));
                    int    ss = Convert.ToInt32(s);
                    SqlHelper.ExecuteSql("Update yh set score='" + (ss - 3) + "' WHERE ui_id='" + arr[i] + "'");
                    SqlHelper.ExecuteSql("insert into OA_RwPunish (rwid,reason,person,createuser,createtime) values ('" + hkdb.GetStr(rwidstr.Text) + "','" + hkdb.GetStr(reason.Text) + "','" + arr[i] + "','" + this.Session["userid"] + "', GETDATE())");
                }
                mydb.Alert_Close("己成功问责!");
            }

            if (string.IsNullOrEmpty(mestr))
            {
                //mydb.Alert("请先选择,再执行问责!");
            }
            else
            {
                string message       = "您办理的[" + hkdb.GetStr(rwdh.Text) + "]" + lblrwbt.Text + ";任务被问责!" + this.Session["username"].ToString();
                string templateParam = "{\"name\":\"" + lblrwbt.Text + "\",\"status\":" + "\"被问责\"" + "}";
                hkdb.SendAliSMS(xxtz.Checked, dxtz.Checked, this.Session["userid"].ToString(), mestr.Substring(1), message, templateParam);
                var arr = mestr.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);

                for (i = 0; i < arr.Length; i++)
                {
                    string s  = Convert.ToString(SqlHelper.ExecuteScalar("select score from yh WHERE ui_id ='" + arr[i] + "'"));
                    int    ss = Convert.ToInt32(s);
                    SqlHelper.ExecuteSql("Update yh set score='" + (ss - 3) + "' WHERE ui_id='" + arr[i] + "'");
                    SqlHelper.ExecuteSql("insert into OA_RwPunish (rwid,reason,person,createuser,createtime) values ('" + hkdb.GetStr(rwidstr.Text) + "','" + hkdb.GetStr(reason.Text) + "','" + arr[i] + "','" + this.Session["userid"] + "', GETDATE())");
                }
                mydb.Alert_Close("己成功问责!");
            }
        }
예제 #4
0
        //送审
        protected void SS_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(Request.QueryString["jsid"]))
            {
                string FileName          = "";
                string FileVisualPathStr = "";
                string UserName          = this.Session["userid"].ToString();
                string PathStr           = null;
                string type = null;

                //判断附件
                if (!string.IsNullOrEmpty(fj.PostedFile.FileName.Trim()))
                {
                    try
                    {
                        PathStr = fj.PostedFile.FileName;

                        if (fj.PostedFile.ContentLength < 1024 * int.Parse(lblAttachSize.Text))
                        {
                            type     = PathStr.Substring((PathStr.LastIndexOf(".") + 1));
                            FileName = System.IO.Path.GetFileName(fj.PostedFile.FileName);
                            //if (!System.IO.Directory.Exists((Server.MapPath("..\\..\\") + "Attach\\oa\\rw\\" + UserName)))
                            //{
                            //    System.IO.Directory.CreateDirectory((Server.MapPath("..\\..\\") + "Attach\\oa\\rw\\" + UserName));
                            //}
                            Random TempNameInt   = new Random();
                            string NewDocDirName = TempNameInt.Next(100000000).ToString();
                            if (!System.IO.Directory.Exists((Server.MapPath("..\\..\\") + "Attach\\oa\\rw\\" + UserName + "\\" + NewDocDirName)))
                            {
                                System.IO.Directory.CreateDirectory((Server.MapPath("..\\..\\") + "Attach\\oa\\rw\\" + UserName + "\\" + NewDocDirName));
                            }
                            TempNameInt = null;
                            fj.PostedFile.SaveAs((Server.MapPath("..\\..\\") + "Attach\\oa\\rw\\" + UserName + "\\" + NewDocDirName + "\\" + FileName));
                            FileVisualPathStr = "\\Attach\\oa\\rw\\" + UserName + "\\" + NewDocDirName + "\\";
                        }
                        else
                        {
                            mydb.Alert("附件大小超出 " + lblAttachSize.Text + " KB的限制!");
                        }
                    }
                    catch (Exception ex)
                    {
                        throw ex;
                    }
                }

                SqlHelper.ExecuteSql("update OA_RWD02 set jszt='送审中',clr='" + this.Session["userid"] + "',clsj=GETDATE(),fjmc='" + FileName + "',fjlj='" + FileVisualPathStr + "',bzsm='" + hkdb.GetStr(wcqk.Text) + "' where jsid='" + hkdb.GetStr(Request.QueryString["jsid"].ToString()) + "'");

                //Msg
                if (xxtz.Checked == true | dxtz.Checked == true)
                {
                    string message       = "[" + hkdb.GetStr(rwdh.Text) + "]" + lblrwbt.Text + ";任务单已经办理,请审核!" + this.Session["username"].ToString();
                    string templateParam = "{\"name\":\"" + lblrwbt.Text + "\",\"status\":" + "\"送审中\"" + "}";
                    hkdb.SendAliSMS(xxtz.Checked, dxtz.Checked, this.Session["userid"].ToString(), fbr.Text, message, templateParam);
                    //hkdb.SendMsg(xxtz.Checked, dxtz.Checked, this.Session["userid"].ToString(), fbr.Text, message);
                    mydb.Alert_Close("己成功通知任务发布人!");
                }

                SSBtn.Visible = false;

                if (Request.QueryString["flag"] != null && Request.QueryString["flag"].Equals("index"))
                {
                    mydb.Alert_Reload_Close("已成功送审待办任务,请等候审批结果!");
                }
                else
                {
                    mydb.Alert_Refresh_Close("已成功送审待办任务,请等候审批结果!", "wddbrwy.aspx");
                }
            }
            else
            {
                mydb.Alert("请先选中待办任务再执行送审!");
            }
        }