示例#1
0
        protected void Btn_Stop_Click(object sender, SmoothEnterprise.Flowwork.UI.WebControl.FlowButtonEventArgs e)
        {
            string head_id = Request.QueryString["rowid"].ToString();

            _status = status.Stop;

            string  lab_id = Request.QueryString["lab_id"];
            Inspect lab    = new Inspect();

            lab.GetInfo(lab_id);

            lab.UpdateStatus(lab_id, status.Stop);
            setDisplay();
            UpdateGV();
            //發通知給目前審核者,說已經中止了

            SendMail(head_id, lab_id, _leader, lab_Ra_no.Text, lab.send_date.ToShortDateString());

            DBTransfer fs = new DBTransfer();

            if (!string.IsNullOrEmpty(lab_id))
            {
                fs.RunIUSql("delete  dgflowqueue where requesturl like '%" + lab_id + "%'");
            }
        }
示例#2
0
        protected void Btn_RemindReviewer_Click(object sender, SmoothEnterprise.Flowwork.UI.WebControl.FlowButtonEventArgs e)
        {
            string request_id = "";
            string lab_id     = Request.QueryString["lab_id"];
            string head_id    = Request.QueryString["rowid"];

            string requesturl = string.Format("IPQC_Ra/Lab/LabEdit.aspx?rowid={0}&lab_id={1}", head_id, lab_id);

            UpdateGV();
            lab_up.Update();
            SmoothEnterprise.Database.DataSet rs = new SmoothEnterprise.Database.DataSet(SmoothEnterprise.Database.DataSetType.OpenUpdate);
            StringBuilder sb = new StringBuilder();

            sb.Append(" select revieweruid bid from eipa.dbo.dgflowqueue f  ");
            sb.AppendFormat(" where requesturl  like '%{0}' and revieweruid <> '{1}' and reviewdate is null ", requesturl, System.Guid.Empty.ToString());
            rs.Open(sb.ToString());
            //rs.Open("select a.*, b.name requestname, b.email,b.id bid from dgflowqueue a left join dguser b on a.revieweruid = b.id " +
            //        "left join eipe.dbo.IPQC_Ra_Lab l on l.rowid= '" + lab_id + "' " +
            //        "where requesturl = '/lab/labEdit.aspx?rowid=" + head_id + "&lab_id="+lab_id+"' and revieweruid <> " +"'" + System.Guid.Empty.ToString() + "' and reviewdate is null ");
            if (!rs.EOF)
            {
                request_id = rs["bid"].ToString();

                #region 代理人
                SmoothEnterprise.Database.DataSet rs2 = new SmoothEnterprise.Database.DataSet(SmoothEnterprise.Database.DataSetType.OpenUpdate);
                rs2.Open(" SELECT b.id 'proxy',email,sdate,edate,GETDATE() FROM dguserdeputy a left join dguser b on a.deputyuid=b.id " +
                         " where  a.uid='" + request_id + "'  " +
                         " and  " +
                         " ((a.sid is null and  sdate < GETDATE() and edate is null) or " +
                         " (a.sid='4a632e9b-efc0-4162-9751-94996d850faf' and sdate < GETDATE() and edate is null) or " +
                         " (a.sid='4a632e9b-efc0-4162-9751-94996d850faf' and sdate < GETDATE() and edate > GETDATE()) or " +
                         "  a.sid is null and sdate < GETDATE() and edate  > GETDATE()) ");
                if (!rs2.EOF)
                {
                    request_id = rs2["proxy"].ToString();
                }
                rs2.Close();
                #endregion

                ReviewerMail(head_id, lab_id, request_id, lab_Ra_no.Text);
            }
        }
示例#3
0
        protected void Btn_SendRequest_Click(object sender, SmoothEnterprise.Flowwork.UI.WebControl.FlowButtonEventArgs e)
        {
            string head_id = Request.QueryString["rowid"];
            string lab_id  = Request.QueryString["lab_id"];

            Inspect lab = new Inspect();


            if (this.IsValid)
            {
                try
                {
                    this.Btn_SendRequest.Flow = this.FlowClient1;
                    _status = status.Send;

                    lab.UpdateStatus(lab_id, status.Send);
                    setDisplay();
                    UpdateGV();
                    // lab_InspectNO.Text = AddONumber(Request.QueryString["rowid"]);

                    // Response.Write("<script>alert('執行送審');</script>");
                    //執行送審程序
                    ArrayList managerid = new ArrayList();  //主管id
                    ArrayList managernm = new ArrayList();  //主管 Text

                    managerid.Add(_leader);
                    managernm.Add("確認");

                    int count = 0;
                    foreach (string i in managerid)
                    {
                        this.FlowClient1.AddParameter("USER" + count.ToString(), i);
                        count++;
                    }
                    count = 0;
                    foreach (string i in managernm)
                    {
                        this.FlowClient1.AddParameter("USERTITLE" + count.ToString(), i);
                        count++;
                    }


                    sharflow12_2.Flowwork.sharflow12_21 flow = new sharflow12_2.Flowwork.sharflow12_21();
                    FlowClient1.Text = "IPQC Ra 實驗室檢驗單 單號:" + lab_Ra_no.Text;

                    switch (managerid.Count)  //依舊arraylist裡面有幾個,來判斷走那條flow
                    {
                    case 1:
                        e.NextNode = flow.sharflow12_2Node1;
                        break;

                    case 2:
                        e.NextNode = flow.sharflow12_2Node1;
                        break;

                    case 3:
                        e.NextNode = flow.sharflow12_2Node1;
                        break;

                    case 4:
                        e.NextNode = flow.sharflow12_2Node1;
                        break;

                    case 5:
                        e.NextNode = flow.sharflow12_2Node1;
                        break;

                    case 6:
                        e.NextNode = flow.sharflow12_2Node1;
                        break;

                    case 7:
                        e.NextNode = flow.sharflow12_2Node1;
                        break;

                    case 8:
                        e.NextNode = flow.sharflow12_2Node1;
                        break;

                    case 9:
                        e.NextNode = flow.sharflow12_2Node1;
                        break;

                    case 10:
                        e.NextNode = flow.sharflow12_2Node1;
                        break;

                    case 11:
                        e.NextNode = flow.sharflow12_2Node1;
                        break;

                    case 12:
                        e.NextNode = flow.sharflow12_2Node1;
                        break;

                    case 13:
                        e.NextNode = flow.sharflow12_2Node1;
                        break;

                    case 14:
                        e.NextNode = flow.sharflow12_2Node1;
                        break;

                    case 15:
                        e.NextNode = flow.sharflow12_2Node1;
                        break;
                    }

                    e.NextNode.ReviewerURL = "/IPQC_Ra/Lab/LabView.aspx";
                    FirstApprove(managerid[0].ToString());
                }
                catch (Exception ex)
                {
                    this.AddError(this, "BUTTON_save_Click()", "", ex.Message);
                }
            }
        }