Exemplo n.º 1
0
    public void Bind()
    {
        SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["Connection"]);

        Sqlselete ss  = new Sqlselete();
        DataSet   dsa = ss.SelectEmp("");

        ListBox1.DataSource     = dsa.Tables[0];
        ListBox1.DataTextField  = "Name";
        ListBox1.DataValueField = "Employeeid";
        ListBox1.DataBind();

        con.Open();
        string         strSql1 = "select * from Employee where Employeeid in (select UserID from FlowStepPerson where StepID=" + Request.QueryString["stepid"] + ")";
        SqlDataAdapter daa     = new SqlDataAdapter(strSql1, con);
        DataSet        dss     = new DataSet();

        daa.Fill(dss);


        this.ListBox2.DataSource     = dss.Tables[0];
        this.ListBox2.DataTextField  = "Name";
        this.ListBox2.DataValueField = "Employeeid";
        this.ListBox2.DataBind();
        con.Close();
    }
Exemplo n.º 2
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        try
        {
            string id = this.GridView1.DataKeys[this.GridView1.SelectedIndex]["ID"].ToString();

            Sqlselete     ss     = new Sqlselete();
            int           userid = Convert.ToInt32(ss.SelectEmpByUserName(Session["UserName"].ToString()));
            SqlConnection con    = new SqlConnection(ConfigurationManager.AppSettings["Connection"]);
            con.Open();
            string     sql = "update Flow set Name='" + this.flowname.Text + "',TypeID=" + this.flowtype.SelectedItem.Value + ",Des='" + this.flowcontent.Text + "',UserID=" + userid + "where ID=" + id;
            SqlCommand com = new SqlCommand(sql, con);
            if (com.ExecuteNonQuery() > 0)
            {
            }
            else
            {
                Response.Write("<script>alert('保存失败!');</script>");
            }
            con.Close();
            Bind();
        }
        catch (Exception)
        {
            Response.Write("<script>alert('登录超时,请重新登录!');window.location.href='../Login.aspx'</script>");
        }
    }
Exemplo n.º 3
0
    protected void Button2_Click(object sender, EventArgs e)
    {
        Sqlselete ss = new Sqlselete();

        try
        {
            int           userid = Convert.ToInt32(ss.SelectEmpByUserName(Session["UserName"].ToString()));
            SqlConnection con    = new SqlConnection(ConfigurationManager.AppSettings["Connection"]);
            con.Open();
            string     sql = "insert into Flow values('" + this.flowname.Text + "'," + this.flowtype.SelectedItem.Value + ",'" + this.flowcontent.Text + "',1," + userid + ")";
            SqlCommand com = new SqlCommand(sql, con);
            if (com.ExecuteNonQuery() > 0)
            {
            }
            else
            {
                Response.Write("<script>alert('保存失败!');</script>");
            }
            con.Close();
            Bind();
        }
        catch (Exception)
        {
            Response.Write("<script>alert('登录超时,请重新登录!');window.location.href='../Login.aspx'</script>");
        }
    }
Exemplo n.º 4
0
        public void Bind()
        {
            DataSet ds = new Sqlselete().Getds("select * from Flow where IsFix=0");

            this.GridView1.DataSource = ds.Tables[0];
            this.GridView1.DataBind();
        }
