コード例 #1
0
ファイル: app_rej.aspx.cs プロジェクト: agailevictor/eleave2
        protected void lnkforward_Click(object sender, EventArgs e)
        {
            LinkButton  lnk = sender as LinkButton;
            GridViewRow row = lnk.NamingContainer as GridViewRow;
            int         id  = int.Parse(grd_app_rej.DataKeys[row.RowIndex].Value.ToString());

            bus.lid    = id;
            bus.userid = int.Parse(Session["user_id"].ToString());
            int r = bus.approve_leave();

            if (r == 1)
            {
                fetch_mail_details_hr();
                mailbody = "<table  border='1' cellpadding='0' cellspacing='0' style='width: 850px; border-color: black;'><tr><td colspan='9'><br>&nbsp &nbspDear " + row.Cells[2].Text.ToString() + ",<br /><br />&nbsp&nbsp&nbsp&nbsp&nbspLeave application submitted by you is <b>Approved </b> on " + DateTime.Now.ToString("dd/MM/yyyy") + ".</b> The details are as follows.<br /><br /></td></tr><tr style='font-weight: 700;'></tr><tr><td colspan='9'><br/><p></p><p> &nbsp&nbsp&nbspName:   " + row.Cells[2].Text.ToString() + "</p><p>&nbsp&nbsp&nbspDepartment:   " + row.Cells[3].Text.ToString() + "</p><p>&nbsp&nbsp&nbspDesignation:   " + row.Cells[4].Text.ToString() + " </p><p>&nbsp&nbsp&nbspLeave Type:   " + row.Cells[5].Text.ToString() + " </p><p>&nbsp&nbsp&nbspPeriod:   " + row.Cells[7].Text.ToString() + " </p><p>&nbsp&nbsp&nbspReason:   " + row.Cells[8].Text.ToString() + " </p><p>&nbsp&nbsp&nbspclick<a href=" + url2 + "> here </a>to login into the application (UOA)</p><p>&nbsp&nbsp&nbspclick<a href=" + url + "> here </a>to login into the application</p><br/></td></tr><tr></tr><td colspan='9' style='font-weight: bold' align='right'><br /><br />Regards,<br />Team e-leave</td></tr><tr><td align='center'><p style='color:blue;'> This is a system generated response. Please do not respond to this email id.</p></td></tr></table>";
                bool check = SendWebMail(row.Cells[11].Text.ToString(), "Leave Application Notification", mailbody, toemail, "", "*****@*****.**");
                if (check == true)
                {
                    fillleavesapr();
                    ScriptManager.RegisterStartupScript(this, GetType(), "displayalertmessage", "success();", true);
                }
                else
                {
                    fillleavesapr();
                    ScriptManager.RegisterStartupScript(this, GetType(), "displayalertmessage", "warningemail();", true);
                }
            }
            else
            {
                fillleavesapr();
                ScriptManager.RegisterStartupScript(this, GetType(), "displayalertmessage", "error();", true);
            }
        }