using System; using UG.Profiles; public partial class Draft : System.Web.UI.Page { Profiles objProfiles; int ProfID; int TempProfID; protected void Page_Load(object sender, EventArgs e) { if (Session["MainUserID"] == null) { Response.Redirect("Default.aspx"); } ProfID = int.Parse(Request.QueryString["ProfID"] == null ? "0" : Request.QueryString["ProfID"].ToString()); TempProfID = int.Parse(Request.QueryString["TempProfID"] == null ? "0" : Request.QueryString["TempProfID"].ToString()); if (!Page.IsPostBack) { objProfiles = new Profiles(); objProfiles.DraftID = ProfID; objProfiles.TempDraftID = TempProfID; objProfiles.GetSingleProfile(); lblProfile.Text = objProfiles.DraftName; txtAdditional.Text = objProfiles.CustomizeFeature; } } private void SaveData() { objProfiles = new Profiles(); objProfiles.DraftID = ProfID; objProfiles.TempDraftID = TempProfID; objProfiles.GetSingleProfile(); objProfiles.CustomizeFeature = txtAdditional.Text.Trim(); objProfiles.AddUpdateProfile(); if (txtAdditional.Text.Length != 0) { string toEmail = "support@fantasyfootballdraftcenter.com"; //string toEmail = "ratneshs@ultraglobal.biz"; string emailSubject = "SETUP recommendations from " + Session["MainEmail"].ToString(); string fromEmail = Session["MainEmail"].ToString(); string emailName = Session["MainUserName"].ToString(); UG.Utility.Mail.Send(emailName, fromEmail, toEmail, emailSubject, txtAdditional.Text.Trim(), "", ""); } } private void DeleteTempData() { objProfiles = new Profiles(); objProfiles.TempDraftID = TempProfID; objProfiles.DeleteFromTemp(); } protected void cmdBack_Click(object sender, EventArgs e) { SaveData(); Response.Redirect("Setup5.aspx?ProfID=" + ProfID); } protected void cmdNext_Click(object sender, EventArgs e) { SaveData(); objProfiles = new Profiles(); objProfiles.TempDraftID = TempProfID; objProfiles.CompleteProfile(); if (objProfiles.DraftID != 0) ProfID = objProfiles.DraftID; Response.Redirect("SetupComplete.aspx?ProfID=" + ProfID); } protected void cmdCancel_Click(object sender, EventArgs e) { DeleteTempData(); Response.Redirect("Home.aspx"); } }