Exemplo n.º 5
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            if (drpFltype.SelectedIndex != 0 && !string.IsNullOrEmpty(drpFlow.SelectedItem.Text))
            {
                string    title  = this.txtTitle.Text;
                int       urgent = Convert.ToInt32(this.drpUrgent.SelectedIndex);
                int       flowid = Convert.ToInt32(this.drpFlow.SelectedItem.Value);
                Sqlselete ss     = new Sqlselete();
                int       userid = Convert.ToInt32(ss.SelectEmpByUserName(Session["UserName"].ToString()));
                //string FileName = this.FileUpload1.PostedFile.FileName;
                string content = this.TextBox2.Text;
                string src     = "";
                if (Request.QueryString["id"] != null)
                {
                    string sql = "update FlowDoc set Title='" + title + "',Content='" + content + "'";
                    if (OperateDB.ExecuteNonQuery(sql) > 0)
                    {
                        Response.Write("<script language=javascript>alert('保存成功!');</script>");
                    }
                    else
                    {
                        Response.Write("<script language=javascript>alert('保存失败!');</script>");
                    }
                }
                else
                {
                    if (!Directory.Exists(Server.MapPath(".") + "\\Files\\"))
                    {
                        Directory.CreateDirectory(Server.MapPath(".") + "\\Files\\");
                    }

                    if (FileUpload1.PostedFile.ContentLength == 0)
                    {
                        src = "";
                    }
                    else
                    {
                        string   strFilePath = FileUpload1.PostedFile.FileName;
                        FileInfo fl          = new FileInfo(strFilePath);
                        string   Ext         = fl.Name;

                        src = Ext;
                        string ServerPath  = Server.MapPath(".");
                        string strSeraPath = ServerPath + "\\Files\\" + src;
                        FileUpload1.PostedFile.SaveAs(strSeraPath);
                    }


                    string strSql = "insert into FlowDoc values('" + title + "'," + urgent + "," + flowid + ",1," + userid + ",'" + content + "',default,1,0,'" + src + "')";
                    if (OperateDB.ExecuteNonQuery(strSql) > 0)
                    {
                        Response.Write("<script>alert('保存成功!');</script>");
                    }
                    else
                    {
                        Response.Write("<script>alert('保存失败!');</script>");
                    }
                }
            }
        }
Exemplo n.º 6
0
        public string getStep(string id)
        {
            string    step = null;
            string    sql  = "select IsEnd from FlowDoc where ID=" + Convert.ToInt32(id);
            Sqlselete ss   = new Sqlselete();

            int end = Convert.ToInt32(ss.getScalar(sql));

            if (end > 0)
            {
                step = "完成";
            }
            else
            {
                string  sqlstr = "select * from FlowPath where DocID=" + Convert.ToInt32(id);
                DataSet ds     = ss.Getds(sqlstr);
                //Response.Write("<script>alert('" + dr["IsApprove"].ToString() + "')</script>");
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    if (Convert.ToInt32(dr["IsApprove"]) != 2)
                    {
                        string sql1 = "select Name from FlowAction where ID in (select ActionId from FlowStep where Num=" + Convert.ToInt32(dr["Num"]) + " and FlowID=" + Convert.ToInt32(dr["FlowID"]) + ")";
                        step = new Sqlselete().getScalar(sql1).ToString();
                        break;
                    }
                }
            }
            return(step);
        }
Exemplo n.º 7
0
        public string getFlow(string id)
        {
            Sqlselete ss   = new Sqlselete();
            string    sql  = "select Name from Flow where ID=" + Convert.ToInt32(id);
            string    flow = ss.getScalar(sql);

            return(flow);
        }
Exemplo n.º 8
0
        public void Bind()
        {
            Sqlselete ss     = new Sqlselete();
            int       userid = Convert.ToInt32(ss.SelectEmpByUserName(Session["UserName"].ToString()));
            string    sql    = "select * from FlowDoc where UserID=" + userid;
            DataSet   ds     = ss.Getds(sql);

            this.GridView1.DataSource = ds.Tables[0];
            this.GridView1.DataBind();
        }
Exemplo n.º 9
0
        public void Bind()
        {
            id = Request.QueryString["id"];
            DataSet ds = new Sqlselete().Getds("select * from FlowPath where Comment<>'' and DocID=" + id);

            this.GridView1.DataSource = ds.Tables[0];
            this.GridView1.DataBind();
            if (ds.Tables[0].Rows.Count == 0)
            {
                this.warn.Visible = true;
            }
        }
