private void Get_email() { DataTable dt = Data.GetDepedenApprovalEmail(SQLStatic.EmployeeData.Account_Number(rblstEmployees.SelectedValue)); if (dt.Rows.Count.Equals(0)) { ViewState["decline_suject"] = ""; ViewState["decline_text"] = ""; ViewState["Approve_subject"] = ""; ViewState["Approve_text"] = ""; } else { ViewState["decline_suject"] = dt.Rows[1]["subject"].ToString(); ViewState["decline_text"] = dt.Rows[1]["memo"].ToString(); ViewState["Approve_subject"] = dt.Rows[0]["subject"].ToString(); ViewState["Approve_text"] = dt.Rows[0]["memo"].ToString(); } ViewState["Default_Emal"] = Data.employee_email(rblstEmployees.SelectedValue); if (!string.IsNullOrEmpty(SQLStatic.Sessions.GetSessionValue(session_id, "Approve_Subject"))) { ViewState["Approve_subject"] = SQLStatic.Sessions.GetSessionValue(session_id, "Approve_Subject"); ViewState["Approve_text"] = SQLStatic.Sessions.GetCLOBSessionValue(session_id, "Approve"); ViewState["Approve_Email"] = SQLStatic.Sessions.GetSessionValue(session_id, "Approve_Email"); } if (!string.IsNullOrEmpty(SQLStatic.Sessions.GetSessionValue(session_id, "Disapprove_Subject"))) { ViewState["decline_suject"] = SQLStatic.Sessions.GetSessionValue(session_id, "Disapprove_Subject"); ViewState["decline_text"] = SQLStatic.Sessions.GetCLOBSessionValue(session_id, "Disapprove"); ViewState["Disapprove_Email"] = SQLStatic.Sessions.GetSessionValue(session_id, "Disapprove_Email"); } }
private void Bulid_EEList() { rblstEmployees.Items.Clear(); DataTable tbl = Data.Get_Pending_Dep_list(session_id); if (!string.IsNullOrEmpty(Request.Params["ee"])) { foreach (DataRow dr in tbl.Rows) { if (!dr["employee_number"].ToString().Equals(Request.Params["ee"])) { dr.Delete(); } } tbl.AcceptChanges(); } if (tbl.Rows.Count.Equals(0)) { lblNodep.Visible = true; //lblName.Text = rblstEmployees.SelectedItem.Text + " Bas# " + Request.Params["ee"] + "<br />" + Generate_Account_Name(Request.Params["ee"]); lblName.Text = SQLStatic.EmployeeData.employee_name_(Request.Params["ee"]) + " Bas# " + Request.Params["ee"] + "<br /> " + Generate_Account_Name(Request.Params["ee"]); //dvMain.Visible = false; return; } rblstEmployees.DataSource = tbl; rblstEmployees.DataTextField = "Name"; rblstEmployees.DataValueField = "employee_number"; rblstEmployees.DataBind(); foreach (ListItem li in rblstEmployees.Items) { li.Text = li.Value + " - " + li.Text; } if (rblstEmployees.Items.Count > 0) { rblstEmployees.SelectedIndex = 0; Get_email(); } else { lblNoPending.Visible = true; btnSave.Visible = false; } //lblName.Text = rblstEmployees.SelectedItem.Text + " Bas# " + rblstEmployees.SelectedValue; lblName.Text = rblstEmployees.SelectedItem.Text + " Bas# " + rblstEmployees.SelectedValue + "<br />" + Generate_Account_Name(rblstEmployees.SelectedValue); txtEmailAddress.Text = Data.employee_email(rblstEmployees.SelectedValue); txtSubject.Text = ""; txtMassage.Text = ""; SQLStatic.Sessions.SetSessionValue(session_id, "Approve_Subject", ""); SQLStatic.Sessions.SetSessionValue(session_id, "Disapprove_Subject", ""); }
protected void rblstEmployees_SelectedIndexChanged(object sender, EventArgs e) { //lblName.Text = rblstEmployees.SelectedItem.Text + " Bas# " + rblstEmployees.SelectedValue; lblName.Text = rblstEmployees.SelectedItem.Text + " Bas# " + rblstEmployees.SelectedValue + "<br />" + Generate_Account_Name(rblstEmployees.SelectedValue); dvButtons.Visible = !SQLStatic.AccountData.RetaAccount(SQLStatic.EmployeeData.Account_Number(rblstEmployees.SelectedValue)); if (dvButtons.Visible) { ViewState["email_descline"] = 1; } else { ViewState["email_descline"] = 0; } ViewState["email_apprve"] = ViewState["email_descline"]; txtEmailAddress.Text = Data.employee_email(rblstEmployees.SelectedValue); txtEmailAddress.Text = Data.employee_email(rblstEmployees.SelectedValue); DrawGrid(); Get_email(); }