public static String Activity_Transaction_Status_Update(int aid, int sid) { GK3_Driver gk3 = new GK3_Driver(); SqlConnection myconn = new SqlConnection(WebConfigurationManager.ConnectionStrings["sctcs_perkinsConnectionString"].ConnectionString); if (myconn.State != ConnectionState.Open) { myconn.Open(); } SqlCommand mycom = new SqlCommand("pr_act_transaction_status_upd", myconn); mycom.CommandType = CommandType.StoredProcedure; mycom.Parameters.Add("@key_activity_id", SqlDbType.Int).Value = aid; mycom.Parameters.Add("@p_flg_key_transaction_status_id", SqlDbType.Int).Value = sid; try { mycom.ExecuteNonQuery(); } catch (Exception ex) { return ex.ToString(); } return "1"; }
public static String get_Funding_Plan_Level(int aid) { String returnedvalue = string.Empty; GK3_Driver gk3 = new GK3_Driver(); SqlConnection myconn = new SqlConnection(WebConfigurationManager.ConnectionStrings["sctcs_perkinsConnectionString"].ConnectionString); if (myconn.State != ConnectionState.Open) { myconn.Open(); } SqlCommand mycom = new SqlCommand("pr_fp_funding_plan_level_get", myconn); mycom.CommandType = CommandType.StoredProcedure; mycom.Parameters.Add("@p_key_activity_id", SqlDbType.Int).Value = aid; SqlParameter myparam = new SqlParameter("@l_key_funding_plan_hdr_id", SqlDbType.Int); myparam.Direction = ParameterDirection.ReturnValue; mycom.Parameters.Add(myparam); // SqlDataReader mydr = mycom.ExecuteReader(CommandBehavior.CloseConnection); try { mycom.ExecuteNonQuery(); returnedvalue = mycom.Parameters["@l_key_funding_plan_hdr_id"].Value.ToString(); } catch (Exception ex) { return ex.ToString(); } return returnedvalue; }
public static String update_FundingPlan(int lp_id, int fph_id, int nlv_id, String cs) { GK3_Driver gk3 = new GK3_Driver(); SqlConnection myconn = new SqlConnection(WebConfigurationManager.ConnectionStrings["sctcs_perkinsConnectionString"].ConnectionString); string returnedvalue = "101"; if (myconn.State != ConnectionState.Open) { myconn.Open(); } SqlCommand mycom = new SqlCommand("pr_fp_funding_plan_level_upd", myconn); mycom.CommandType = CommandType.StoredProcedure; mycom.Parameters.Add("@p_key_local_plan_id", SqlDbType.Int).Value = lp_id; mycom.Parameters.Add("@p_key_funding_plan_hdr_id", SqlDbType.Int).Value = fph_id; mycom.Parameters.Add("@p_key_funding_plan_level_to_id", SqlDbType.VarChar).Value = nlv_id; SqlParameter myparam = new SqlParameter("l_perkins_sys_message", SqlDbType.NVarChar); myparam.Direction = ParameterDirection.ReturnValue; mycom.Parameters.Add(myparam); try { mycom.ExecuteNonQuery(); returnedvalue = mycom.Parameters["l_perkins_sys_message"].Value.ToString(); } catch(Exception ex) { return ex.ToString(); } return returnedvalue;// "101"; }
void Application_Error(object sender, EventArgs e) { // Code that runs when an unhandled error occurs string erroremailuser = "******"; try { GK3_Driver mydrive = new GK3_Driver(); System.Data.DataSet myds = new DataSet(); myds = mydrive.AllUserINFO(HttpContext.Current.User.Identity.Name.ToString()); erroremailuser = myds.Tables[0].Rows[0]["txt_email"].ToString(); } catch { } try { Exception objErr = Server.GetLastError().GetBaseException(); string emailrecps = WebConfigurationManager.AppSettings["ErrorEmails"].ToString(); MailMessage mm = new MailMessage(erroremailuser,emailrecps); mm.Subject = HttpContext.Current.User.Identity.Name.ToString() + " caused an error"; mm.Body = erroremailuser + " Has caused an error" + Environment.NewLine + Environment.NewLine + Environment.NewLine + "*******************Details ****************" + Environment.NewLine + Environment.NewLine + "**************Message**************" + Environment.NewLine + objErr.Message.ToString() + Environment.NewLine + Environment.NewLine + Environment.NewLine + Environment.NewLine + "*********Stack Trace *****************" + Environment.NewLine + objErr.StackTrace + Environment.NewLine + Environment.NewLine + Environment.NewLine + Environment.NewLine + Environment.NewLine + "****************Offending Page ******************" + Environment.NewLine + Request.Url; SmtpClient smtp = new SmtpClient(); smtp.UseDefaultCredentials = true; smtp.Send(mm); if (objErr.GetType().ToString() == "System.Data.SqlClient.SqlException") { Response.Redirect("http://localhost/perkins_vers2/General_UserError.aspx"); } //if (Session[Session.SessionID + "USERID"] == null) if (Context.Session == null || Context.Session.IsNewSession) { // Response.Redirect("http://localhost/perkins_vers2/SessionTimeOut.aspx"); } else { // Response.Redirect("http://localhost/perkins_vers2/UnexpectedError.aspx"); } } catch (Exception ex) { string mystring = ex.Message; string mestring = "filler"; // Response.Redirect("http://localhost/perkins_vers2/UnexpectedError.aspx"); } }
public static SqlDataReader get_Header_Info(int fph_id ) { GK3_Driver gk3 = new GK3_Driver(); SqlConnection myconn = new SqlConnection(WebConfigurationManager.ConnectionStrings["sctcs_perkinsConnectionString"].ConnectionString); if (myconn.State != ConnectionState.Open) { myconn.Open(); } SqlCommand mycom = new SqlCommand("pr_fp_funding_plan_hdr_get", myconn ); mycom.CommandType = CommandType.StoredProcedure; mycom.Parameters.Add("@key_funding_plan_hdr_id", SqlDbType.Int).Value = fph_id; SqlDataReader mydr = mycom.ExecuteReader(CommandBehavior.CloseConnection); return mydr; }
public static String del_Unfinished_Amendment(int aid, String ssid) { GK3_Driver gk3 = new GK3_Driver(); SqlConnection myconn = new SqlConnection(WebConfigurationManager.ConnectionStrings["sctcs_perkinsConnectionString"].ConnectionString); if (myconn.State != ConnectionState.Open) { myconn.Open(); } SqlCommand mycom = new SqlCommand("pr_at_amendment_incomplete_amd_del", myconn); mycom.CommandType = CommandType.StoredProcedure; mycom.Parameters.Add("@p_key_activity_id", SqlDbType.Int).Value = aid; try { mycom.ExecuteNonQuery(); } catch(Exception ex) { return ex.ToString(); } return "1"; }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { try { if (Session[Session.SessionID + "finishstat"] != null && Session[Session.SessionID + "finishstat"].ToString() == "false") CleanUP_UnFinished_activities(Session[Session.SessionID + "keyactiveID"].ToString()); } catch { } } if (!Page.IsPostBack) { // PerkinsTab_DV("-1", "-1"); } Rad_tabNavigation.Align = Telerik.Web.UI.TabStripAlign.Left; // Session[Session.SessionID + "ChildTabIndex"] if (!Page.IsPostBack) CreateRootTab(Convert.ToInt16(Session[Session.SessionID + "ParentTabIndex"].ToString()), Session[Session.SessionID + "ParentTabValue"].ToString()); if (this.ContentPlaceHolder1.Page.ToString() == "ASP.administration_collegeusers_aspx") { this.lblCollege.Visible = false; this.Label2.Visible = false; this.DropDownList1.Visible = false; this.DropDownList2.Visible = false; } else { this.lblCollege.Visible = true; this.Label2.Visible = true; this.DropDownList1.Visible = true; this.DropDownList2.Visible = true; } if (!IsPostBack) { if (Session[Session.SessionID + "roleid"].ToString() != "101") { //RL added for new tab control // Telerik.WebControls.Tab AdminTab = RAD_tabNav_Parent_Strip.Tabs[RAD_tabNav_Parent_Strip.Tabs.IndexOf(RAD_tabNav_Parent_Strip.FindTabByText("Administration"))]; // AdminTab.Enabled = false; // try { Telerik.WebControls.RadPanelItem adminitem = RadPanelbar1.Items[RadPanelbar1.Items.IndexOf(RadPanelbar1.Items.FindItemByText("Administration"))]; adminitem.Enabled = false; adminitem.Expanded = false; } catch { } } if (Session[Session.SessionID + "roleid"].ToString() == "103" || Session[Session.SessionID + "roleid"].ToString() == "102" || Session[Session.SessionID + "roleid"].ToString() == "104") { DropDownList1.Enabled = false; } try { DropDownList1.DataSource = this.SqlDsCollege; DropDownList1.DataTextField = "txt_college_short_name"; DropDownList1.DataValueField = "key_college_id"; DropDownList1.DataBind(); DropDownList2.DataSource = SqlDS_fisYear; DropDownList2.DataTextField = "nbr_fiscal_year"; DropDownList2.DataValueField = "nbr_fiscal_year"; DropDownList2.DataBind(); } catch (Exception ex) { } GK3_Driver mydrive = new GK3_Driver(); DataSet myds = new DataSet(); myds = mydrive.AllUserINFO(HttpContext.Current.User.Identity.Name.ToString()); try { string teststring = myds.Tables[0].Rows[0][0].ToString(); if (Session[Session.SessionID + "USERID"] != null) { Session.Remove(Session.SessionID + "USERID"); } Session.Add(Session.SessionID + "USERID", myds.Tables[0].Rows[0]["key_user_id"].ToString()); ////////////////////// if (Session[Session.SessionID + "email"] != null) { Session.Remove(Session.SessionID + "email"); } Session.Add(Session.SessionID + "email", myds.Tables[0].Rows[0]["txt_email"].ToString()); ////////////////////// if (Session[Session.SessionID + "diplayname"] != null) { Session.Remove(Session.SessionID + "displayname"); } Session.Add(Session.SessionID + "displayname", myds.Tables[0].Rows[0]["txt_display_name"].ToString()); //////////////////////// if (Session[Session.SessionID + "roleid"] != null) { Session.Remove(Session.SessionID + "roleid"); } Session.Add(Session.SessionID + "roleid", myds.Tables[0].Rows[0]["key_role_id"].ToString()); } catch { } } }
protected void sqlds_submitLevelUpdate_Updated(object sender, SqlDataSourceStatusEventArgs e) { /********/ //Evaluates the Return Value of a Level update from sql datasource control "sqlds_submitlevelupdate" if error display error link for popup reporting /********/ string errormessage = e.Command.Parameters[0].Value.ToString(); if (errormessage == "102") HL_Errors.Visible = true; if (errormessage == "0") { String receivers = String.Empty; GK3_Driver gk3 = new GK3_Driver(); SqlDataReader dr = gk3.get_Email_Notice_List(Convert.ToInt32(hf_Accountability_Id.Value)); if (dr.HasRows) while (dr.Read()) { if(receivers.Trim() == "") receivers += dr["txt_email"].ToString(); else receivers += ", " + dr["txt_email"].ToString(); } Utility u_Obj = new Utility(); String body = String.Empty; if (ddl_Acct_Next_Level.SelectedValue.ToString() == "101" && hf_Level_Id.Value.Trim() == "100") { body = "The Perkins Data Management System is now open for submission of the 2012 Annual Performance Report. Log on to https://www.sctechsystem.edu/perkins to complete required narrative and data components. The report is due on November 18, 2012. Detailed reporting instructions are available on the Perkins T-Web site at https://tweb.sctechsystem.edu/groups/perkins/accountability/default.aspx."; u_Obj.sendNoticeEmail("Perkins-Accountability Email Notifications", body, receivers); } if ((ddl_Acct_Next_Level.SelectedValue.ToString() == "102" && hf_Level_Id.Value.Trim() == "101") || (ddl_Acct_Next_Level.SelectedValue.ToString() == "102" && hf_Level_Id.Value.Trim() == "103")) { body = "Attention Needed: The " + ddl_fiscalyear.SelectedValue + " Perkins IV Accountability report for " + ddl_College.SelectedItem.Text.ToString() + " has been submitted for your review/approval. https://www.sctechsystem.edu/perkins"; u_Obj.sendNoticeEmail("Perkins-Accountability Email Notifications", body, receivers); } if (ddl_Acct_Next_Level.SelectedValue.ToString() == "103" && hf_Level_Id.Value.Trim() == "102") { body = "Attention Needed: The System Office has requested revisions to the " + ddl_fiscalyear.SelectedValue.ToString() + " Perkins IV Accountability report for " + ddl_College.SelectedItem.Text.ToString() + ". Please log in to the Perkins DMS to review the System Office notes and resubmit the report once revisions are made. https://www.sctechsystem.edu/perkins."; u_Obj.sendNoticeEmail("Perkins-Accountability Email Notifications", body, receivers); } } }
protected void Button1_Click(object sender, EventArgs e) { GK3_Driver myobj = new GK3_Driver(); myobj.ReinstailizeAD_Table(); SqlDS_ALLADSTAFF.Select(DataSourceSelectArguments.Empty); DD_AllUSERS.DataBind(); }
void Session_Start(object sender, EventArgs e) { GK3_Driver mydrive = new GK3_Driver(); System.Data.DataSet myds = new DataSet(); Session.Timeout = 600; try { if (Session[Session.SessionID + "ChildTabIndex"] != null) { Session.Remove(Session.SessionID + "ChildTabIndex"); } Session.Add(Session.SessionID + "ChildTabIndex", "-1"); if (Session[Session.SessionID + "ChildTabValue"] != null) { Session.Remove(Session.SessionID + "ChildTabValue"); } Session.Add(Session.SessionID + "ChildTabValue", "-1"); if (Session[Session.SessionID + "ChildURLValue"] != null) { Session.Remove(Session.SessionID + "ChildURLValue"); } Session.Add(Session.SessionID + "ChildURLValue", ""); if (Session[Session.SessionID + "ParentTabIndex"] != null) { Session.Remove(Session.SessionID + "ParentTabIndex"); } Session.Add(Session.SessionID + "ParentTabIndex", "-1"); if (Session[Session.SessionID + "ParentTabValue"] != null) { Session.Remove(Session.SessionID + "ParentTabValue"); } Session.Add(Session.SessionID + "ParentTabValue", "-1"); myds = mydrive.AllUserINFO(HttpContext.Current.User.Identity.Name.ToString()); string teststring = myds.Tables[0].Rows[0][0].ToString(); if (Session[Session.SessionID + "USERID"] != null) { Session.Remove(Session.SessionID + "USERID"); } Session.Add(Session.SessionID + "USERID", myds.Tables[0].Rows[0]["key_user_id"].ToString()); ////////////////////// if (Session[Session.SessionID + "email"] != null) { Session.Remove(Session.SessionID + "email"); } Session.Add(Session.SessionID + "email", myds.Tables[0].Rows[0]["txt_email"].ToString()); ////////////////////// if (Session[Session.SessionID + "diplayname"] != null) { Session.Remove(Session.SessionID + "displayname"); } Session.Add(Session.SessionID + "displayname", myds.Tables[0].Rows[0]["txt_display_name"].ToString()); ////////////////////// if (Session[Session.SessionID + "roleid"] != null) { Session.Remove(Session.SessionID + "roleid"); } Session.Add(Session.SessionID + "roleid", myds.Tables[0].Rows[0]["key_role_id"].ToString()); ////////////////////// if (Session[Session.SessionID + "Userscollege"] != null) { Session.Remove(Session.SessionID + "userscollege"); } Session.Add(Session.SessionID + "userscollege", myds.Tables[0].Rows[0]["key_college_id"].ToString()); ////////////////////// if (Session[Session.SessionID + "CollegeDDvalue"] != null) { Session.Remove(Session.SessionID + "CollegeDDvalue"); } Session.Add(Session.SessionID + "CollegeDDvalue", myds.Tables[0].Rows[0]["key_college_id"].ToString()); } catch (Exception ex) { Response.Redirect("~/access_denied.aspx"); // Response.Write(ex.Message.ToString()); } }
public void sendEmail(string st_subject, string st_body, string st_receivers) { try { if (st_receivers.Trim() != "") { GK3_Driver mydrive = new GK3_Driver(); System.Data.DataSet myds = new DataSet(); myds = mydrive.AllUserINFO(HttpContext.Current.User.Identity.Name.ToString()); string erroremailuser = myds.Tables[0].Rows[0]["txt_email"].ToString(); MailMessage mm = new MailMessage("*****@*****.**", st_receivers); if (HttpContext.Current.Server.MachineName.ToLower() == "vdogwood") mm.Subject = "TESTING - " + st_subject; else mm.Subject = st_subject; mm.Bcc.Add("[email protected],[email protected]"); mm.IsBodyHtml = true; mm.Body = st_body; SmtpClient smtp = new SmtpClient(); smtp.UseDefaultCredentials = true; smtp.Send(mm); } } catch { } }