Exemplo n.º 10
0
        protected void btnRefer_Click(object sender, EventArgs e)
        {
            if (!Directory.Exists(Server.MapPath(".") + "\\ArchivesFiles\\"))
            {
                Directory.CreateDirectory(Server.MapPath(".") + "\\ArchivesFiles\\");
            }
            //string FileName = this.FileUpload1.PostedFile.FileName;
            string comment = this.txComment.Text.ToString();
            string src     = "";

            if (FileUpload1.PostedFile == null)
            {
                src = "";
            }
            else
            {
                string   strFilePath = FileUpload1.PostedFile.FileName;
                FileInfo fl          = new FileInfo(strFilePath);
                string   Ext         = fl.Name;
                //string i = fl.Name;

                src = Ext;
                string ServerPath  = Server.MapPath(".");
                string strSeraPath = ServerPath + "\\ArchivesFiles\\" + src;
                FileUpload1.PostedFile.SaveAs(strSeraPath);
            }

            int     userid = Convert.ToInt32(new Sqlselete().getScalar("select Employeeid from Employee where username='******'"));
            int     num    = 0;
            DataSet dsp    = new Sqlselete().Getds("select * from FlowPath");

            foreach (DataRow dr in dsp.Tables[0].Rows)
            {
                if (Convert.ToInt32(dr["DocID"]) == Convert.ToInt32(Request.QueryString["id"]) && Convert.ToInt32(dr["UserID"]) == userid && Convert.ToInt32(dr["IsApprove"]) != 2)
                {
                    num = Convert.ToInt32(dr["Num"]);
                    break;
                }
            }
            string strSql = "update FlowPath set Comment='" +
                            comment + "',Atteachment='" + src
                            + "',IsApprove=2 where Num=" + num + " and DocID=" + Convert.ToInt32(Request.QueryString["id"]) + " and UserID=" + userid;

            if (new Sqlselete().Query(strSql) > 0)
            {
                Response.Write("<script>alert('提交成功')</script>");
            }

            upEnd();
        }
Exemplo n.º 11
0
 protected void btnFind_Click(object sender, EventArgs e)
 {
     if (this.drpType.SelectedItem.Text == "请选择")
     {
         Bind();
     }
     else
     {
         string  type = this.drpType.SelectedItem.Value.ToString();
         DataSet ds   = new Sqlselete().Getds("select * from Flow where IsFix=0 and TypeID=" + type);
         this.GridView1.DataSource = ds.Tables[0];
         this.GridView1.DataBind();
     }
 }
Exemplo n.º 12
0
        protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            int id     = Convert.ToInt32(this.GridView1.DataKeys[e.RowIndex]["ID"].ToString());
            int result = new Sqlselete().Query("delete from Flow where ID=" + id);

            if (result > 0)
            {
            }
            else
            {
                Response.Write("<script language=javascript>alert('删除失败!')</script>");
            }
            Bind();
        }
Exemplo n.º 13
0
        protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.panel.Visible   = true;
            this.Button1.Visible = false;
            this.Button3.Visible = true;
            string  id  = this.GridView1.DataKeys[this.GridView1.SelectedIndex]["ID"].ToString();
            DataSet dsf = new Sqlselete().Getds("select * from Flow where ID=" + id);

            foreach (DataRow drf in dsf.Tables[0].Rows)
            {
                this.txtName.Text = drf["Name"].ToString();
                this.drpFlowType.SelectedValue = drf["TypeID"].ToString();
                this.txtContent.Text           = drf["Des"].ToString();
            }
        }
Exemplo n.º 14
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         this.panel.Visible = false;
         DataSet ds = new Sqlselete().Getds("select * from FlowType");
         foreach (DataRow dr in ds.Tables[0].Rows)
         {
             this.drpType.Items.Add(new ListItem(dr["Name"].ToString(), dr["ID"].ToString()));
             this.drpFlowType.Items.Add(new ListItem(dr["Name"].ToString(), dr["ID"].ToString()));
         }
         this.drpType.Items.Insert(0, "请选择");
         Bind();
     }
 }
