コード例 #1
0
ファイル: LabView.aspx.cs プロジェクト: minaik-com-tw/EIP
        protected void Page_PreRender(object sender, System.EventArgs e)
        {
            string head_id    = Request.QueryString["rowid"].ToString();
            string lab_id     = Request.QueryString["lab_id"];
            string requesturl = string.Format("IPQC_Ra/Lab/LabEdit.aspx?rowid={0}&lab_id={1}", head_id, lab_id);

            Inspect lab = new Inspect();

            lab.GetInfo(lab_id);


            //手動發mail 給下一關審核者
            if (_NotifyReview)
            {
                SmoothEnterprise.Database.DataSet ds = new SmoothEnterprise.Database.DataSet(SmoothEnterprise.Database.DataSetType.OpenRead);
                ds.Open("select   REPLACE(requesturl,'EDIT','VIEW') requesturl,b.name name,email,b.id bid, revieweruid , convert(varchar(20), a.initdate,120)'initdate'  from dgflowqueue a left join dguser" +
                        " b on revieweruid=b.id where requesturl like '%" + requesturl + "'  AND reviewdate IS NULL AND qseq is not null ");

                if (!ds.EOF)
                {
                    if (_NotifyType == "Next")
                    {
                        //送審
                        SendMail(head_id, lab_id, ds["revieweruid"].ToString(), lab_Ra_no.Text, lab.send_date.ToShortDateString());
                    }
                    else
                    {
                        //退回
                        SendMail(head_id, lab_id, ds["revieweruid"].ToString(), lab_Ra_no.Text, lab.send_date.ToShortDateString());
                    }
                }
                Response.Redirect("http://" + Request.Url.Authority.ToString() + "/Flowwork/MyApproval.aspx");//回到個人待審頁面
            }
        }
コード例 #2
0
ファイル: LabView.aspx.cs プロジェクト: minaik-com-tw/EIP
        private void Complete()
        {
            SmoothEnterprise.Database.DataSet ds = new SmoothEnterprise.Database.DataSet(SmoothEnterprise.Database.DataSetType.OpenRead);
            StringBuilder sql = new StringBuilder();

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

            Inspect lab = new Inspect();

            lab.GetInfo(lab_id);
            lab.UpdateStatus(lab_id, status.Complete);

            using (SmoothEnterprise.Database.DataSet rs = new SmoothEnterprise.Database.DataSet(SmoothEnterprise.Database.DataSetType.OpenUpdate))
            {
                StringBuilder sb = new StringBuilder();

                sb.Append("  select requestuid from eipa.dbo.dgflowqueue a  ");
                sb.AppendFormat(" where  a.requesturl like '%{0}' ", requesturl);
                sb.Append(" and revieweruid <>'00000000-0000-0000-0000-000000000000' ");
                sb.Append(" order by a.initdate desc ");

                rs.Open(sb.ToString());
                SendMail(head_id, lab_id, rs["requestuid"].ToString(), lab_Ra_no.Text, lab.send_date.ToShortDateString());
            }
            // Response.Redirect("http://" + Request.Url.Authority.ToString() + "/Flowwork/MyApproval.aspx");//回到個人待審頁面
        }
コード例 #3
0
ファイル: LabView.aspx.cs プロジェクト: minaik-com-tw/EIP
        private void Back()
        {
            string head_id = Request.QueryString["rowid"].ToString();
            string lab_id  = Request.QueryString["lab_id"];

            Inspect lab = new Inspect();

            lab.GetInfo(lab_id);
            lab.UpdateStatus(lab_id, status.Back);

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

            using (SmoothEnterprise.Database.DataSet rs = new SmoothEnterprise.Database.DataSet(SmoothEnterprise.Database.DataSetType.OpenUpdate))
            {
                StringBuilder sb = new StringBuilder();

                sb.Append("  select top 1 requestuid from eipa.dbo.dgflowlog a  ");
                sb.AppendFormat(" where  a.requesturl like '%{0}' ", requesturl);
                sb.Append(" and revieweruid='00000000-0000-0000-0000-000000000000' ");

                rs.Open(sb.ToString());

                SendMail(head_id, lab_id, rs["requestuid"].ToString(), 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 + "%'");
                }
            }
        }
コード例 #4
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 + "%'");
            }
        }
コード例 #5
0
    protected Inspect getLab(string lab_id)
    {
        Inspect lab = new Inspect();

        if (!string.IsNullOrEmpty(lab_id))
        {
            lab.GetInfo(lab_id);

            _status = (status)lab.status;
            pass    = lab.result;
        }
        return(lab);
    }
コード例 #6
0
ファイル: LabView.aspx.cs プロジェクト: minaik-com-tw/EIP
        private void MailReview()
        {
            string mail   = txt_Rmail.Value.Trim();
            string result = "";

            if (!string.IsNullOrEmpty(mail))
            {
                string  head_id = Request.QueryString["rowid"].ToString();
                string  lab_id  = Request.QueryString["lab_id"];
                Inspect lab     = new Inspect();
                lab.GetInfo(lab_id);

                string[] MailList = mail.Split(',');
                if (lab.result == 0)
                {
                    result = "Fail";
                }
                else if (lab.result == 1)
                {
                    result = "Pass";
                }
                else
                {
                    result = "OOC";
                }
                foreach (string Item in MailList)
                {
                    Dictionary <string, string> User = Utility.GetUIDInfo(Item);

                    string Subject = "(通知) IPQC Ra 實驗室檢驗單 - 單號:" + lab_Ra_no.Text + " 檢驗結果-" + result;

                    StringBuilder sb = new StringBuilder();
                    sb.AppendFormat("{0} 您好,<br><br> ", User["NAME"].ToString());
                    sb.AppendFormat("IPQC Ra實驗室檢驗單簽核系統內有一筆資料{0},請您查閱<br><br> ", lab_Ra_no.Text);
                    sb.AppendFormat("申請單號: {0}<br>", lab_Ra_no.Text);
                    sb.AppendFormat("申請日期: {0}<br> ", lab.send_date);
                    sb.AppendFormat("檢驗結果: {0}<br> ", result);
                    sb.AppendFormat("申請內容: {0}/IPQC_Ra/lab/labView.aspx?rowid={1}&lab_id={2}<br><br>", Utility.LocalUrl, head_id, lab_id);

                    sb.Append("Best Regards,<br>");
                    sb.Append("如您想了解更多有關員工入口網站的資訊請點選以下連結進入 <br>");
                    sb.Append("<a href=\"" + Utility.LocalUrl + "\">員工入口網站</a><br>");
                    sb.Append("感謝您對員工入口網站的支持與愛護,<font Color='red'>。因本信件為系統自動發送,請勿直接以此郵件回覆。</font>");

                    Utility.SendMail(User["EMAIL"].ToString(), "ePortal(員工入口網站)", Subject, sb.ToString());
                }
            }
        }