Exemplo n.º 15
0
        public void Bind()
        {
            int             userid = Convert.ToInt32(new Sqlselete().getScalar("select Employeeid from Employee where username='******'"));
            string          strsql = "select * from FlowDoc where ID in (select DocID from FlowPath where IsApprove<>2 and UserID=" + userid + ")";
            DataSet         ds     = new Sqlselete().Getds(strsql);
            DataView        dv     = ds.Tables[0].DefaultView;
            PagedDataSource pds    = new PagedDataSource();

            AspNetPager1.RecordCount  = dv.Count;
            pds.DataSource            = dv;
            pds.AllowPaging           = true;
            pds.CurrentPageIndex      = AspNetPager1.CurrentPageIndex - 1;
            pds.PageSize              = AspNetPager1.PageSize;
            this.GridView1.DataSource = pds;
            this.GridView1.DataBind();
        }
Exemplo n.º 16
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            string name   = this.txtName.Text;
            int    userID = Convert.ToInt32(new Sqlselete().getScalar("select Employeeid from Employee where username='******'"));
            string typeID = this.drpFlowType.SelectedItem.Value;
            string Des    = this.txtContent.Text;
            string strsql = "insert into Flow values('" + name + "'," + typeID + ",'" + Des + "',0," + userID + ")";
            int    result = new Sqlselete().Query(strsql);

            if (result > 0)
            {
                Bind();
            }
            else
            {
                Response.Write("<script language=javascript>alert('保存失败!')</script>");
            }
        }
Exemplo n.º 17
0
        public void Bind()
        {
            Sqlselete ss  = new Sqlselete();
            DataSet   dsa = ss.SelectEmp("");

            ListBox1.DataSource     = dsa.Tables[0];
            ListBox1.DataTextField  = "Name";
            ListBox1.DataValueField = "Employeeid";
            ListBox1.DataBind();

            string strSql1 = "select * from Employee where Employeeid in (select UserID from FlowStepPerson where StepID=" + Request.QueryString["stepid"] + ")";


            this.ListBox2.DataSource     = OperateDB.ExecuteDataSet(strSql1).Tables[0];
            this.ListBox2.DataTextField  = "Name";
            this.ListBox2.DataValueField = "Employeeid";
            this.ListBox2.DataBind();
        }
Exemplo n.º 18
0
        protected void Button2_Click(object sender, EventArgs e)
        {
            Sqlselete ss = new Sqlselete();

            try
            {
                int    userid = Convert.ToInt32(ss.SelectEmpByUserName(Session["UserName"].ToString()));
                string sql    = "insert into Flow values('" + this.flowname.Text + "'," + this.flowtype.SelectedItem.Value + ",'" + this.flowcontent.Text + "',1," + userid + ")";
                if (OperateDB.ExecuteNonQuery(sql) > 0)
                {
                }
                else
                {
                    Response.Write("<script>alert('保存失败!');</script>");
                }
                Bind();
            }
            catch (Exception)
            {
                Response.Write("<script>alert('登录超时,请重新登录!');window.location.href='../Login.aspx'</script>");
            }
        }
Exemplo n.º 19
0
        public void upEnd()
        {
            DataSet ds      = new Sqlselete().Getds("select * from FlowPath where DocID=" + Convert.ToInt32(Request.QueryString["id"]));
            int     approve = 0;

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                if (Convert.ToInt32(dr["IsApprove"]) != 2)
                {
                    approve = Convert.ToInt32(dr["IsApprove"]);
                    break;
                }
                else
                {
                    approve = Convert.ToInt32(dr["IsApprove"]);
                }
            }
            if (approve == 2)
            {
                new Sqlselete().Query("update FlowDoc set IsEnd=1 where ID=" + Convert.ToInt32(Request.QueryString["id"]));
            }
        }
Exemplo n.º 20
0
        public void Bind()
        {
            id = Request.QueryString["id"].ToString();
            DataSet ds = new Sqlselete().Getds("select * from FlowDoc where ID=" + Convert.ToInt32(Request.QueryString["id"]));

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                this.lblTitle.Text   = dr["Title"].ToString();
                this.lblStep.Text    = new Sqlselete().getScalar("select Name from Flow where ID=" + Convert.ToInt32(dr["FlowID"])).ToString();
                this.lblUrgent.Text  = dr["IsUrgent"].ToString().Equals("0") ? "一般" : "重要";
                this.lblUser.Text    = new Sqlselete().getScalar("select Name from Employee where Employeeid=" + dr["UserID"]).ToString();
                this.lblPubDate.Text = dr["PubDate"].ToString();
                this.txtcontent.Text = dr["Content"].ToString();
                path = dr["Attachment"].ToString();
                string[] a;
                a = path.Split(';');
                string[] AccIDList = { "0" };
                for (int i = 0; i < a.Length; i++)
                {
                    //LblAcc.Text += "<a href=\"upfiles/" + "+a[i]+"+  target=\"_blank\">" + a[i] + "</a>" + "&nbsp" + "&nbsp";
                    this.lblAr.Text += "<a href=\"Files/"
                                       + a[i]
                                       + "\" target=\"_blank\">"
                                       + a[i]
                                       + "</a>" + "&nbsp" + "&nbsp";
                }
            }

            string  sql    = "select * from FlowAction where ID in (select ActionID from FlowStep where FlowID in (select FlowID from FlowDoc where ID=" + Convert.ToInt32(Request.QueryString["id"]) + "))";
            DataSet dsstep = new Sqlselete().Getds(sql);
            string  step   = null;

            foreach (DataRow drs in dsstep.Tables[0].Rows)
            {
                step += Convert.ToString(drs["Name"]) + "-->";
            }
            this.lblStep.Text = step + "完成";
        }
Exemplo n.º 21
0
        public void send()
        {
            int     approve = Convert.ToInt32(new Sqlselete().getScalar("select top 1 Num from Path where FlowID=" + Convert.ToInt32(Request.QueryString["flowid"]) + " order by Num desc"));
            int     userid  = Convert.ToInt32(new Sqlselete().getScalar("select Employeeid from Employee where username='******'"));
            int     num     = Convert.ToInt32(new Sqlselete().getScalar("select Num from Path where UserID=" + userid));
            DataSet ds      = new Sqlselete().Getds("select * from Path where FlowID=" + Convert.ToInt32(Request.QueryString["flowid"]));
            int     result  = 0;

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                if (Convert.ToInt32(dr["UserID"]) == userid)
                {
                    string strSql = "insert into FlowPath (DocID,FlowID,StepID,UserID,IsApprove,Num,IsJoin) values(" + Convert.ToInt32(Request.QueryString["id"]) + "," +
                                    Convert.ToInt32(dr["FlowID"]) + "," + Convert.ToInt32(dr["ID"]) + "," + dr["UserID"].ToString() + "," + (approve - Convert.ToInt32(dr["Num"])) + "," + dr["Num"].ToString() + "," + dr["IsJoin"].ToString() + ")";
                    result = new Sqlselete().Query(strSql);



                    //result = new DBoperate().ExecuteUpdate(strSql);
                    continue;
                }
                if (Convert.ToInt32(dr["Num"]) > num)
                {
                    string strsql = "insert into FlowPath (DocID,FlowID,StepID,UserID,IsApprove,Num,IsJoin) values(" + Convert.ToInt32(Request.QueryString["id"]) + "," +
                                    Convert.ToInt32(dr["FlowID"]) + "," + Convert.ToInt32(dr["ID"]) + "," + dr["UserID"].ToString() + "," + (approve - Convert.ToInt32(dr["Num"])) + "," + dr["Num"].ToString() + "," + dr["IsJoin"].ToString() + ")";
                    result = new Sqlselete().Query(strsql);
                }
            }
            //修改FlowDoc表中IsSave字段值
            if (result > 0)
            {
                string strSql = "update FlowDoc set IsSave=0 where FlowID=" + Convert.ToInt32(Request.QueryString["flowid"]);


                int rs = new Sqlselete().Query("update FlowDoc set IsSave=0 where FlowID=" + Convert.ToInt32(Request.QueryString["flowid"]));
            }
            Bind();
        }
Exemplo n.º 22
0
        protected void Button3_Click(object sender, EventArgs e)
        {
            string id = this.GridView1.DataKeys[this.GridView1.SelectedIndex]["ID"].ToString();

            string name = this.txtName.Text;
            //int userId = new DBoperate().ExecuteScalar("select Employeeid from Employee where username="******"UserName"]);
            int    userID = Convert.ToInt32(new Sqlselete().getScalar("select Employeeid from Employee where username='******'"));
            string typeID = this.drpFlowType.SelectedItem.Value;
            string Des    = this.txtContent.Text;
            string strsql = "update Flow set Name='" + name + "',TypeID=" + typeID
                            + ",Des='" + Des + "',UserID=" + userID + "where ID=" + id;
            int result = new Sqlselete().Query(strsql);

            if (result > 0)
            {
                Response.Write("<script language=javascript>alert('修改成功!');</script>");
                Bind();
            }
            else
            {
                Response.Write("<script language=javascript>alert('保存失败!')</script>");
            }
        }
Exemplo n.º 23
0
        protected void Button2_Click(object sender, EventArgs e)
        {
            if (drpFltype.SelectedIndex != 0 && !string.IsNullOrEmpty(drpFlow.SelectedItem.Text))
            {
                //插入申请
                string    sql;
                string    title  = this.txtTitle.Text;
                int       urgent = Convert.ToInt32(this.drpUrgent.SelectedIndex);
                int       flowid = Convert.ToInt32(this.drpFlow.SelectedItem.Value);
                Sqlselete ss     = new Sqlselete();
                int       userid = Convert.ToInt32(ss.SelectEmpByUserName(Session["UserName"].ToString()));
                //string FileName = this.FileUpload1.PostedFile.FileName;
                string content = this.TextBox2.Text.ToString();
                string src     = "";
                if (Request.QueryString["id"] != null)
                {
                    sql = "update FlowDoc set Title='" + title + "',Content='" + content + "',IsSave=0";
                    if (OperateDB.ExecuteNonQuery(sql) != 1)
                    {
                        Response.Write("<script>alert('发送失败!');</script>");
                        return;
                    }
                    sql = "select top 1 Num from Path where FlowID=" + Convert.ToInt32(Request.QueryString["id"]) + " order by Num desc";
                    int approve = Convert.ToInt32(OperateDB.getExecuteScalar(sql));

                    sql = "select Num from Path where UserID=" + userid;
                    int num = Convert.ToInt32(OperateDB.getExecuteScalar(sql));

                    sql = "select * from Path where FlowID=" + flowid;

                    DataSet ds = OperateDB.ExecuteDataSet(sql);


                    //int result = 0;
                    foreach (DataRow dr in ds.Tables[0].Rows)
                    {
                        if (Convert.ToInt32(dr["UserID"]) == userid)
                        {
                            string strSql = "insert into FlowPath (DocID,FlowID,StepID,UserID,IsApprove,Num,IsJoin) values(" + Convert.ToInt32(Request.QueryString["id"]) + "," +
                                            Convert.ToInt32(dr["FlowID"]) + "," + Convert.ToInt32(dr["ID"]) + "," + dr["UserID"].ToString() + "," + (approve - Convert.ToInt32(dr["Num"])) + "," + dr["Num"].ToString() + "," + dr["IsJoin"].ToString() + ")";
                            if (OperateDB.ExecuteNonQuery(strSql) != 1)
                            {
                                Response.Write("<script>alert('发送失败!');</script>");
                                return;
                            }
                            continue;
                        }
                        if (Convert.ToInt32(dr["Num"]) > num)
                        {
                            string strsql = "insert into FlowPath (DocID,FlowID,StepID,UserID,IsApprove,Num,IsJoin) values(" + Convert.ToInt32(Request.QueryString["id"]) + "," +
                                            Convert.ToInt32(dr["FlowID"]) + "," + Convert.ToInt32(dr["ID"]) + "," + dr["UserID"].ToString() + "," + (approve - Convert.ToInt32(dr["Num"])) + "," + dr["Num"].ToString() + "," + dr["IsJoin"].ToString() + ")";
                            if (OperateDB.ExecuteNonQuery(strsql) != 1)
                            {
                                Response.Write("<script>alert('发送失败!');</script>");
                                return;
                            }
                        }
                    }
                }
                else
                {
                    if (!Directory.Exists(Server.MapPath(".") + "\\Files\\"))
                    {
                        Directory.CreateDirectory(Server.MapPath(".") + "\\Files\\");
                    }

                    if (FileUpload1.PostedFile.ContentLength == 0)
                    {
                        src = "";
                    }
                    else
                    {
                        string   strFilePath = FileUpload1.PostedFile.FileName;
                        FileInfo fl          = new FileInfo(strFilePath);
                        string   Ext         = fl.Name;

                        src = Ext;
                        string ServerPath  = Server.MapPath(".");
                        string strSeraPath = ServerPath + "\\Files\\" + src;
                        FileUpload1.PostedFile.SaveAs(strSeraPath);
                    }

                    string strSql1 = "insert into FlowDoc values('" + title + "'," + urgent + "," + flowid + ",1," + userid + ",'" + content + "',default,1,0,'" + src + "')";
                    if (OperateDB.ExecuteNonQuery(strSql1) != 1)
                    {
                        Response.Write("<script>alert('发送失败!');</script>");
                        return;
                    }

                    //插入申请审批路径
                    sql = "select top 1 ID from FlowDoc order by PubDate desc";
                    int docid = Convert.ToInt32(OperateDB.getExecuteScalar(sql));

                    sql = "select top 1 Num from Path where FlowID=" + flowid + " order by Num desc";
                    int approve = Convert.ToInt32(OperateDB.getExecuteScalar(sql));

                    sql = "select Num from Path where UserID=" + userid;
                    int num = Convert.ToInt32(OperateDB.getExecuteScalar(sql));//序号

                    sql = "select * from Path where FlowID=" + flowid;
                    DataSet ds = OperateDB.ExecuteDataSet(sql);
                    foreach (DataRow dr in ds.Tables[0].Rows)
                    {
                        if (Convert.ToInt32(dr["UserID"]) == userid)
                        {
                            string strSql = "insert into FlowPath (DocID,FlowID,StepID,UserID,IsApprove,Num,IsJoin) values(" + docid + "," +
                                            Convert.ToInt32(dr["FlowID"]) + "," + Convert.ToInt32(dr["ID"]) + "," + dr["UserID"].ToString() + "," + (approve - Convert.ToInt32(dr["Num"])) + "," + dr["Num"].ToString() + "," + dr["IsJoin"].ToString() + ")";
                            if (OperateDB.ExecuteNonQuery(strSql) != 1)
                            {
                                Response.Write("<script>alert('发送失败!');</script>");
                                return;
                            }
                            continue;
                        }
                        if (Convert.ToInt32(dr["Num"]) > num)
                        {
                            string strsql = "insert into FlowPath (DocID,FlowID,StepID,UserID,IsApprove,Num,IsJoin) values(" + docid + "," +
                                            Convert.ToInt32(dr["FlowID"]) + "," + Convert.ToInt32(dr["ID"]) + "," + dr["UserID"].ToString() + "," + (approve - Convert.ToInt32(dr["Num"])) + "," + dr["Num"].ToString() + "," + dr["IsJoin"].ToString() + ")";
                            if (OperateDB.ExecuteNonQuery(strsql) != 1)
                            {
                                Response.Write("<script>alert('发送失败!');</script>");
                                return;
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 24
0
 public void del()
 {
     int result = new Sqlselete().Query("delete from FlowDoc where ID=" + Request.QueryString["fdid"]);
 }
Exemplo n.º 25
0
        public string getFlow(string id)
        {
            string flow = new Sqlselete().getScalar("select Name from Flow where ID=" + Convert.ToInt32(id)).ToString();

            return(flow);
        }
Exemplo n.º 26
0
        public string getUser(string id)
        {
            string user = new Sqlselete().getScalar("select Name from Employee where Employeeid=" + Convert.ToInt32(id)).ToString();

            return(user);
        }