Exemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Session["CurrentPage"] = "How it Works Page";
            Session["PageName"] = "";
            Session["CurrentPageConfig"] = null;

            KeyWords.Addkeywordstags(Header);
            GeneralFunc.SetPageDefaults(Page);

            GeneralFunc.SaveSiteVisit();

            ServiceReference objServiceReference = new ServiceReference();

            ScriptReference objScriptReference = new ScriptReference();

            objServiceReference.Path = "~/CarsService.asmx";

            objScriptReference.Path = "~/Static/Js/CarsJScriptNew.js";

            scrptmgr.Services.Add(objServiceReference);
            scrptmgr.Scripts.Add(objScriptReference);

        }
    }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                RubricName.Text = _rubricTitle;

                // Hide the single folder for now.
                FoldersControl.Visible = false;

                //load up hidden input box with encrypted item ID and item type.
                RubricPage_hdnEncryptedData.Value = Request.QueryString["xID"];

                /****************************************************************
                 * Find the RadScriptManager control and insert service into it.
                 * 
                 * The RadScriptManager is in the Site.Master masterpage. 
                 * Because that master page is used by so many pages, we don't 
                 * want to add services to Site.Master's script manager.  The
                 * pages that don't need the service don't need the extra overhead
                 * that the service causes.  So we must find the scriptManager and
                 * add the service to it from here.
                 * **************************************************************/
                var pageScriptMgr = Page.Master.FindControl("RadScriptManager1") as RadScriptManager;
                var newSvcRef = new ServiceReference("~/Services/Service2.Svc");
                pageScriptMgr.Services.Add(newSvcRef);
            }
        }
Exemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Session[Constants.USER_ID] == null)
            {
                Response.Redirect("../Login.aspx");
            }
            else
            {
                //    ;

                //    Session[Constants.USER_NAME] ;

                //    Session[Constants.NAME];

                ServiceReference objServiceReference = new ServiceReference();

                ScriptReference objScriptReference = new ScriptReference();

                objServiceReference.Path = "~/CarsService.asmx";

                objScriptReference.Path = "~/Static/Js/CarsJScriptNew.js";

                scrptmgr.Services.Add(objServiceReference);
                scrptmgr.Scripts.Add(objScriptReference);

            }

        }
    }
Exemplo n.º 4
0
        public static void EnsureLegacyCalls(System.Web.UI.Page page) {
            ScriptManager sm = ScriptManager.GetCurrent(page);
            ServiceReference legacyPath = new ServiceReference(SystemDirectories.Webservices + "/legacyAjaxCalls.asmx");

            if (!sm.Services.Contains(legacyPath))
                sm.Services.Add(legacyPath);
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Session["PageName"] = "Unsubscribe";

            ServiceReference objServiceReference = new ServiceReference();

            ScriptReference objScriptReference = new ScriptReference();

            objServiceReference.Path = "~/CarsService.asmx";

            objScriptReference.Path = "~/Static/Js/CarsJScriptNew.js";

            scrptmgr.Services.Add(objServiceReference);
            scrptmgr.Scripts.Add(objScriptReference);

            if (Request.QueryString.Keys.Count > 0)
            {
                string URL = string.Empty;
                string URL1 = string.Empty;
                if (Request.QueryString.Keys.Count > 0)
                {
                    if (URL != null)
                    {
                        PreferencesBL objPreferencesBL = new PreferencesBL();

                        DataSet dsPreferences = new DataSet();

                        dsPreferences = objPreferencesBL.GetEmailPreferences(Request.QueryString["PreferID"].ToString());

                        if (dsPreferences.Tables[0].Rows.Count > 0)
                        {
                            if (dsPreferences.Tables[0].Rows[0]["IsActive"].ToString() == "True")
                            {
                                objPreferencesBL.SubScribeStatus(Request.QueryString["PreferID"].ToString(), 0);

                                lblalert.Text = "Email Alerts has Unsubscribed Successfully...";
                            }
                            else
                            {
                                lblalert.Text = "Email Alerts has Already Unsubscribed ";

                                //mpealteruser.Show();
                            }
                        }

                        Type cstype = GetType();
                        ClientScriptManager cs = Page.ClientScript;
                        cs.RegisterStartupScript(cstype, "KyRST", "<script type='text/javascript' language='javascript'>pageLoad();</script>");

                    }
                }

            }

        }
    }
 protected override void OnInit(EventArgs e)
 {
     base.OnInit(e);
     ScriptManager currentScriptManager = ScriptManager.GetCurrent(this.Page);
     ServiceReference sReference = new ServiceReference();
     sReference.Path = "~/Services/PrayerTimes/PrayerTimesWebService.asmx";
     sReference.InlineScript = true;
     currentScriptManager.Services.Add(sReference);
 }
 public void AddScriptService(string scriptManagerId, string servicePath)
 {
     var sm = Page.Master.FindControl(scriptManagerId) as RadScriptManager;
     if (sm != null)
     {
         var sr = new ServiceReference();
         sr.Path = servicePath;
         sm.Services.Add(sr);
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!IsPostBack)
            {
                LoadStudent();
                LoadDemographics();
                PopulateTable();
            }

            var pageScriptMgr = Page.Master.FindControl("RadScriptManager2") as RadScriptManager;
            var newSvcRef = new ServiceReference("~/Services/Service2.Svc");
            pageScriptMgr.Services.Add(newSvcRef);
        }
Exemplo n.º 9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.Redirect("Login.aspx");
        ServiceReference objServiceReference = new ServiceReference();

        ScriptReference objScriptReference = new ScriptReference();

        objServiceReference.Path = "~/WebService.asmx";

        objScriptReference.Path = "~/Static/Js/CarsJScript.js";

        //scrptmgr.Services.Add(objServiceReference);
        //scrptmgr.Scripts.Add(objScriptReference);
    }
        protected void Page_Load(object sender, EventArgs e)
        {
            var service = new ServiceReference("Services/OnlineCheck.asmx");
            ScriptManager.Services.Add(service); 
            Page.ClientScript.RegisterClientScriptInclude("VideoBroadcast", "scripts/VideoBroadcast.js");

            // Add script reference for user preview popup
            Page.ClientScript.RegisterClientScriptBlock(GetType(), "body",
                String.Format("var bodyId = '{0}';", ctl00_body.ClientID), true);
            Page.ClientScript.RegisterClientScriptInclude("UserPreview", "scripts/UserPreview.js");
            Page.ClientScript.RegisterStartupScript(GetType(), "InitializeMouseTracking",
                "InitializeMouseTracking();", true);

            LoadStrings();
            InitializeGuid();
        }
Exemplo n.º 11
0
 protected void Page_Load(object sender, EventArgs e)
 {
     ServiceReference service = new ServiceReference("~/DesktopModules/ATI_Base/resources/services/UtilService.asmx");
     service.InlineScript = true;
     ScriptManager.GetCurrent(Page).Services.Add(service);
     // script service requires the user id and portal id
     ddlUnitsType.Attributes["onchange"] = "Aqufit.Units.SaveUnitChangeSetting('" + ddlUnitsType.ClientID + "','" + this.UnitType + "'); " + this.ClientOnChange + "('" + ddlUnitsType.ClientID + "','" + this.UnitType + "');";
     if (!Page.IsPostBack)
     {
         foreach (Affine.Utils.UnitsUtil.MeasureUnit u in this.UnitList)
         {
             SetupUnit(u);
         }
         SetupSelectedUnit();
     }
 }
Exemplo n.º 12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            GeneralFunc.SaveSiteVisit();
            GeneralFunc.SetPageDefaults(Page);
            //if (Session[Constants.NAME] == null)
            //{
            //    lnkLogin.Visible = true;
            //    lnkBtnLogout.Visible = false;
            //    lblUserName.Visible = false;
            //    lblWelcome.Visible = false;
            //}
            //else
            //{
            //    lnkLogin.Visible = false;
            //    lnkBtnLogout.Visible = true;
            //    lblUserName.Visible = true;
            //    lblWelcome.Visible = true;
            //    lblUserName.Text = Session[Constants.NAME].ToString();
            //}
            Session["CurrentPage"] = "Home";

            KeyWords.Addkeywordstags(Header);

            Session["PageName"] = "Home";

            Session["CurrentPageConfig"] = null;

            ServiceReference objServiceReference = new ServiceReference();

            ScriptReference objScriptReference = new ScriptReference();

            objServiceReference.Path = "~/CarsService.asmx";

            objScriptReference.Path = "~/Static/Js/CarsJScriptNew.js";

            scrptmgr.Services.Add(objServiceReference);
            scrptmgr.Scripts.Add(objScriptReference);

        }
    }
Exemplo n.º 13
0
    /// <summary>
    /// Page_Load
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Load(object sender, EventArgs e)
    {
        ScriptManager scriptMan = ScriptManager.GetCurrent(Page);
        if (scriptMan != null)
        {
            ServiceReference service = new ServiceReference("~/Extensions/WebServices/MetadataSelector.asmx");
            service.InlineScript = true;
            if (scriptMan.Services.IndexOf(service) == -1)
                scriptMan.Services.Add(service);
        }

        m_currentModule = ModuleCMS.Instance;
        if (m_parentPage.WorkingCopy != null)
        {
            m_workingCopy = m_parentPage.WorkingCopy;
            c_metadataSelector.PageID = m_workingCopy.Page.ID;
        }

        ShowConnectedMetadata();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Session["CurrentPage"] = "Home";

            Session["CurrentPageConfig"] = null;

            ServiceReference objServiceReference = new ServiceReference();

            ScriptReference objScriptReference = new ScriptReference();

            objServiceReference.Path = "~/CarsService.asmx";

            objScriptReference.Path = "~/Static/Js/CarsJScript.js";

            scrptmgr.Services.Add(objServiceReference);
            scrptmgr.Scripts.Add(objScriptReference);

        }
    }
Exemplo n.º 15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session[Constants.NAME] == null)
        {
            Response.Redirect("Default.aspx");
        }
        else
        {
            if (!IsPostBack)
            {
                Session["CurrentPage"] = "Home";

                Session["CurrentPageConfig"] = null;
                Session["PageName"] = "";

                ServiceReference objServiceReference = new ServiceReference();

                ScriptReference objScriptReference = new ScriptReference();

                objServiceReference.Path = "~/CarsService.asmx";

                objScriptReference.Path = "~/Static/Js/CarsJScriptNew.js";

                scrptmgr.Services.Add(objServiceReference);
                scrptmgr.Scripts.Add(objScriptReference);

                //lblUserName.Text = Session[Constants.NAME].ToString();

                int UID = Convert.ToInt32(Session[Constants.USER_ID].ToString());
                dsDropDown = objdropdownBL.Usp_Get_DropDown();
                DataSet dsGetIDs = objdropdownBL.USP_GetIdsByUID(UID);
                FillStates();
                if (dsGetIDs.Tables.Count > 0)
                {
                    if (dsGetIDs.Tables[0].Rows.Count > 0)
                    {
                        Session["PostingID"] = dsGetIDs.Tables[0].Rows[0]["postingID"].ToString();
                        Session["CarID"] = dsGetIDs.Tables[0].Rows[0]["CarID"].ToString();
                        Session[Constants.SellerID] = dsGetIDs.Tables[0].Rows[0]["SellerID"].ToString();
                        Session["PaymentID"] = dsGetIDs.Tables[0].Rows[0]["paymentID"].ToString();
                        Session["isActive"] = dsGetIDs.Tables[0].Rows[0]["isActive"].ToString();
                        Session["UserPackID"] = dsGetIDs.Tables[1].Rows[0]["UserPackID"].ToString();
                    }
                }
                if ((Session["CarID"] == null) || (Session["CarID"].ToString() == ""))
                {
                    btnAdd.Visible = true;
                    btnDelete.Visible = false;
                    btnEdit.Visible = false;
                    // btnDeactive.Visible = false;
                    btnEditDetails.Visible = true;
                    btnUpdateDetails.Visible = false;
                    //pnl2Error.Style["display"] = "block";
                    divSrchResBox.Style["display"] = "none";
                    grdMultiSites.Visible = false;
                    lblExistUrlRes.Visible = true;
                    lblExistUrlRes.Text = "Not uploaded";
                }
                else
                {
                    if (Session["isActive"].ToString() == "True")
                    {
                        btnSold.Visible = true;
                        btnWithdraw.Visible = true;
                        btnActive.Visible = false;
                    }
                    else
                    {
                        btnSold.Visible = false;
                        btnWithdraw.Visible = false;
                        btnActive.Visible = true;
                    }
                    DataSet dsCarDetailsInfo = new DataSet();
                    dsCarDetailsInfo = objdropdownBL.USP_GetCarDetailsByIds(Convert.ToInt32(Session["CarID"].ToString()), Convert.ToInt32(Session[Constants.SellerID].ToString()));
                    Session["getcardata"] = dsCarDetailsInfo;
                    btnAdd.Visible = false;
                    btnDelete.Visible = false;
                    btnEdit.Visible = true;
                    Session["SelYear"] = dsCarDetailsInfo.Tables[0].Rows[0]["yearOfMake"].ToString();
                    Session["SelMake"] = dsCarDetailsInfo.Tables[0].Rows[0]["make"].ToString();
                    Session["SelModel"] = dsCarDetailsInfo.Tables[0].Rows[0]["model"].ToString();
                    DataSet dsImages = objdropdownBL.USP_GetImages(Convert.ToInt32(Session["CarID"].ToString()), Convert.ToInt32(Session["PackageID"].ToString()));
                    Session["GetImages"] = dsImages;
                    string SelModelName = Session["SelModel"].ToString();
                    SelModelName = SelModelName.Replace("/", "@");
                    SelModelName = SelModelName.Replace("&", "@");
                    if (dsImages.Tables[0].Rows[0]["Pic0"].ToString() != "0" && dsImages.Tables[0].Rows[0]["Pic0"].ToString() != "")
                    {
                        divAdStock.Style["display"] = "none";
                        ImageName.ImageUrl = "~/CarImages/" + Session["SelYear"].ToString() + "/" + Session["SelMake"].ToString() + "/" + SelModelName + "/" + dsImages.Tables[0].Rows[0]["Pic0Name"].ToString();
                    }
                    else
                    {
                        ImageName.ImageUrl = "~/images/stockMakes/" + Session["SelMake"].ToString() + ".jpg";
                        divAdStock.Style["display"] = "block";
                    }
                    if (dsCarDetailsInfo.Tables[0].Rows[0]["Title"].ToString() == "")
                    {
                        lblTitle.Visible = false;
                    }
                    else
                    {
                        lblTitle.Visible = true;
                        lblTitle.Text = dsCarDetailsInfo.Tables[0].Rows[0]["Title"].ToString();
                    }
                    lblCarName.Text = dsCarDetailsInfo.Tables[0].Rows[0]["yearOfMake"].ToString() + " " + dsCarDetailsInfo.Tables[0].Rows[0]["make"].ToString() + " " + dsCarDetailsInfo.Tables[0].Rows[0]["model"].ToString();
                    //string descripText = dsCarDetailsInfo.Tables[0].Rows[0]["description"].ToString();
                    //if (descripText.Length > 75)
                    //{
                    //    lblDescrip.Text = descripText.Trim().Substring(0, 75) + "...";
                    //}
                    //else
                    //{
                    //    lblDescrip.Text = descripText;
                    //}
                    if (dsCarDetailsInfo.Tables[0].Rows[0]["mileage"].ToString() != "0.00")
                    {
                        lbladmilleage.Visible = true;
                        lblMi.Visible = true;
                        lbladmilleage.Text = dsCarDetailsInfo.Tables[0].Rows[0]["mileage"].ToString();
                    }
                    else
                    {
                        lbladmilleage.Visible = true;
                        lblMi.Visible = false;
                        lbladmilleage.Text = "Unspecified";
                    }
                    if (dsCarDetailsInfo.Tables[0].Rows[0]["price"].ToString() != "0.0000")
                    {
                        lbladPrice.Visible = true;
                        lbladPrice.Text = dsCarDetailsInfo.Tables[0].Rows[0]["price"].ToString();
                    }
                    else
                    {
                        lbladPrice.Visible = true;
                        lbladPrice.Text = "Unspecified";
                    }
                    if (dsCarDetailsInfo.Tables[0].Rows[0]["bodyType"].ToString() != "Unspecified")
                    {
                        lblAdBody.Visible = true;
                        lblAdBody.Text = dsCarDetailsInfo.Tables[0].Rows[0]["bodyType"].ToString();
                    }
                    else
                    {
                        lblAdBody.Visible = true;
                        lblAdBody.Text = "Unspecified";
                    }
                    if (dsCarDetailsInfo.Tables[0].Rows[0]["fuelType"].ToString() != "Unspecified")
                    {
                        lblAdFuel.Visible = true;
                        lblAdFuel.Text = dsCarDetailsInfo.Tables[0].Rows[0]["fuelType"].ToString();
                    }
                    else
                    {
                        lblAdFuel.Visible = true;
                        lblAdFuel.Text = "Unspecified";
                    }

                    ArrayList strDescrip = new ArrayList();
                    string ExtClr = string.Empty;
                    string NoOfDoors = string.Empty;
                    string NoOfCyln = string.Empty;
                    string Trans = string.Empty;
                    strDescrip.Add(dsCarDetailsInfo.Tables[0].Rows[0]["exteriorColor"].ToString());
                    strDescrip.Add(dsCarDetailsInfo.Tables[0].Rows[0]["numberOfDoors"].ToString());
                    strDescrip.Add(dsCarDetailsInfo.Tables[0].Rows[0]["numberOfCylinder"].ToString());
                    strDescrip.Add(dsCarDetailsInfo.Tables[0].Rows[0]["Transmission"].ToString());

                    if (strDescrip[0].ToString() != "Unspecified" && (strDescrip[1].ToString() != "Unspecified" || strDescrip[2].ToString() != "Unspecified" || strDescrip[3].ToString() != "Unspecified"))
                    {
                        ExtClr = strDescrip[0].ToString() + ", ";
                    }
                    else if (strDescrip[0].ToString() != "Unspecified")
                    {
                        ExtClr = strDescrip[0].ToString();
                    }
                    if (strDescrip[1].ToString() != "Unspecified" && (strDescrip[2].ToString() != "Unspecified" || strDescrip[3].ToString() != "Unspecified"))
                    {
                        NoOfDoors = strDescrip[1].ToString() + ", ";
                    }
                    else if (strDescrip[1].ToString() != "Unspecified")
                    {
                        NoOfDoors = strDescrip[1].ToString();
                    }
                    if (strDescrip[2].ToString() != "Unspecified" && strDescrip[3].ToString() != "Unspecified")
                    {
                        NoOfCyln = strDescrip[2].ToString() + ", ";
                    }
                    else if (strDescrip[2].ToString() != "Unspecified")
                    {
                        NoOfCyln = strDescrip[2].ToString();
                    }
                    if (strDescrip[3].ToString() != "Unspecified")
                    {
                        Trans = strDescrip[3].ToString();
                    }
                    lblDescrip.Text = ExtClr + NoOfDoors + NoOfCyln + Trans;

                    divSrchResBox.Style["display"] = "block";
                    int PicCount = 0;
                    for (int i = 1; i < 21; i++)
                    {
                        string ColumnPic = "pic" + i.ToString();
                        if (dsCarDetailsInfo.Tables[0].Rows[0][ColumnPic].ToString() != "0" && dsCarDetailsInfo.Tables[0].Rows[0][ColumnPic].ToString() != "")
                        {
                            PicCount = PicCount + 1;
                        }
                    }
                    lblPhotoUploaded.Text = PicCount.ToString();
                    if (dsCarDetailsInfo.Tables[3].Rows.Count > 0)
                    {
                        lblExistUrlRes.Visible = false;
                        divlblMultiSite.Style["display"] = "none";
                        grdMultiSites.Visible = true;
                        grdMultiSites.DataSource = dsCarDetailsInfo.Tables[3];
                        grdMultiSites.DataBind();

                    }
                    else
                    {
                        grdMultiSites.Visible = false;
                        lblExistUrlRes.Visible = true;
                        lblExistUrlRes.Text = "Not uploaded..!";
                        divlblMultiSite.Style["display"] = "block";
                    }

                }

                DataSet dsUserInfoDetails = objdropdownBL.USP_GetUSerDetailsByUserID(Convert.ToInt32(Session[Constants.USER_ID].ToString()));
                Session["getRegUserdata"] = dsUserInfoDetails;
                tbl1LblsDisplay.Style["display"] = "block";
                tbl2textDisplay.Style["display"] = "none";
                lblRegEmail.Text = Session[Constants.USER_NAME].ToString();
                lblRegEmail2.Text = Session[Constants.USER_NAME].ToString();
                lblUnamePW.Text = Session[Constants.USER_NAME].ToString();
                lblRegPhone.Text = objGeneralFunc.filPhnm(dsUserInfoDetails.Tables[0].Rows[0]["PhoneNumber"].ToString());
                lblRegName.Text = dsUserInfoDetails.Tables[0].Rows[0]["Name"].ToString();
                lblBusinessName.Text = dsUserInfoDetails.Tables[0].Rows[0]["BusinessName"].ToString();
                lblAltEmail.Text = dsUserInfoDetails.Tables[0].Rows[0]["AltEmail"].ToString();
                lblAltPhone.Text = objGeneralFunc.filPhnm(dsUserInfoDetails.Tables[0].Rows[0]["AltPhone"].ToString());

                ArrayList strAddress = new ArrayList();
                strAddress.Add(dsUserInfoDetails.Tables[0].Rows[0]["Address"].ToString().Trim());
                strAddress.Add(dsUserInfoDetails.Tables[0].Rows[0]["City"].ToString().Trim());
                strAddress.Add(dsUserInfoDetails.Tables[0].Rows[0]["State_Code"].ToString());
                strAddress.Add(dsUserInfoDetails.Tables[0].Rows[0]["Zip"].ToString());

                if (strAddress[0].ToString() != "" && (strAddress[1].ToString() != "" || strAddress[2].ToString() != "UN" || strAddress[3].ToString() != ""))
                {
                    lblRegAddress.Text = GeneralFunc.ToProper(strAddress[0].ToString()).Trim() + ", ";
                }
                else
                {
                    lblRegAddress.Text = GeneralFunc.ToProper(strAddress[0].ToString()).Trim();
                }

                if (strAddress[1].ToString() != "" && (strAddress[2].ToString() != "UN" || strAddress[3].ToString() != ""))
                {
                    lblRegCity.Text = GeneralFunc.ToProper(strAddress[1].ToString()).Trim() + ", ";
                }
                else
                {
                    lblRegCity.Text = GeneralFunc.ToProper(strAddress[1].ToString()).Trim();
                }

                if ((strAddress[2].ToString() != "UN") && (strAddress[3].ToString() != ""))
                {
                    lblRegState.Text = strAddress[2].ToString() + " ";
                }
                else if ((strAddress[2].ToString() != "UN") && (strAddress[3].ToString() == ""))
                {
                    lblRegState.Text = strAddress[2].ToString();
                }
                lblRegZip.Text = strAddress[3].ToString();
                btnEditDetails.Visible = true;
                btnUpdateDetails.Visible = false;

                DataSet dsPackDetails = objdropdownBL.USP_GetPackageDetails(Convert.ToInt32(Session["PackageID"]), UID);
                if (dsPackDetails.Tables[0].Rows.Count > 0)
                {
                    lblPackDescrip.Text = dsPackDetails.Tables[0].Rows[0]["Description"].ToString();
                    lblMaxPhotos.Text = dsPackDetails.Tables[0].Rows[0]["Maxphotos"].ToString();
                    Session["MaxPhotos"] = dsPackDetails.Tables[0].Rows[0]["Maxphotos"];
                    if ((dsPackDetails.Tables[0].Rows[0]["dateOfPosting"].ToString() != "") && (dsPackDetails.Tables[0].Rows[0]["PaymentDate"].ToString() != ""))
                    {
                        DateTime PostDate = Convert.ToDateTime(dsPackDetails.Tables[0].Rows[0]["dateOfPosting"].ToString());
                        DateTime PaymentDate = Convert.ToDateTime(dsPackDetails.Tables[0].Rows[0]["PaymentDate"].ToString());
                        if (PostDate > PaymentDate)
                        {
                            lblAdActiveFrom.Text = PostDate.ToString("MM/dd/yyyy");
                        }
                        else if (PostDate <= PaymentDate)
                        {
                            lblAdActiveFrom.Text = PaymentDate.ToString("MM/dd/yyyy");
                        }
                    }
                    //  lblAdActiveFrom.Text = dsPackDetails.Tables[0].Rows[0]["dateOfPosting"].ToString();
                    if (lblAdActiveFrom.Text != "")
                    {
                        TimeSpan timespan = System.DateTime.Now.Subtract(Convert.ToDateTime(lblAdActiveFrom.Text));
                        int daysComplete = Convert.ToInt32(timespan.Days);
                        int RemainDays = Convert.ToInt32(dsPackDetails.Tables[0].Rows[0]["ValidityPeriod"].ToString()) - daysComplete;
                        lblRemainingPeriod.Text = System.DateTime.Now.AddDays(RemainDays).ToString("MM/dd/yyyy");
                    }
                    if (lblPhotoUploaded.Text == "")
                    {
                        lblPhotoUploaded.Text = "0";
                    }

                }
            }
        }
    }
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Page_Load runs when the control is loaded
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        /// </history>
        /// -----------------------------------------------------------------------------
        protected void Page_Load(System.Object sender, System.EventArgs e)
        {
            base.Page_Load(sender, e);

            try
            {
                ServiceReference service = new ServiceReference("~/DesktopModules/ATI_Base/resources/services/StreamService.asmx");
                service.InlineScript = true;
                ScriptManager.GetCurrent(Page).Services.Add(service);

                if (!Page.IsPostBack && !Page.IsCallback)
                {
                    aqufitEntities entities = new aqufitEntities();
                    if (Request["a"] != null)
                    {
                        long aId = Convert.ToInt64(Request["a"]);
                        CompetitionAffiliate affiliate = entities.CompetitionAffiliates.FirstOrDefault(a => a.Id == aId);
                        atiRadComboSearchAffiliates.Items.Add(new RadComboBoxItem() { Selected = true, Text = affiliate.Name, Value = "" + affiliate.Id });
                        // set the sex to all
                        rblSex.Items.FindByValue("A").Selected = true;
                    }

                    baseUrl = ResolveUrl("~/");

                    Competition comp = null;
                    long compKey = 0;
                    if (Request["c"] != null)
                    {
                        compKey = Convert.ToInt64(Request["c"]);
                        comp = entities.Competitions.FirstOrDefault(c => c.Id == compKey);
                    }
                    if (compKey <= 0)
                    {
                        comp = entities.Competitions.FirstOrDefault();
                    }
                    workoutTabTitle.Text = "Competition: "+comp.Name;
                    atiWorkoutPanel.Visible = true;

                    var regionList = entities.CompetitionRegions.Select(r => new {Text = r.Name, Id = r.Id }).ToList();
                    ddlRegion.DataTextField = "Text";
                    ddlRegion.DataValueField = "Id";
                   // ddlRegion.DataSource = regionList;
                 //   ddlRegion.DataBind();
                    ddlRegion.Items.Add(new ListItem() { Text = "All Regions", Value = "0", Selected = true });
                    foreach (var item in regionList)
                    {
                        ddlRegion.Items.Add(new ListItem() { Text = item.Text, Value = "" + item.Id });
                    }
                    //RadGrid1.MasterTable

                    //var regionList = entities.Com.Select(r => new {Text = r.Name, Id = r.Id }).ToList();
                    //ddlAffiliate
                    if (RadGrid1.MasterTableView.SortExpressions.Count == 0)
                    {
                        GridSortExpression expression = new GridSortExpression();
                        expression.FieldName = "OverallRank";
                        expression.SortOrder = GridSortOrder.Ascending;
                        RadGrid1.MasterTableView.SortExpressions.AddSortExpression(expression);
                    }
                    User angie = entities.UserSettings.OfType<User>().Include("CompetitionAthletes").FirstOrDefault(u => u.Id == 515);
                    atiFeaturedProfile.Settings = angie;
                    litRank.Text = "<span class=\"grad-FFF-EEE\" style=\"float: right; display: inline-block; border: 1px solid #ccc; text-align: center; padding: 7px;\">World Rank<br /><em style=\"font-size: 18px;\">" + angie.CompetitionAthletes.First().OverallRank + "</em></span>";

                    //grad-FFF-EEE
                }
            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
Exemplo n.º 17
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Page_Load runs when the control is loaded
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        /// </history>
        /// -----------------------------------------------------------------------------
        protected void Page_Load(System.Object sender, System.EventArgs e)
        {
            base.Page_Load(sender, e);
            try
            {
                RadAjaxManager1.AjaxSettings.AddAjaxSetting(panelAjax, panelAjax, RadAjaxLoadingPanel2);
                atiProfileImage.Settings = base.UserSettings;

                imgCheck.Src = ResolveUrl("~/DesktopModules/ATI_Base/resources/images/iCheck.png");
                ServiceReference service = new ServiceReference("~/DesktopModules/ATI_Base/resources/services/StreamService.asmx");
                service.InlineScript = true;
                ScriptManager.GetCurrent(Page).Services.Add(service);

                atiGMap.Lat = UserSettings.LatHome;
                atiGMap.Lng = UserSettings.LngHome;
                atiGMap.Zoom = 10;
                if (!Page.IsPostBack && !Page.IsCallback)
                {
                    aqufitEntities entities = new aqufitEntities();
                    // get all the users group ids
                    long[] groupIdArray = entities.UserFriends.Where(g => (g.DestUserSettingKey == UserSettings.Id || g.SrcUserSettingKey == UserSettings.Id) && g.Relationship >= (int)Affine.Utils.ConstsUtil.Relationships.GROUP_OWNER).Select(g => (g.DestUserSettingKey == UserSettings.Id ? g.SrcUserSettingKey : g.DestUserSettingKey)).ToArray();
                    string groupKeyString = new string(groupIdArray.SelectMany(s => Convert.ToString( s ) + ",").ToArray());
                    if (!string.IsNullOrWhiteSpace(groupKeyString))
                    {
                        groupKeyString = groupKeyString.Substring(0, groupKeyString.Length - 1);
                        RadAjaxManager1.ResponseScripts.Add(" $(function(){ Aqufit.Page.Groups = new Array(" + groupKeyString + "); }); ");
                    }
                    if ( UserSettings.MainGroupKey.HasValue && UserSettings.MainGroupKey.Value > 1)
                    {
                        RadAjaxManager1.ResponseScripts.Add("$('#panelFindAffiliate').hide();");
                        Group homeGroup = entities.UserSettings.OfType<Group>().FirstOrDefault(g => g.Id == UserSettings.MainGroupKey.Value);
                        litAffiliateName.Text = homeGroup.UserFirstName;
                        RadAjaxManager1.ResponseScripts.Add(" $(function(){ Aqufit.Page.Actions.selectedPlace = {'Address': '', 'GroupKey':" + homeGroup.Id + ", 'Lat':" + homeGroup.DefaultMapLat + ", 'Lng':" + homeGroup.DefaultMapLng + " , 'Name':'" + homeGroup.UserFirstName + "', 'UserName':'******'", "") + "', 'UserKey':" + homeGroup.UserKey + ", 'ImageId':0, 'Description':''}; }); ");
                        bNotMyAffiliate.Visible = true;
                    }
                    // fill in know form fields
                    atiSlimControl.IsEditMode = true;
                    atiSlimControl.FullName = UserSettings.UserFirstName + " " + UserSettings.UserLastName;
                    atiSlimControl.Email = UserSettings.UserEmail;
                    txtTeamEmail.Text = UserSettings.UserEmail;
                    atiSlimControl.ShowPostal = false;
                    atiBodyComp.IsEditMode = true;
                    atiBodyComp.Gender = UserSettings.Sex;
                    txtTeamCaptinName.Text = atiSlimControl.FullName;
                    txtTeamCaptinEmail.Text = atiSlimControl.Email;
                    if (UserSettings.BirthDate.HasValue)
                    {
                        atiBodyComp.BirthDate = UserSettings.BirthDate.Value;
                    }
                    // setup known times for Standard WODS
                    Workout fran = entities.UserStreamSet.OfType<Workout>().FirstOrDefault(w => w.UserSetting.Id == UserSettings.Id && w.WOD.Id == Affine.Utils.ConstsUtil.FRAN_ID && w.IsBest == true && w.Duration.HasValue);
                    if (fran != null)
                    {
                        atiTimeSpanFran.Time = fran.Duration.Value;
                        hiddenFranId.Value = "" + fran.Id;
                    }
                    Workout helen = entities.UserStreamSet.OfType<Workout>().FirstOrDefault(w => w.UserSetting.Id == UserSettings.Id && w.WOD.Id == Affine.Utils.ConstsUtil.HELEN_ID && w.IsBest == true && w.Duration.HasValue);
                    if (helen != null)
                    {
                        atiTimeSpanHelen.Time = helen.Duration.Value;
                        hiddenHelenKey.Value = "" + helen.Id;
                    }
                    Workout grace = entities.UserStreamSet.OfType<Workout>().FirstOrDefault(w => w.UserSetting.Id == UserSettings.Id && w.WOD.Id == Affine.Utils.ConstsUtil.GRACE_ID && w.IsBest == true && w.Duration.HasValue);
                    if (grace != null)
                    {
                        atiTimeSpanGrace.Time = grace.Duration.Value;
                        hiddenGraceKey.Value = "" + grace.Id;
                    }
                    Workout ff = entities.UserStreamSet.OfType<Workout>().FirstOrDefault(w => w.UserSetting.Id == UserSettings.Id && w.WOD.Id == Affine.Utils.ConstsUtil.FILTHY50_ID && w.IsBest == true && w.Duration.HasValue);
                    if (ff != null)
                    {
                        atiTimeSpanFilthyFifty.Time = ff.Duration.Value;
                        hiddenFilthyFiftyKey.Value = "" + ff.Id;
                    }
                    Workout fgb = entities.UserStreamSet.OfType<Workout>().FirstOrDefault(w => w.UserSetting.Id == UserSettings.Id && w.WOD.Id == Affine.Utils.ConstsUtil.FGB_ID && w.IsBest == true && w.Score.HasValue);
                    if (fgb != null)
                    {
                        txtFGB.Text = "" + fgb.Score.Value;
                        hiddenFGBKey.Value = "" + fgb.Id;
                    }

                    Workout maxPullups = entities.UserStreamSet.OfType<Workout>().FirstOrDefault(w => w.UserSetting.Id == UserSettings.Id && w.WOD.Id == Affine.Utils.ConstsUtil.MAX_PULLUPS_ID && w.IsBest == true && w.Score.HasValue);
                    if (maxPullups != null)
                    {
                        txtMaxPullups.Text = "" + maxPullups.Score.Value;
                        hiddenMaxPullupKey.Value = "" + maxPullups.Id;
                    }

                    atiMaxBSUnits.UnitList.Add(Affine.Utils.UnitsUtil.MeasureUnit.UNIT_LBS);
                    atiMaxBSUnits.UnitList.Add(Affine.Utils.UnitsUtil.MeasureUnit.UNIT_KG);
                    atiMaxBSUnits.Selected = Affine.Utils.UnitsUtil.MeasureUnit.UNIT_LBS;
                    Workout maxBS = entities.UserStreamSet.OfType<Workout>().FirstOrDefault(w => w.UserSetting.Id == UserSettings.Id && w.WOD.Id == Affine.Utils.ConstsUtil.MAX_BACK_SQUAT_ID && w.IsBest == true && w.Max.HasValue);
                    if (maxBS != null)
                    {
                        txtMaxBS.Text = "" + Affine.Utils.UnitsUtil.systemDefaultToUnits( maxBS.Max.Value, UnitsUtil.MeasureUnit.UNIT_LBS );
                        hiddenMaxBackSquatKey.Value = "" + maxBS.Id;
                    }

                    atiMaxCleanUnits.UnitList.Add(Affine.Utils.UnitsUtil.MeasureUnit.UNIT_LBS);
                    atiMaxCleanUnits.UnitList.Add(Affine.Utils.UnitsUtil.MeasureUnit.UNIT_KG);
                    atiMaxCleanUnits.Selected = Affine.Utils.UnitsUtil.MeasureUnit.UNIT_LBS;
                    Workout maxClean = entities.UserStreamSet.OfType<Workout>().FirstOrDefault(w => w.UserSetting.Id == UserSettings.Id && w.WOD.Id == Affine.Utils.ConstsUtil.MAX_CLEAN_ID && w.IsBest == true && w.Max.HasValue);
                    if (maxClean != null)
                    {
                        txtMaxClean.Text = "" + Affine.Utils.UnitsUtil.systemDefaultToUnits(maxClean.Max.Value, UnitsUtil.MeasureUnit.UNIT_LBS);
                        hiddenMaxCleanKey.Value = "" + maxClean.Id;
                    }

                    atiMaxDeadliftUnits.UnitList.Add(Affine.Utils.UnitsUtil.MeasureUnit.UNIT_LBS);
                    atiMaxDeadliftUnits.UnitList.Add(Affine.Utils.UnitsUtil.MeasureUnit.UNIT_KG);
                    atiMaxDeadliftUnits.Selected = Affine.Utils.UnitsUtil.MeasureUnit.UNIT_LBS;
                    Workout maxDead = entities.UserStreamSet.OfType<Workout>().FirstOrDefault(w => w.UserSetting.Id == UserSettings.Id && w.WOD.Id == Affine.Utils.ConstsUtil.MAX_DEADLIFT_ID && w.IsBest == true && w.Max.HasValue);
                    if (maxDead != null)
                    {
                        txtMaxDeadlift.Text = "" + Affine.Utils.UnitsUtil.systemDefaultToUnits(maxDead.Max.Value, UnitsUtil.MeasureUnit.UNIT_LBS);
                        hiddenMaxDeadliftKey.Value = "" + maxDead.Id;
                    }

                    atiMaxSnatchUnits.UnitList.Add(Affine.Utils.UnitsUtil.MeasureUnit.UNIT_LBS);
                    atiMaxSnatchUnits.UnitList.Add(Affine.Utils.UnitsUtil.MeasureUnit.UNIT_KG);
                    atiMaxSnatchUnits.Selected = Affine.Utils.UnitsUtil.MeasureUnit.UNIT_LBS;
                    Workout maxSnatch = entities.UserStreamSet.OfType<Workout>().FirstOrDefault(w => w.UserSetting.Id == UserSettings.Id && w.WOD.Id == Affine.Utils.ConstsUtil.MAX_SNATCH_ID && w.IsBest == true && w.Max.HasValue);
                    if (maxSnatch != null)
                    {
                        txtMaxSnatch.Text = "" + Affine.Utils.UnitsUtil.systemDefaultToUnits(maxSnatch.Max.Value, UnitsUtil.MeasureUnit.UNIT_LBS);
                        hiddenMaxSnatchKey.Value = "" + maxSnatch.Id;
                    }

                    if (Request["step"] != null)
                    {
                        atiSidePanel.Visible = false;
                        atiMainPanel.Style["width"] = "100%";
                        atiGMap.Width = Unit.Pixel(605);
                        // check if we may have info on this person from the 2011 crossfit open.
                        RadAjaxManager1.ResponseScripts.Add(" $(function(){ Aqufit.Page.Actions.LoadStep(" + Request["step"] + "); }); ");
                    }
                    this.baseUrl = ResolveUrl("~/");
                    userPhotoPath = this.baseUrl + @"\Portals\0\Users\" + base.UserSettings.UserName;
                    urlPath = "/Portals/0/Users/" + base.UserSettings.UserName;
                }
            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
Exemplo n.º 18
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Page_Load runs when the control is loaded
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        /// </history>
        /// -----------------------------------------------------------------------------
        protected void Page_Load(System.Object sender, System.EventArgs e)
        {
            base.Page_Load(sender, e);
            try
            {

                this.BackgroundImageUrl = ResolveUrl("~/DesktopModules/ATI_Base/services/images/profile.aspx") + "?us=0&bg=1";
                aqufitEntities entities = new aqufitEntities();
                GroupType[] gTypes = entities.GroupTypes.ToArray();

                if (!Page.IsPostBack && !Page.IsCallback)
                {
                    ServiceReference service = new ServiceReference("~/DesktopModules/ATI_Base/resources/services/RegisterService.asmx");
                    service.InlineScript = true;
                    ScriptManager.GetCurrent(Page).Services.Add(service);
                    ServiceReference service2 = new ServiceReference("~/DesktopModules/ATI_Base/resources/services/StreamService.asmx");
                    service2.InlineScript = true;
                    ScriptManager.GetCurrent(Page).Services.Add(service2);

                    if (Request.Url.AbsoluteUri.Contains("http://www."))
                    {
                        Response.Redirect(Request.Url.AbsoluteUri.Replace("http://www.", "http://"), true);
                        return;
                    }
                    if (Request["t"] != null)
                    {
                        RadAjaxManager1.ResponseScripts.Add(" $(function(){ Aqufit.Page.Tabs.SwitchTab(" + Request["t"] + "); }); ");
                    }
                    if (Request["oauth_token"] != null)
                    {
                        RadAjaxManager1.ResponseScripts.Add(" $(function(){ Aqufit.Page.Tabs.SwitchTab(4); }); ");
                    }
                    atiFindInvite.UserSettings = UserSettings;
                    atiFindInvite.TabId = TabId;

                    ddlGroupType.DataSource = gTypes;
                    ddlGroupType.DataTextField = "TypeName";
                    ddlGroupType.DataValueField = "Id";
                    ddlGroupType.DataBind();

                    imgError.Src = ResolveUrl("~/DesktopModules/ATI_Base/resources/images/iError.png");
                    imgCheck.Src = ResolveUrl("~/DesktopModules/ATI_Base/resources/images/iCheck.png");

                    if (GroupSettings != null)   // This is a person trying to edit a group profile
                    {
                        atiFindInvite.GroupSettings = GroupSettings;
                        hrefBackToProfile.Visible = true;
                        hrefBackToProfile.HRef = ResolveUrl("~/") + "group/" + GroupSettings.UserName;
                        hrefBackToProfile.InnerHtml = "Back to " + GroupSettings.UserName + " page";
                        this.BackgroundImageUrl = ResolveUrl("~/DesktopModules/ATI_Base/services/images/profile.aspx") + "?us=" + GroupSettings.Id + "&bg=1";
                        this.ProfileCSS = GroupSettings.CssStyle;
                        bCreateGroup.Text = "Update";
                        atiProfileImage.Settings =  GroupSettings;
                        atiProfileImage.GroupUserName = GroupSettings.UserName;
                        UserFriends perm = entities.UserFriends.FirstOrDefault(w => w.SrcUserSettingKey == UserSettings.Id && w.DestUserSettingKey == GroupSettings.Id && w.Relationship <= (int)Affine.Utils.ConstsUtil.Relationships.GROUP_ADMIN);
                        // check that they have permissions first (need to be a group admin)
                        if (perm != null )
                        {
                            SetupAccountEdit(GroupSettings);
                        }
                        else
                        {
                            Response.Redirect(ResolveUrl("~") + UserSettings.UserName, true);
                            return;
                        }

                    }
                    else
                    {   // This is a new group to register...
                        atiProfileImage.Visible = false;
                        RadAjaxManager1.ResponseScripts.Add("$(function(){ $('#tabs').tabs('option', 'disabled', [1,2,3, 4]); });");
                    }

                }
            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
 protected override void OnInit(EventArgs e)
 {
     //
     // CODEGEN: This call is required by the ASP.NET Web Form Designer.
     //
     InitializeComponent();
     base.OnInit(e);
     ScriptManager mgrAjax = ScriptManager.GetCurrent(this.Page);
     if (mgrAjax != null)
     {
         var svc = new ServiceReference("~/CRM/Invoices/AutoComplete.asmx");
         var scr = new ScriptReference("~/CRM/Payments/AutoComplete.js");
         mgrAjax.Services.Add(svc);
         mgrAjax.Scripts.Add(scr);
     }
 }
Exemplo n.º 20
0
		private void Page_Load(object sender, System.EventArgs e)
		{
			valRelatedSelect.ErrorMessage = L10n.Term(".ERR_REQUIRED_FIELD");
			bSupportsPopups = Sql.ToBoolean(Page.Items["SupportsPopups"]);
			if ( this.IsMobile )
			{
				// 11/24/2010   .NET 4 has broken the compatibility of the browser file system. 
				// We are going to minimize our reliance on browser files in order to reduce deployment issues. 
				bSupportsPopups = Utils.SupportsPopups;
			}
			// 05/06/2010   Use a special Page flag to override the default IsPostBack behavior. 
			bool bIsPostBack = this.IsPostBack && !NotPostBack;
			if ( bIsPostBack )
			{
				dtLineItems = ViewState["LineItems"] as DataTable;
				grdMain.DataSource = dtLineItems;
			}
			else
			{
				Session.Remove(sRELATED_SOURCE_VIEW_NAME + "." + sRELATED_VIEW_NAME);
			}
			
			// 05/06/2010   Move the ajax refence code to Page_Load as it only needs to be called once. 
			ScriptManager mgrAjax = ScriptManager.GetCurrent(this.Page);
			// 11/23/2009   Taoqi 4.0 is very slow on Blackberry devices.  Lets try and turn off AJAX AutoComplete. 
			bAjaxAutoComplete = (mgrAjax != null);
			if ( this.IsMobile )
			{
				// 11/24/2010   .NET 4 has broken the compatibility of the browser file system. 
				// We are going to minimize our reliance on browser files in order to reduce deployment issues. 
				bAjaxAutoComplete = Utils.AllowAutoComplete && (mgrAjax != null);
			}
			if ( bAjaxAutoComplete )
			{
				ServiceReference svc = new ServiceReference("~/" + sRELATED_SOURCE_MODULE_NAME + "/AutoComplete.asmx");
				ScriptReference  scr = new ScriptReference ("~/" + sRELATED_SOURCE_MODULE_NAME + "/AutoComplete.js"  );
				if ( !mgrAjax.Services.Contains(svc) )
					mgrAjax.Services.Add(svc);
				if ( !mgrAjax.Scripts.Contains(scr) )
					mgrAjax.Scripts.Add(scr);
			}
		}
Exemplo n.º 21
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session[Constants.NAME] == null)
        {
            Response.Redirect("Login.aspx");
        }
        else
        {
            System.Web.UI.ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "Script", "TransfersInfoBinding();", true);
            if (!IsPostBack)
            {
                Session["CurrentPage"] = "New sale";

                if (LoadIndividualUserRights() == false)
                {
                    Response.Redirect("Login.aspx");
                }
                else
                {
                    ServiceReference objServiceReference = new ServiceReference();

                    ScriptReference objScriptReference = new ScriptReference();

                    objServiceReference.Path = "~/WebService.asmx";

                    objScriptReference.Path = "~/Static/Js/CarsJScript.js";

                    scrptmgr.Services.Add(objServiceReference);
                    scrptmgr.Scripts.Add(objScriptReference);

                    if (Session[Constants.NAME] == null)
                    {
                        lnkBtnLogout.Visible = false;
                        lblUserName.Visible = false;
                    }
                    else
                    {
                        //LoadUserRights();
                        lnkBtnLogout.Visible = true;
                        lblUserName.Visible = true;
                        string LogUsername = Session[Constants.NAME].ToString();
                        string CenterCode = Session[Constants.CenterCode].ToString();
                        string UserLogName = Session[Constants.USER_NAME].ToString();
                        if (LogUsername.Length > 20)
                        {
                            lblUserName.Text = LogUsername.ToString().Substring(0, 20);
                            //if (CenterCode.Length > 5)
                            //{
                            //    lblUserName.Text = lblUserName.Text + " (" + CenterCode.ToString().Substring(0, 5) + ")";
                            //}
                            //else
                            //{
                            lblUserName.Text = lblUserName.Text + " (" + CenterCode.ToString() + ")-" + UserLogName.ToString();
                            //}
                        }
                        else
                        {
                            lblUserName.Text = LogUsername;

                            lblUserName.Text = lblUserName.Text + " (" + UserLogName.ToString() + ")-" + CenterCode.ToString();
                        }

                    }
                    if (Session["DsDropDown"] == null)
                    {
                        dsDropDown = objdropdownBL.Usp_Get_DropDown();
                        Session["DsDropDown"] = dsDropDown;
                    }
                    else
                    {
                        dsDropDown = (DataSet)Session["DsDropDown"];
                    }
                    Session["NewSaleCarID"] = null;
                    Session["NewSaleUID"] = null;
                    Session["NewSalePostingID"] = null;
                    Session["NewSaleUserPackID"] = null;
                    Session["NewSaleSellerID"] = null;
                    Session["NewSalePSID1"] = null;
                    Session["NewSalePSID2"] = null;
                    Session["NewSalePaymentID"] = null;
                    lnkTicker.Attributes.Add("href", "javascript:poptastic('Ticker.aspx?CID=" + Session[Constants.CenterCodeID] + "&CNAME=" + Session[Constants.CenterCode] + "');");
                    DataSet dsYears = objHotLeadBL.USP_GetNext12years();

                    fillYears(dsYears);
                    FillYear();
                    FillPackage();
                    FillDiscounts();
                    FillStates();
                    GetAllModels();
                    GetMakes();
                    GetModelsInfo();
                    FillExteriorColor();
                    FillInteriorColor();
                    GetBody();
                    //FillPaymentDate();
                    FillPDDate();
                    FillBillingStates();
                    FillPhotoSource();
                    FillDescriptionSource();
                    FillVerifier();
                    FillAgents();
                    FillVoiceFileLocation();
                    // FillCheckTypes();
                    //DataSet dsTransfers = objHotLeadBL.GetLoginTransferAgentsCount();
                    //if (dsTransfers.Tables[0].Rows[0]["CountAll"].ToString() == "0")
                    //{
                    //    lblTransferAgentsCount.Text = "Transfer agent(s) are not available";
                    //}
                    //else
                    //{
                    //    lblTransferAgentsCount.Text = dsTransfers.Tables[0].Rows[0]["CountAll"].ToString() + " Transfer agent(s) available";
                    //    //System.Web.UI.ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "Script", "lll();", true);
                    //    DataSet dsTransferAgents = objHotLeadBL.GetAllLoginTransferAgentsDetails();
                    //    if (dsTransferAgents.Tables[0].Rows.Count > 0)
                    //    {
                    //        grdTest.DataSource = dsTransferAgents.Tables[0];
                    //        grdTest.DataBind();
                    //    }
                    //}
                    DataSet dsDatetime = objHotLeadBL.GetDatetime();
                    DateTime dtNow = Convert.ToDateTime(dsDatetime.Tables[0].Rows[0]["Datetime"].ToString());
                    txtPaymentDate.Text = dtNow.ToString("MM/dd/yyyy");
                    DataSet dsCenterRoles = objHotLeadBL.GetCenterRolesByID(Convert.ToInt32(Session[Constants.CenterCodeID].ToString()));
                    Session["dsCenterRoles"] = dsCenterRoles;
                    if (dsCenterRoles.Tables[0].Rows.Count > 0)
                    {
                        for (int i = 0; i < dsCenterRoles.Tables[0].Rows.Count; i++)
                        {
                            if (dsCenterRoles.Tables[0].Rows[i]["CenterRoleID"].ToString() == "1")
                            {
                                if (dsCenterRoles.Tables[0].Rows[i]["CenterRightStatus"].ToString() == "0")
                                {
                                    btnSale.Visible = false;
                                    btnSale2.Visible = false;
                                }
                                else
                                {
                                    btnSale.Visible = true;
                                    btnSale2.Visible = true;
                                }
                            }
                            if (dsCenterRoles.Tables[0].Rows[i]["CenterRoleID"].ToString() == "2")
                            {
                                if (dsCenterRoles.Tables[0].Rows[i]["CenterRightStatus"].ToString() == "0")
                                {
                                    btnTransfer.Visible = false;
                                    btnTransfer2.Visible = false;
                                    lblTransferAgentsCount.Visible = false;
                                }
                                else
                                {
                                    btnTransfer.Visible = true;
                                    btnTransfer2.Visible = true;
                                    lblTransferAgentsCount.Visible = true;
                                }
                            }
                        }
                    }
                    if ((Session["AbandonSalePostingID"] != null) && (Session["AbandonSalePostingID"].ToString() != ""))
                    {
                        int PostingID = Convert.ToInt32(Session["AbandonSalePostingID"].ToString());
                        DataSet Cardetais = objHotLeadBL.GetCarDetailsByPostingID(PostingID);

                        Double PackCost2 = new Double();
                        PackCost2 = Convert.ToDouble(Cardetais.Tables[0].Rows[0]["Price"].ToString());
                        string PackAmount2 = string.Format("{0:0.00}", PackCost2).ToString();
                        string PackName2 = Cardetais.Tables[0].Rows[0]["Description"].ToString();
                        ListItem listPack = new ListItem();
                        listPack.Value = Cardetais.Tables[0].Rows[0]["PackageID"].ToString();
                        listPack.Text = PackName2 + " ($" + PackAmount2 + ")";
                        ddlPackage.SelectedIndex = ddlPackage.Items.IndexOf(listPack);

                        ListItem liVer = new ListItem();
                        liVer.Text = Cardetais.Tables[0].Rows[0]["SaleVerifierName"].ToString();
                        liVer.Value = Cardetais.Tables[0].Rows[0]["SaleVerifierID"].ToString();
                        ddlVerifier.SelectedIndex = ddlVerifier.Items.IndexOf(liVer);

                        txtFirstName.Text = objGeneralFunc.ToProper(Cardetais.Tables[0].Rows[0]["sellerName"].ToString());
                        txtLastName.Text = objGeneralFunc.ToProper(Cardetais.Tables[0].Rows[0]["LastName"].ToString());
                        txtPhone.Text = objGeneralFunc.filPhnm(Cardetais.Tables[0].Rows[0]["PhoneNum"].ToString());
                        txtEmail.Text = Cardetais.Tables[0].Rows[0]["email"].ToString();
                        txtAddress.Text = objGeneralFunc.ToProper(Cardetais.Tables[0].Rows[0]["address1"].ToString());
                        txtCity.Text = objGeneralFunc.ToProper(Cardetais.Tables[0].Rows[0]["city"].ToString());
                        if (Cardetais.Tables[0].Rows[0]["EmailExists"].ToString() == "0")
                        {
                            chkbxEMailNA.Checked = true;
                        }
                        else
                        {
                            chkbxEMailNA.Checked = false;
                        }

                        ListItem listState = new ListItem();
                        listState.Value = Cardetais.Tables[0].Rows[0]["StateID"].ToString();
                        listState.Text = Cardetais.Tables[0].Rows[0]["state"].ToString();
                        ddlLocationState.SelectedIndex = ddlLocationState.Items.IndexOf(listState);
                        txtZip.Text = Cardetais.Tables[0].Rows[0]["zip"].ToString();

                        ListItem list2 = new ListItem();
                        list2.Value = Cardetais.Tables[0].Rows[0]["MakeID"].ToString();
                        list2.Text = Cardetais.Tables[0].Rows[0]["make"].ToString();
                        ddlMake.SelectedIndex = ddlMake.Items.IndexOf(list2);
                        GetModelsInfo();

                        ListItem list3 = new ListItem();
                        list3.Text = Cardetais.Tables[0].Rows[0]["model"].ToString();
                        list3.Value = Cardetais.Tables[0].Rows[0]["makeModelID"].ToString();
                        ddlModel.SelectedIndex = ddlModel.Items.IndexOf(list3);

                        ListItem list1 = new ListItem();
                        list1.Text = Cardetais.Tables[0].Rows[0]["yearOfMake"].ToString();
                        list1.Value = Cardetais.Tables[0].Rows[0]["yearOfMake"].ToString();
                        ddlYear.SelectedIndex = ddlYear.Items.IndexOf(list1);

                        ListItem listBody = new ListItem();
                        listBody.Value = Cardetais.Tables[0].Rows[0]["bodyTypeID"].ToString();
                        listBody.Text = Cardetais.Tables[0].Rows[0]["bodyType"].ToString();
                        ddlBodyStyle.SelectedIndex = ddlBodyStyle.Items.IndexOf(listBody);

                        if (Cardetais.Tables[0].Rows[0]["Carprice"].ToString() == "0.0000")
                        {
                            txtAskingPrice.Text = "";
                        }
                        else
                        {
                            txtAskingPrice.Text = string.Format("{0:0}", Convert.ToDouble(Cardetais.Tables[0].Rows[0]["Carprice"].ToString()));
                        }
                        if (txtAskingPrice.Text.Length > 6)
                        {
                            txtAskingPrice.Text = txtAskingPrice.Text.Substring(0, 6);
                        }

                        if (Cardetais.Tables[0].Rows[0]["mileage"].ToString() == "0.00")
                        {
                            txtMileage.Text = "";
                        }
                        else
                        {
                            txtMileage.Text = string.Format("{0:0}", Convert.ToDouble(Cardetais.Tables[0].Rows[0]["mileage"].ToString()));
                        }
                        if (txtMileage.Text.Length > 6)
                        {
                            txtMileage.Text = txtMileage.Text.Substring(0, 6);
                        }

                        string NumberOfCylinder = Cardetais.Tables[0].Rows[0]["numberOfCylinder"].ToString();
                        //if (NumberOfCylinder == "3 Cylinder")
                        //{
                        //    rdbtnCylinders1.Checked = true;
                        //    rdbtnCylinders7.Checked = false;
                        //}
                        //else if (NumberOfCylinder == "4 Cylinder")
                        //{
                        //    rdbtnCylinders2.Checked = true;
                        //    rdbtnCylinders7.Checked = false;
                        //}
                        //else if (NumberOfCylinder == "5 Cylinder")
                        //{
                        //    rdbtnCylinders3.Checked = true;
                        //    rdbtnCylinders7.Checked = false;
                        //}
                        //else if (NumberOfCylinder == "6 Cylinder")
                        //{
                        //    rdbtnCylinders4.Checked = true;
                        //    rdbtnCylinders7.Checked = false;
                        //}
                        //else if (NumberOfCylinder == "7 Cylinder")
                        //{
                        //    rdbtnCylinders5.Checked = true;
                        //    rdbtnCylinders7.Checked = false;
                        //}
                        //else if (NumberOfCylinder == "8 Cylinder")
                        //{
                        //    rdbtnCylinders6.Checked = true;
                        //    rdbtnCylinders7.Checked = false;
                        //}
                        //else
                        //{
                        //    rdbtnCylinders7.Checked = true;
                        //}

                        ListItem list7 = new ListItem();
                        list7.Value = Cardetais.Tables[0].Rows[0]["exteriorColor"].ToString();
                        list7.Text = Cardetais.Tables[0].Rows[0]["exteriorColor"].ToString();
                        ddlExteriorColor.SelectedIndex = ddlExteriorColor.Items.IndexOf(list7);

                        ListItem list8 = new ListItem();
                        list8.Text = Cardetais.Tables[0].Rows[0]["interiorColor"].ToString();
                        list8.Value = Cardetais.Tables[0].Rows[0]["interiorColor"].ToString();
                        ddlInteriorColor.SelectedIndex = ddlInteriorColor.Items.IndexOf(list8);

                        string Transmission = Cardetais.Tables[0].Rows[0]["Transmission"].ToString();
                        //if (Transmission == "Automatic")
                        //{
                        //    rdbtnTrans1.Checked = true;
                        //    rdbtnTrans4.Checked = false;
                        //}
                        //else if (Transmission == "Manual")
                        //{
                        //    rdbtnTrans2.Checked = true;
                        //    rdbtnTrans4.Checked = false;
                        //}
                        //else if (Transmission == "Tiptronic")
                        //{
                        //    rdbtnTrans3.Checked = true;
                        //    rdbtnTrans4.Checked = false;
                        //}
                        //else
                        //{
                        //    rdbtnTrans4.Checked = true;
                        //}
                        //string NumberOfDoors = Cardetais.Tables[0].Rows[0]["numberOfDoors"].ToString();
                        //if (NumberOfDoors == "Two Door")
                        //{
                        //    rdbtnDoor2.Checked = true;
                        //    rdbtnDoor6.Checked = false;
                        //}
                        //else if (NumberOfDoors == "Three Door")
                        //{
                        //    rdbtnDoor3.Checked = true;
                        //    rdbtnDoor6.Checked = false;
                        //}
                        //else if (NumberOfDoors == "Four Door")
                        //{
                        //    rdbtnDoor4.Checked = true;
                        //    rdbtnDoor6.Checked = false;
                        //}

                        //else if (NumberOfDoors == "Five Door")
                        //{
                        //    rdbtnDoor5.Checked = true;
                        //    rdbtnDoor6.Checked = false;
                        //}
                        //else
                        //{
                        //    rdbtnDoor6.Checked = true;
                        //}

                        string DriveTrain = Cardetais.Tables[0].Rows[0]["DriveTrain"].ToString();
                        //if (DriveTrain == "2 wheel drive")
                        //{
                        //    rdbtnDriveTrain1.Checked = true;
                        //    rdbtnDriveTrain5.Checked = false;
                        //}
                        //else if (DriveTrain == "2 wheel drive - front")
                        //{
                        //    rdbtnDriveTrain2.Checked = true;
                        //    rdbtnDriveTrain5.Checked = false;
                        //}
                        //else if (DriveTrain == "All wheel drive")
                        //{
                        //    rdbtnDriveTrain3.Checked = true;
                        //    rdbtnDriveTrain5.Checked = false;
                        //}
                        //else if (DriveTrain == "Rear wheel drive")
                        //{
                        //    rdbtnDriveTrain4.Checked = true;
                        //    rdbtnDriveTrain5.Checked = false;
                        //}
                        //else
                        //{
                        //    rdbtnDriveTrain5.Checked = true;
                        //}
                        txtVin.Text = Cardetais.Tables[0].Rows[0]["VIN"].ToString();

                        int FuelTypeID = Convert.ToInt32(Cardetais.Tables[0].Rows[0]["fuelTypeID"].ToString());
                        //if (FuelTypeID == 1)
                        //{
                        //    rdbtnFuelType1.Checked = true;
                        //    rdbtnFuelType8.Checked = false;
                        //}
                        //else if (FuelTypeID == 2)
                        //{
                        //    rdbtnFuelType2.Checked = true;
                        //    rdbtnFuelType8.Checked = false;
                        //}
                        //else if (FuelTypeID == 3)
                        //{
                        //    rdbtnFuelType3.Checked = true;
                        //    rdbtnFuelType8.Checked = false;
                        //}
                        //else if (FuelTypeID == 4)
                        //{
                        //    rdbtnFuelType4.Checked = true;
                        //    rdbtnFuelType8.Checked = false;
                        //}
                        //else if (FuelTypeID == 5)
                        //{
                        //    rdbtnFuelType5.Checked = true;
                        //    rdbtnFuelType8.Checked = false;
                        //}
                        //else if (FuelTypeID == 6)
                        //{
                        //    rdbtnFuelType6.Checked = true;
                        //    rdbtnFuelType8.Checked = false;
                        //}
                        //else if (FuelTypeID == 7)
                        //{
                        //    rdbtnFuelType7.Checked = true;
                        //    rdbtnFuelType8.Checked = false;
                        //}
                        //else
                        //{
                        //    rdbtnFuelType8.Checked = true;
                        //}
                        int ConditionID = Convert.ToInt32(Cardetais.Tables[0].Rows[0]["vehicleConditionID"].ToString());
                        //if (ConditionID == 1)
                        //{
                        //    rdbtnCondition1.Checked = true;
                        //    rdbtnCondition7.Checked = false;
                        //}
                        //else if (ConditionID == 2)
                        //{
                        //    rdbtnCondition2.Checked = true;
                        //    rdbtnCondition7.Checked = false;
                        //}
                        //else if (ConditionID == 3)
                        //{
                        //    rdbtnCondition3.Checked = true;
                        //    rdbtnCondition7.Checked = false;
                        //}
                        //else if (ConditionID == 4)
                        //{
                        //    rdbtnCondition4.Checked = true;
                        //    rdbtnCondition7.Checked = false;
                        //}
                        //else if (ConditionID == 5)
                        //{
                        //    rdbtnCondition5.Checked = true;
                        //    rdbtnCondition7.Checked = false;
                        //}
                        //else if (ConditionID == 6)
                        //{
                        //    rdbtnCondition6.Checked = true;
                        //    rdbtnCondition7.Checked = false;
                        //}
                        //else
                        //{
                        //    rdbtnCondition7.Checked = true;
                        //}

                        for (int i = 1; i < 54; i++)
                        {
                            if (i != 10)
                            {
                                if (i != 37)
                                {
                                    if (i != 38)
                                    {
                                        string ChkBoxID = "chkFeatures" + i.ToString();
                                        CheckBox ChkedBox = (CheckBox)form1.FindControl(ChkBoxID);
                                        if (Cardetais.Tables[1].Rows.Count >= i)
                                        {
                                            if (Cardetais.Tables[1].Rows[i - 1]["Isactive"].ToString() == "True")
                                            {
                                                ChkedBox.Checked = true;
                                            }
                                            else
                                            {
                                                ChkedBox.Checked = false;
                                            }
                                        }
                                        else
                                        {
                                            ChkedBox.Checked = false;
                                        }
                                    }
                                }
                            }
                        }
                        if (Cardetais.Tables[1].Rows.Count > 9)
                        {
                            if (Cardetais.Tables[1].Rows[9]["Isactive"].ToString() == "True")
                            {
                                rdbtnLeather.Checked = true;
                                rdbtnInteriorNA.Checked = false;
                            }
                        }
                        if (Cardetais.Tables[1].Rows.Count > 36)
                        {
                            if (Cardetais.Tables[1].Rows[36]["Isactive"].ToString() == "True")
                            {
                                rdbtnVinyl.Checked = true;
                                rdbtnInteriorNA.Checked = false;
                            }
                        }
                        if (Cardetais.Tables[1].Rows.Count > 37)
                        {
                            if (Cardetais.Tables[1].Rows[37]["Isactive"].ToString() == "True")
                            {
                                rdbtnCloth.Checked = true;
                                rdbtnInteriorNA.Checked = false;
                            }
                        }
                        if (Cardetais.Tables[1].Rows.Count > 53)
                        {
                            if (Cardetais.Tables[1].Rows[53]["Isactive"].ToString() == "True")
                            {
                                rdbtnInteriorNA.Checked = true;
                            }
                        }
                        txtDescription.Text = Cardetais.Tables[0].Rows[0]["Cardescription"].ToString();
                        string OldNotes = Cardetais.Tables[0].Rows[0]["SaleNotes"].ToString();
                        OldNotes = OldNotes.Replace("<br>", Environment.NewLine);
                        txtSaleNotes.Text = OldNotes;

                        ListItem liSourceofPhotos = new ListItem();
                        liSourceofPhotos.Text = Cardetais.Tables[0].Rows[0]["SourceOfPhotosName"].ToString();
                        liSourceofPhotos.Value = Cardetais.Tables[0].Rows[0]["SourceOfPhotosID"].ToString();
                        ddlPhotosSource.SelectedIndex = ddlPhotosSource.Items.IndexOf(liSourceofPhotos);

                        ListItem liVoiceLocation = new ListItem();
                        liVoiceLocation.Text = Cardetais.Tables[0].Rows[0]["VoiceFileLocationName"].ToString();
                        liVoiceLocation.Value = Cardetais.Tables[0].Rows[0]["VoiceFileLocation"].ToString();
                        ddlVoiceFileLocation.SelectedIndex = ddlVoiceFileLocation.Items.IndexOf(liVoiceLocation);

                        ListItem liSourceofDescription = new ListItem();
                        liSourceofDescription.Text = Cardetais.Tables[0].Rows[0]["SourceOfDescriptionName"].ToString();
                        liSourceofDescription.Value = Cardetais.Tables[0].Rows[0]["SourceOfDescriptionID"].ToString();
                        ddlDescriptionSource.SelectedIndex = ddlDescriptionSource.Items.IndexOf(liSourceofDescription);

                        Session["NewSaleCarID"] = Cardetais.Tables[0].Rows[0]["carid"].ToString();
                        Session["NewSaleUID"] = Cardetais.Tables[0].Rows[0]["uid"].ToString();
                        Session["NewSalePostingID"] = Cardetais.Tables[0].Rows[0]["postingID"].ToString();
                        Session["NewSaleUserPackID"] = Cardetais.Tables[0].Rows[0]["UserPackID"].ToString();
                        Session["NewSaleSellerID"] = Cardetais.Tables[0].Rows[0]["sellerID"].ToString();
                        Session["NewSalePSID1"] = Cardetais.Tables[0].Rows[0]["PSID1"].ToString();
                        if (Cardetais.Tables[0].Rows[0]["PSID2"].ToString() != "")
                        {
                            Session["NewSalePSID2"] = Convert.ToInt32(Cardetais.Tables[0].Rows[0]["PSID2"].ToString());
                        }
                        if (Cardetais.Tables[0].Rows[0]["PaymentID"].ToString() != "")
                        {
                            Session["NewSalePaymentID"] = Convert.ToInt32(Cardetais.Tables[0].Rows[0]["PaymentID"].ToString());
                        }

                    }
                    else
                    {
                        MPEUpdate.Show();
                    }
                }
            }
        }
    }
Exemplo n.º 22
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Page_Load runs when the control is loaded
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        /// </history>
        /// -----------------------------------------------------------------------------
        protected void Page_Load(System.Object sender, System.EventArgs e)
        {
            base.Page_Load(sender, e);
            try
            {
                aqufitEntities entities = new aqufitEntities();
                bool isAdmin = false;
                if (Request["c"] != null)
                {
                    // TODO: make sure they are a group admin to the comp..
                    CompetitionKey = Convert.ToInt64(Request["c"]);
                    Competition comp = entities.Competitions.Include("Group").FirstOrDefault(c => c.Id == CompetitionKey);
                    if (comp != null)
                    {
                        UserFriends admin = entities.UserFriends.FirstOrDefault(f => f.SrcUserSettingKey == UserSettings.Id && f.DestUserSettingKey == comp.Group.Id && f.Relationship <= (int)Affine.Utils.ConstsUtil.Relationships.GROUP_ADMIN);
                        if (admin != null)
                        {
                            isAdmin = true;
                        }
                        litCompOwner.Text = comp.Group.UserFirstName;
                        txtCompName.Text = comp.Name;
                        RadCompStartDate.SelectedDate = comp.CompetitionStartDate;
                        RadCompEndDate.SelectedDate = comp.CompetitionEndDate;
                    }
                }

                if( !isAdmin )
                {
                    Response.Redirect(ResolveUrl("~/") + UserSettings.UserName);
                }
                RadListBoxTeamSource.DataSource = entities.CompetitionRegistrations.Where(r => r.Competition.Id == CompetitionKey && r.CompetitionCategory.Id == (int)Affine.Utils.WorkoutUtil.CompetitionCategory.TEAM).Select(r => new { Name = r.TeamName, Value = r.Id }).ToArray();
                RadListBoxTeamSource.DataTextField = "Name";
                RadListBoxTeamSource.DataValueField = "Value";
                RadListBoxTeamSource.DataBind();

                if (!Page.IsPostBack && !Page.IsCallback)
                {
                    ddlTeamPools.DataSource = entities.CompetitionTeamPools.Where(tp => tp.Competition.Id == CompetitionKey).Select(tp => new { Name = tp.Name, Value = tp.Id }).ToArray();
                    ddlTeamPools.DataTextField = "Name";
                    ddlTeamPools.DataValueField = "Value";
                    ddlTeamPools.DataBind();

                    if (ddlTeamPools.Items.Count == 0)
                    {
                        buttonAddPoolWorkout.Visible = false;
                        RadGrid2.Visible = false;
                    }

                    baseUrl = ResolveUrl("~/");
                    ServiceReference service = new ServiceReference("~/DesktopModules/ATI_Base/resources/services/StreamService.asmx");
                    service.InlineScript = true;
                    ScriptManager.GetCurrent(Page).Services.Add(service);

                }

            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Page_Load runs when the control is loaded
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        /// </history>
        /// -----------------------------------------------------------------------------
        protected void Page_Load(System.Object sender, System.EventArgs e)
        {
            try
            {
                base.Page_Load(sender, e);
                if (!Page.IsPostBack && !Page.IsCallback)
                {
                    if (ProfileSettings == null)
                    {
                        Response.Redirect(ResolveUrl( "~/" ), true);
                    }
                    ServiceReference service = new ServiceReference("~/DesktopModules/ATI_Base/resources/services/StreamService.asmx");
                    service.InlineScript = true;
                    ScriptManager.GetCurrent(Page).Services.Add(service);
                    atiProfileImage.Settings = base.ProfileSettings;
                    atiProfileImage.IsOwner = base.Permissions == AqufitPermission.OWNER;
                    atiStreamScript.IsFollowMode = true;
                    atiStreamScript.DefaultTake = 10;
                    bEditProfile.HRef = ResolveUrl("~/Register.aspx");
                    litFriendsTitle.Text = "Chefs " + ProfileSettings.UserName + " follows";
                    atiWebLinksList.ProfileSettings = base.ProfileSettings;
                    if (Permissions == AqufitPermission.OWNER )
                    {
                        atiFollow.Visible = false;
                        atiWebLinksList.IsOwner = true;
                    }
                    else if (Permissions == AqufitPermission.PUBLIC)
                    {
                        string url = DotNetNuke.Common.Globals.NavigateURL(PortalSettings.LoginTabId, "Login", new string[] { "returnUrl=/" + this.ProfileSettings.UserName });
                        atiFollow.OnClientClick = "self.location.href='" + url + "'; return false;";
                        atiFollow.Click -= atiFollow_Click;
                    }
                    else
                    {
                        atiFollow.Text = base.Following ? "Unfollow " : "Follow " + ProfileSettings.UserName;
                    }
                    aqufitEntities entities = new aqufitEntities();
                    IList<long> friendIds = entities.UserFriends.Where(f => (f.SrcUserSettingKey == this.ProfileSettings.Id) ).Select(f =>f.DestUserSettingKey).ToList();
                    UserSettings[] firendSettings = entities.UserSettings.Where(LinqUtils.BuildContainsExpression<UserSettings, long>(s => s.Id, friendIds)).Where( f => f.PortalKey == this.PortalId ).ToArray();
                    atiFriendsPhotos.RelationshipType = Affine.Relationship.FOLLOWING;
                    atiFriendsPhotos.FriendKeyList = firendSettings;
                    atiFriendsPhotos.User = base.ProfileSettings;
                    atiFriendsPhotos.FriendCount = friendIds.Count;

                    Metric numRecipes = ProfileSettings.Metrics.FirstOrDefault(m => m.MetricType == (int)Utils.MetricUtil.MetricType.NUM_RECIPES);
                    lNumCreations.Text = lNumCreations2.Text = ProfileSettings.UserName + "'s Creations (" + (numRecipes != null ? numRecipes.MetricValue : "0") + ")";
                    lNumFavorites.Text = lNumFavorites2.Text = "" + entities.User2StreamFavorites.Where(f => f.UserKey == ProfileSettings.UserKey && f.PortalKey == ProfileSettings.PortalKey).Count();
                    lUserName.Text = ProfileSettings.UserKey == this.UserId ? "you" : ProfileSettings.UserName;

                    atiStreamScript.EditUrl = ResolveUrl("~/AddRecipe.aspx");
                }
            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            //Litium.Extensions.Extensions.Instance.SearchStatistics.SearchLogs.CreateSearchLog(Request.UserHostAddress, "harkla", "", new Guid("2fa67779-1810-4fa5-a496-96469993f670"), FoundationContext.User.ID, new Guid("005c5d81-f0fe-4dfe-b95d-b004c16fbcd3"));
            //Litium.Extensions.Extensions.Instance.SearchStatistics.SearchLogs.CreateSearchLog(Request.UserHostAddress, "markant", "", new Guid("2fa67779-1810-4fa5-a496-96469993f670"), FoundationContext.User.ID, new Guid("005c5d81-f0fe-4dfe-b95d-b004c16fbcd3"));
            //Litium.Extensions.Extensions.Instance.SearchStatistics.SearchLogs.CreateSearchLog(Request.UserHostAddress, "squash", "", new Guid("2fa67779-1810-4fa5-a496-96469993f670"), FoundationContext.User.ID, new Guid("005c5d81-f0fe-4dfe-b95d-b004c16fbcd3"));
            //Litium.Extensions.Extensions.Instance.SearchStatistics.SearchLogs.CreateSearchLog(Request.UserHostAddress, "glasögon", "", new Guid("2fa67779-1810-4fa5-a496-96469993f670"), FoundationContext.User.ID, new Guid("005c5d81-f0fe-4dfe-b95d-b004c16fbcd3"));
            //Litium.Extensions.Extensions.Instance.SearchStatistics.SearchLogs.CreateSearchLog(Request.UserHostAddress, "import", "", new Guid("2fa67779-1810-4fa5-a496-96469993f670"), FoundationContext.User.ID, new Guid("005c5d81-f0fe-4dfe-b95d-b004c16fbcd3"));
            //Litium.Extensions.Extensions.Instance.SearchStatistics.SearchLogs.CreateSearchLog(Request.UserHostAddress, "ikea", "", new Guid("2fa67779-1810-4fa5-a496-96469993f670"), FoundationContext.User.ID, new Guid("005c5d81-f0fe-4dfe-b95d-b004c16fbcd3"));
            //Litium.Extensions.Extensions.Instance.SearchStatistics.SearchLogs.CreateSearchLog(Request.UserHostAddress, "hv71", "", new Guid("2fa67779-1810-4fa5-a496-96469993f670"), FoundationContext.User.ID, new Guid("005c5d81-f0fe-4dfe-b95d-b004c16fbcd3"));
            //Litium.Extensions.Extensions.Instance.SearchStatistics.SearchLogs.CreateSearchLog(Request.UserHostAddress, "stridsvagn", "", new Guid("2fa67779-1810-4fa5-a496-96469993f670"), FoundationContext.User.ID, new Guid("005c5d81-f0fe-4dfe-b95d-b004c16fbcd3"));
            //Litium.Extensions.Extensions.Instance.SearchStatistics.SearchLogs.CreateSearchLog(Request.UserHostAddress, "jojk", "", new Guid("2fa67779-1810-4fa5-a496-96469993f670"), FoundationContext.User.ID, new Guid("005c5d81-f0fe-4dfe-b95d-b004c16fbcd3"));
            //Litium.Extensions.Extensions.Instance.SearchStatistics.SearchLogs.CreateSearchLog(Request.UserHostAddress, "samer", "", new Guid("2fa67779-1810-4fa5-a496-96469993f670"), FoundationContext.User.ID, new Guid("005c5d81-f0fe-4dfe-b95d-b004c16fbcd3"));

            ScriptManager manager = ScriptManager.GetCurrent(Page);
            ServiceReference serviceReference = new ServiceReference("~/Extensions/WebServices/SearchStatistics.asmx");
            if (manager != null && manager.Services.IndexOf(serviceReference) == -1)
            {
                manager.Services.Add(serviceReference);
            }

            if (!Page.IsPostBack)
            {
                // Init toolbar
                InitToolbar();
                InitControls();

                GetSearchList();
            }
        }
Exemplo n.º 25
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            //SD: This is useless as it won't work in live editing anyways whilst using MS Ajax/ScriptManager for ajax calls
            if (!UmbracoContext.Current.LiveEditingContext.Enabled)
            {
                presentation.webservices.ajaxHelpers.EnsureLegacyCalls(base.Page);
                ScriptManager sm = ScriptManager.GetCurrent(base.Page);
                ServiceReference webservicePath = new ServiceReference(Umbraco.Core.IO.IOHelper.ResolveUrl(Umbraco.Core.IO.SystemDirectories.Umbraco) + "/webservices/MacroContainerService.asmx");

                if (!sm.Services.Contains(webservicePath))
                    sm.Services.Add(webservicePath);
            }
            else
            {
                ClientDependencyLoader.Instance.RegisterDependency("webservices/legacyAjaxCalls.asmx/js", "UmbracoRoot", ClientDependencyType.Javascript);
                ClientDependencyLoader.Instance.RegisterDependency("webservices/MacroContainerService.asmx/js", "UmbracoRoot", ClientDependencyType.Javascript);
            }

            _addMacro = new LinkButton();
            _addMacro.ID = ID + "_btnaddmacro";


            _addMacro.Click += new EventHandler(_addMacro_Click);
            _addMacro.Text = ui.Text("insertMacro");
            _addMacro.CssClass = "macroContainerAdd";

            this.ContentTemplateContainer.Controls.Add(_addMacro);


            _limit = new Literal();
            _limit.Text = string.Format(" Only {0} macros are allowed", _maxNumber);
            _limit.ID = ID + "_litlimit";
            _limit.Visible = false;

            this.ContentTemplateContainer.Controls.Add(_limit);

            string widthHeight = "";
            if (_preferedHeight > 0 && _preferedWidth > 0)
            {
                widthHeight = String.Format(" style=\"min-width: {0}px; min-height: {1}px;\"", _preferedWidth, _preferedHeight);
            }

            this.ContentTemplateContainer.Controls.Add(new LiteralControl(String.Format("<div id=\"" + ID + "container\" class=\"macrocontainer\"{0}>", widthHeight)));

            Regex tagregex = new Regex("<[^>]*(>|$)", RegexOptions.Singleline | RegexOptions.ExplicitCapture | RegexOptions.Compiled);
            MatchCollection tags = tagregex.Matches(_data.Value.ToString());

            List<int> editornumbers = new List<int>();
            string sortorder = string.Empty;


            for (int i = 0; i < _maxNumber; i++)
            {
                if (!editornumbers.Contains(i))
                {
                    string data = string.Empty;

                    if (tags.Count > i)
                        data = tags[i].Value;

                    MacroEditor macroEditor = new MacroEditor(data, _allowedMacros);
                    macroEditor.ID = ID + "macroeditor_" + i;

                    this.ContentTemplateContainer.Controls.Add(macroEditor);
                }


            }

            this.ContentTemplateContainer.Controls.Add(new LiteralControl("</div>"));

            if (tags.Count == _maxNumber)
            {
                _addMacro.Enabled = false;
                _limit.Visible = true;
            }



            MacroContainerEvent.Execute += new MacroContainerEvent.ExecuteHandler(MacroContainerEvent_Execute);

        }
 /// <summary>
 /// Registers the web service.
 /// </summary>
 protected void RegisterWebService()
 {
     ServiceReference item = new ServiceReference();
     item.Path = "~/SmartParts/OpportunitySalesProcess/SalesProcessWebService.asmx";
     item.InlineScript = true;
     scriptManagerProxy.Services.Add(item);
 }
Exemplo n.º 27
0
 /// -----------------------------------------------------------------------------
 /// <summary>
 /// Page_Load runs when the control is loaded
 /// </summary>
 /// <remarks>
 /// </remarks>
 /// <history>
 /// </history>
 /// -----------------------------------------------------------------------------
 protected void Page_Load(System.Object sender, System.EventArgs e)
 {
     base.Page_Load(sender, e);
     try
     {
         if (!Page.IsPostBack && !Page.IsCallback)
         {
             if (base.Permissions == AqufitPermission.PUBLIC)
             {   // You need to be logged in to see this page.. redirect to login
                 Response.Redirect(ResolveUrl("~/Login.aspx"), true);
                 return;
             }
             imgAd.Src = ResolveUrl("~/Portals/0/images/adTastyPaleo.jpg");
             ServiceReference service = new ServiceReference("~/DesktopModules/ATI_Base/resources/services/StreamService.asmx");
             service.InlineScript = true;
             ScriptManager.GetCurrent(Page).Services.Add(service);
             atiProfile.ProfileSettings = UserSettings;
             atiProfile.IsOwner = true;
            /*
             if (Request["m"] != null)
             {
                 Affine.WebService.StreamService ss = new WebService.StreamService();
                 string json = ss.getMessage(UserSettings.Id, Convert.ToInt64( Request["m"] ) );
                 json = json.Replace("'", "").Replace("\n","");
                 RadAjaxManager1.ResponseScripts.Add("Aqufit.addLoadEvent(function(){alert('"+json+"');  Aqufit.Page.MessageSentListScript.generateMessageDom('"+json+"'); });");
             }
             */
         }
     }
     catch (Exception exc) //Module failed to load
     {
         Exceptions.ProcessModuleLoadException(this, exc);
     }
 }
Exemplo n.º 28
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Page_Load runs when the control is loaded
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        /// </history>
        /// -----------------------------------------------------------------------------
        protected void Page_Load(System.Object sender, System.EventArgs e)
        {
            base.Page_Load(sender, e);
            this.EnsureChildControls();
            try
            {
                /////////////////////////////
                // TESTING
               //     Workout ww = entities.UserStreamSet.Include("UserSetting").OfType<Workout>().Where(w => w.UserSetting.Id == UserSettings.Id && w.WorkoutTypeKey == (long)WorkoutUtil.WorkoutType.CROSSFIT).OrderByDescending(w => w.Id).FirstOrDefault();
               //     DisplayWorkoutStatistics(ww);
                ///////////////////////////
                RadAjaxManager1.AjaxSettings.AddAjaxSetting(panelAjax, panelAjax, RadAjaxLoadingPanel2);
                RadAjaxManager1.AjaxSettings.AddAjaxSetting(RadListViewTags, RadListViewTags, RadAjaxLoadingPanel2);
                RadAjaxManager1.AjaxSettings.AddAjaxSetting(RadGrid2, RadGrid2, RadAjaxLoadingPanel2);

                if (!Page.IsPostBack && !Page.IsCallback)
                {
                    this.baseUrl = ResolveUrl("~/");
                    RadAjaxManager1.ResponseScripts.Add("$(function(){ $('#tabs').tabs(); });");
                    if (base.UserSettings != null && base.ProfileSettings == null && (!Page.IsPostBack && !Page.IsCallback))
                    {   // This should fix the case of landing on "FitnessProfile.aspx" and we want them at "/username"
                        Response.Redirect(baseUrl + base.UserSettings.UserName, true);
                    }
                    else if (base.UserSettings == null && base.ProfileSettings == null)
                    {   // This only happens when someone "logs out" on their profile page and is redirected back there.
                        Response.Redirect(baseUrl, true);
                    }
                    if (base.ProfileSettings is Group)
                    {
                        Response.Redirect(baseUrl + "group/" + base.ProfileSettings.UserName, true);
                    }

                    PhotoUrl = this.baseUrl + ProfileSettings.UserName + "/photos";
                    aStats.HRef = baseUrl + ProfileSettings.UserName + "/achievements";
                    aHistory.HRef = baseUrl + ProfileSettings.UserName + "/workout-history";
                    aGroups.HRef = baseUrl + "Groups";
                    aPhotos.HRef = baseUrl + ProfileSettings.UserName + "/photos";

                    ServiceReference service = new ServiceReference("~/DesktopModules/ATI_Base/resources/services/StreamService.asmx");
                    service.InlineScript = true;
                    ScriptManager.GetCurrent(Page).Services.Add(service);

                    aqufitEntities entities = new aqufitEntities();
                    // get the groups that the person is in...
                    lUserName.Text = "<h2>" + ProfileSettings.UserName + "</h2>";
                    LoadChartData();
                    atiProfile.ProfileSettings = base.ProfileSettings;
                    if (base.ProfileSettings.MainGroupKey.HasValue)
                    {
                        atiProfile.MainGroup = entities.UserSettings.OfType<Group>().FirstOrDefault(g => g.Id == ProfileSettings.MainGroupKey.Value);
                    }
                    this.ProfileCSS = base.ProfileSettings.CssStyle;
                    imgAdRight.Src = ResolveUrl("/portals/0/images/adTastyPaleo.jpg");
                    imgAddToFriends.Src = ResolveUrl("~/DesktopModules/ATI_Base/resources/images/iAddToFriends.png");
                    imgAddToFollow.Src = ResolveUrl("~/DesktopModules/ATI_Base/resources/images/iAddToFollow.png");

                    // PERMISSIONS: The action panel is only visible to OWNERS
                    if (Permissions == AqufitPermission.OWNER)
                    {
                        panelStreamPost.Visible = false;
                        long[] gIgs = entities.UserFriends.Where(f => f.SrcUserSettingKey == UserSettings.Id).Select(f => f.DestUserSettingKey).ToArray();
                        var groupList = entities.UserSettings.OfType<Group>().Where(Utils.Linq.LinqUtils.BuildContainsExpression<Group, long>(g => g.Id, gIgs)).Select(g => new { Id = g.Id, Name = g.UserFirstName });
                        ddlGroupSchedule.DataTextField = "Name";
                        ddlGroupSchedule.DataValueField = "Id";
                        ddlGroupSchedule.DataSource = groupList;
                        ddlGroupSchedule.DataBind();
                        if (UserSettings.MainGroupKey.HasValue)
                        {
                            // This looks like shit but for some reason other methods of setting the value did not work ???
                            ddlGroupSchedule.SelectedIndex = ddlGroupSchedule.Items.IndexOf(ddlGroupSchedule.Items.FindByValue("" + UserSettings.MainGroupKey.Value));
                        }
                        else
                        {
                            panelNoGroups.Visible = true;
                        }

                        atiProfile.IsOwner = true;
                        atiStreamScript.ShowStreamSelect = true;
                        SiteSetting introSettings = ProfileSettings.SiteSettings.FirstOrDefault(ss => ss.Name == "SiteIntro" );
                        SiteSetting StreamTutorial = ProfileSettings.SiteSettings.FirstOrDefault(ss => ss.Name == "StreamTutorial");
                        // if the user has NO WORKOUTS posted... then we show the tutorial
                        long aWorkoutId = entities.UserStreamSet.OfType<Workout>().Where(s => s.UserSetting.Id == UserSettings.Id).Select(s => s.Id).FirstOrDefault();

                        if( introSettings != null ){
                            RadListViewTags.Visible = false;
                            atiStepByStep.Visible = true;
                            atiStepByStep.Step1Link = ResolveUrl("~/Community/HowTo.aspx") + "?h=2";
                            atiStepByStep.Step2Link = ResolveUrl("~/Community/HowTo.aspx") + "?h=3";
                            atiStepByStep.Step3Link = ResolveUrl("~/Community/HowTo.aspx") + "?h=4";
                            atiStepByStep.Step4Link = ResolveUrl("~/Community/HowTo.aspx") + "?h=5";
                            long aFriend =  entities.UserFriends.Where( f => (f.DestUserSettingKey == UserSettings.Id || f.SrcUserSettingKey == UserSettings.Id) && f.Relationship == (int)Affine.Utils.ConstsUtil.Relationships.FRIEND ).Select( f => f.Id ).FirstOrDefault();
                            atiStepByStep.Step1Check = aFriend > 0;
                            atiStepByStep.Step2Check = UserSettings.MainGroupKey.HasValue;
                            atiStepByStep.Step3Check = aWorkoutId > 0;
                        }
                        if (StreamTutorial != null)
                        {
                            atiStreamTutorial.Visible = true;
                           // if (aWorkoutId > 0)
                           // {
                           // }
                        }
                        // always default to workout tab for your Own profile..
                        RadAjaxManager1.ResponseScripts.Add("$(function(){ Aqufit.Page.Tabs.SwitchTab(1); });");
                        if (Request["w"] != null )
                        {
                            long wId = Convert.ToInt64(Request["w"]);
                            WOD wod = entities.WODs.Include("WODType").FirstOrDefault(w => w.Id == wId);
                            atiWorkout.LastWorkoutType = Affine.Utils.WorkoutUtil.WorkoutType.CROSSFIT;
                            if (wod != null)
                            {
                                atiWorkout.SetControlToWOD = wod;
                            }
                            else
                            {
                                scehduledWorkoutSetup();
                            }
                        }else if(Request["r"] != null ){
                            long rId = Convert.ToInt64(Request["r"]);
                            MapRoute route = entities.MapRoutes.FirstOrDefault(w => w.Id == rId);
                            if (route != null)
                            {
                                atiWorkout.SetControlToMapRoute = route;
                                atiWorkout.Distance = UnitsUtil.systemDefaultToUnits( route.RouteDistance, base.DistanceUnits);
                            }
                        }
                        else
                        {   // default the wod to one that is scheduled for the day if that exists ...
                            scehduledWorkoutSetup();
                        }

                    }
                    else
                    {
                        tabComment.Visible = pageViewComment.Visible = false;
                        tabWorkout.Visible = pageViewWorkout.Visible = false;
                    }
                    if (Permissions == AqufitPermission.FRIEND) // You are viewing a friends profile... so should the "Send Message Button";
                    {
                        panelStreamPost.Visible = true;
                        litStreamPostTitle.Text = "<h3>Post a message into " + ProfileSettings.UserName + "'s stream</h3>";
                        atiStreamScript.ShowStreamSelect = true;
                        atiProfile.IsFriend = true;
                    }
                    atiProfile.IsFollowing = base.Following;
                    this.BackgroundImageUrl = ResolveUrl("~/DesktopModules/ATI_Base/services/images/profile.aspx") + "?u="+base.ProfileSettings.UserKey+"&p="+base.ProfileSettings.PortalKey+"&bg=1";

                }
            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
Exemplo n.º 29
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session[Constants.NAME] == null)
        {
            Response.Redirect("Login.aspx");
        }
        else
        {
            System.Web.UI.ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "Script", "TransfersInfoBinding();", true);
            if (!IsPostBack)
            {
                Session["CurrentPage"] = "QC Module";

                if (LoadIndividualUserRights() == false)
                {
                    Response.Redirect("Login.aspx");
                }
                else
                {
                    ServiceReference objServiceReference = new ServiceReference();

                    ScriptReference objScriptReference = new ScriptReference();

                    objServiceReference.Path = "~/WebService.asmx";

                    objScriptReference.Path = "~/Static/Js/CarsJScript.js";

                    scrptmgr.Services.Add(objServiceReference);
                    scrptmgr.Scripts.Add(objScriptReference);

                    if (Session[Constants.NAME] == null)
                    {
                        lnkBtnLogout.Visible = false;
                        lblUserName.Visible = false;
                    }
                    else
                    {
                        LoadUserRights();
                        lnkBtnLogout.Visible = true;
                        lblUserName.Visible = true;
                        string LogUsername = Session[Constants.NAME].ToString();
                        string CenterCode = Session[Constants.CenterCode].ToString();
                        string UserLogName = Session[Constants.USER_NAME].ToString();
                        if (LogUsername.Length > 20)
                        {
                            lblUserName.Text = LogUsername.ToString().Substring(0, 20);
                            //if (CenterCode.Length > 5)
                            //{
                            //    lblUserName.Text = lblUserName.Text + " (" + CenterCode.ToString().Substring(0, 5) + ")";
                            //}
                            //else
                            //{
                            lblUserName.Text = lblUserName.Text + " (" + CenterCode.ToString() + ")-" + UserLogName.ToString();
                            //}
                        }
                        else
                        {
                            lblUserName.Text = LogUsername;
                            lblUserName.Text = lblUserName.Text + " (" + CenterCode.ToString() + ")-" + UserLogName.ToString();
                        }

                    }
                    if (Session["DsDropDown"] == null)
                    {
                        dsDropDown = objdropdownBL.Usp_Get_DropDown();
                        Session["DsDropDown"] = dsDropDown;
                    }
                    else
                    {
                        dsDropDown = (DataSet)Session["DsDropDown"];
                    }

                    Session["DealerQCEditDealerPaymentID"] = null;
                    Session["DealerQCEditDealerContactID"] = null;
                    Session["DealerQCEditDealerUID"] = null;
                    Session["DealerQCEditDealerCoordinatorID"] = null;
                    // lnkTicker.Attributes.Add("href", "javascript:poptastic('Ticker.aspx?CID=" + Session[Constants.CenterCodeID] + "&CNAME=" + Session[Constants.CenterCode] + "');");
                    DataSet dsYears = objHotLeadBL.USP_GetNext12years();

                    fillYears(dsYears);

                    DataSet dsDatetime = objHotLeadBL.GetDatetime();
                    FillStates();

                    FillPromotionOptions();
                    //FillPaymentDate();
                    //FillPDDate(dsDatetime);
                    FillPaymentDate(dsDatetime);
                    FillTargetDate(dsDatetime);
                    FillCallbackDate(dsDatetime);
                    FillContractSignDate(dsDatetime);
                    FillBillingStates();
                    FillInvoiceBillingStates();

                    FillVoiceFileLocation();
                    // FillCheckTypes();
                    if ((Session["DealerQCDealerSaleID"] != null) && (Session["DealerQCDealerSaleID"].ToString() != ""))
                    {
                        DataSet GetDealerData = objHotLeadBL.GetDealerDetailsByDealerSaleID(Convert.ToInt32(Session["DealerQCDealerSaleID"].ToString()));
                        if (GetDealerData.Tables.Count > 0)
                        {
                            if (GetDealerData.Tables[0].Rows.Count > 0)
                            {
                                if (GetDealerData.Tables[2].Rows.Count > 0)
                                {
                                    RepeaterSurveyEdit.Visible = true;
                                    RepeterSurvey.Visible = false;
                                    RepeaterSurveyEdit.DataSource = GetDealerData.Tables[2];
                                    RepeaterSurveyEdit.DataBind();
                                }
                                else
                                {
                                    FillSurveyQuestions();
                                }
                                if (GetDealerData.Tables[0].Rows[0]["PackageID"].ToString() != "0")
                                {
                                    Double PackCost2 = new Double();
                                    PackCost2 = Convert.ToDouble(GetDealerData.Tables[0].Rows[0]["Price"].ToString());
                                    string PackAmount2 = string.Format("{0:0.00}", PackCost2).ToString();
                                    string PackName2 = GetDealerData.Tables[0].Rows[0]["Description"].ToString();
                                    ListItem listPack = new ListItem();
                                    listPack.Value = GetDealerData.Tables[0].Rows[0]["PackageID"].ToString();
                                    listPack.Text = PackName2 + " ($" + PackAmount2 + ")";
                                    ddlPackage.SelectedIndex = ddlPackage.Items.IndexOf(listPack);
                                }

                                ListItem listStatus = new ListItem();
                                listStatus.Text = GetDealerData.Tables[0].Rows[0]["DealerStatusName"].ToString();
                                listStatus.Value = GetDealerData.Tables[0].Rows[0]["DealerStatusID"].ToString();
                                ddlSaleStatus.SelectedIndex = ddlSaleStatus.Items.IndexOf(listStatus);

                                txtSaleAgent.Text = GetDealerData.Tables[0].Rows[0]["AgentUFirstName"].ToString() + "(" + objGeneralFunc.GetCenterCode(GetDealerData.Tables[0].Rows[0]["AgentCenterID"].ToString()) + ")";
                                txtLeadSource.Text = GetDealerData.Tables[0].Rows[0]["LeadGeneratedBy"].ToString();
                                txtLeadAgent.Text = GetDealerData.Tables[0].Rows[0]["LeadAgent"].ToString();

                                Double PackCost1 = new Double();
                                PackCost1 = Convert.ToDouble(GetDealerData.Tables[0].Rows[0]["PromotionTakeAmount"].ToString());
                                string PackAmount1 = string.Format("{0:0.00}", PackCost1).ToString();
                                string PackName1 = GetDealerData.Tables[0].Rows[0]["PromotionName"].ToString();
                                ListItem list = new ListItem();
                                list.Text = PackName1 + " ($" + PackAmount1 + ")";
                                list.Value = GetDealerData.Tables[0].Rows[0]["PromotionID"].ToString();
                                ddlPromotionOptions.SelectedIndex = ddlPromotionOptions.Items.IndexOf(list);

                                txtDealerShipName.Text = objGeneralFunc.ToProper(GetDealerData.Tables[0].Rows[0]["DealerShipName"].ToString());
                                txtPhone.Text = objGeneralFunc.filPhnm(GetDealerData.Tables[0].Rows[0]["DealerPhone"].ToString());
                                txtFax.Text = objGeneralFunc.filPhnm(GetDealerData.Tables[0].Rows[0]["DealerFax"].ToString());
                                txtWebAddress.Text = GetDealerData.Tables[0].Rows[0]["DealerWebAddress"].ToString();
                                txtDealerLicenseNumber.Text = GetDealerData.Tables[0].Rows[0]["DealerLicenseNumber"].ToString();
                                txtAddress.Text = GetDealerData.Tables[0].Rows[0]["DealerAddress"].ToString();
                                txtCity.Text = GetDealerData.Tables[0].Rows[0]["DealerCity"].ToString();

                                ListItem listState = new ListItem();
                                listState.Value = GetDealerData.Tables[0].Rows[0]["DealerStateID"].ToString();
                                listState.Text = GetDealerData.Tables[0].Rows[0]["State_Code"].ToString();
                                ddlLocationState.SelectedIndex = ddlLocationState.Items.IndexOf(listState);
                                txtZip.Text = GetDealerData.Tables[0].Rows[0]["DealerZip"].ToString();

                                txtDealerContactName.Text = objGeneralFunc.ToProper(GetDealerData.Tables[0].Rows[0]["DealerContactName"].ToString());
                                txtDealerJobTitle.Text = GetDealerData.Tables[0].Rows[0]["DealerJobTitle"].ToString();
                                txtContactPhone.Text = objGeneralFunc.filPhnm(GetDealerData.Tables[0].Rows[0]["DealerContactPhone"].ToString());
                                txtContactMobileNumber.Text = objGeneralFunc.filPhnm(GetDealerData.Tables[0].Rows[0]["DealerMobilePhone"].ToString());
                                txtEmail.Text = GetDealerData.Tables[0].Rows[0]["DealerEmail"].ToString();
                                txtSaleNotes.Text = GetDealerData.Tables[0].Rows[0]["SaleNotes"].ToString();

                                Session["DealerQCEditDealerSaleID"] = GetDealerData.Tables[0].Rows[0]["DealerSaleID"].ToString();
                                Session["DealerQCEditDealerUID"] = GetDealerData.Tables[0].Rows[0]["DealerUID"].ToString();
                                Session["DealerQCEditDealerContactID"] = GetDealerData.Tables[0].Rows[0]["DealerContactID"].ToString();
                                Session["DealerQCEditDealerPaymentID"] = GetDealerData.Tables[0].Rows[0]["PaymentID"].ToString();
                                Session["DealerQCEditDealerCoordinatorID"] = GetDealerData.Tables[0].Rows[0]["UCEDealerCoordinatorID"].ToString();
                                Session["DealerQCEditPaymentStatus"] = GetDealerData.Tables[0].Rows[0]["pmntStatus"].ToString();
                                if ((GetDealerData.Tables[0].Rows[0]["pmntStatus"].ToString() == "1") || (GetDealerData.Tables[0].Rows[0]["pmntStatus"].ToString() == "7") || (GetDealerData.Tables[0].Rows[0]["SmartzStatus"].ToString() == "1"))
                                {
                                    rdbtnPayVisa.Enabled = false;
                                    rdbtnPayMasterCard.Enabled = false;
                                    rdbtnPayAmex.Enabled = false;
                                    rdbtnPayDiscover.Enabled = false;
                                    rdbtnPayCheck.Enabled = false;
                                    rdbtnInvoice.Enabled = false;
                                    lnkbtnCopyCheckName.Enabled = false;
                                    lnkbtnCopySellerInfo.Enabled = false;
                                    lnkbtnCopyInvoiceInfo.Enabled = false;
                                    ddlPaymentDate.Enabled = false;
                                    txtPDAmountNow.Enabled = false;
                                }

                                if (Convert.ToInt32(GetDealerData.Tables[0].Rows[0]["pmntType"].ToString()) == 5)
                                {
                                    divcard.Style["display"] = "none";
                                    divcheck.Style["display"] = "block";
                                    divpaypal.Style["display"] = "none";
                                    txtCustNameForCheck.Text = objGeneralFunc.ToProper(GetDealerData.Tables[0].Rows[0]["bankAccountHolderName"].ToString());
                                    txtAccNumberForCheck.Text = GetDealerData.Tables[0].Rows[0]["bankAccountNumber"].ToString();
                                    txtBankNameForCheck.Text = objGeneralFunc.ToProper(GetDealerData.Tables[0].Rows[0]["bankName"].ToString());
                                    txtRoutingNumberForCheck.Text = GetDealerData.Tables[0].Rows[0]["bankRouting"].ToString();
                                    //lblAccountType.Text = objGeneralFunc.ToProper(Cardetais.Tables[0].Rows[0]["AccountTypeName"].ToString());
                                    ListItem liAccType = new ListItem();
                                    liAccType.Text = GetDealerData.Tables[0].Rows[0]["AccountTypeName"].ToString();
                                    liAccType.Value = GetDealerData.Tables[0].Rows[0]["bankAccountType"].ToString();
                                    ddlAccType.SelectedIndex = ddlAccType.Items.IndexOf(liAccType);

                                    //ListItem liCheckType = new ListItem();
                                    //liCheckType.Text = Cardetais.Tables[0].Rows[0]["CheckTypeName"].ToString();
                                    //liCheckType.Value = Cardetais.Tables[0].Rows[0]["CheckTypeID"].ToString();
                                    //ddlCheckType.SelectedIndex = ddlCheckType.Items.IndexOf(liCheckType);
                                    //txtCheckNumber.Text = Cardetais.Tables[0].Rows[0]["BankCheckNumber"].ToString();
                                    if ((GetDealerData.Tables[0].Rows[0]["pmntStatus"].ToString() == "1") || (GetDealerData.Tables[0].Rows[0]["pmntStatus"].ToString() == "7"))
                                    {
                                        txtCustNameForCheck.Enabled = false;
                                        txtAccNumberForCheck.Enabled = false;
                                        txtBankNameForCheck.Enabled = false;
                                        txtRoutingNumberForCheck.Enabled = false;
                                        ddlAccType.Enabled = false;
                                    }
                                }
                                else if (Convert.ToInt32(GetDealerData.Tables[0].Rows[0]["pmntType"].ToString()) == 8)
                                {
                                    divcard.Style["display"] = "none";
                                    divcheck.Style["display"] = "none";
                                    divpaypal.Style["display"] = "block";
                                    txtAttentionTo.Text = objGeneralFunc.ToProper(GetDealerData.Tables[0].Rows[0]["InvoiceAttentionTo"].ToString());
                                    if (GetDealerData.Tables[0].Rows[0]["SendInvoiceID"].ToString() == "1")
                                    {
                                        rdbtnInvoiceEmail.Checked = true;
                                    }
                                    else
                                    {
                                        rdbtnInvoicePostal.Checked = true;
                                    }
                                    txtInvoiceEmail.Text = GetDealerData.Tables[0].Rows[0]["SendInvoiceEmail"].ToString();
                                    txtInvoiceBillingname.Text = objGeneralFunc.ToProper(GetDealerData.Tables[0].Rows[0]["billingName"].ToString());
                                    tyxtInvoiceAddress.Text = objGeneralFunc.ToProper(GetDealerData.Tables[0].Rows[0]["billingAdd"].ToString());
                                    txtInvoiceCity.Text = objGeneralFunc.ToProper(GetDealerData.Tables[0].Rows[0]["billingCity"].ToString());
                                    //txtInvoiceState.Text =
                                    //ddlInvoiceState.SelectedItem.Text = GetDealerData.Tables[0].Rows[0]["billingState"].ToString();
                                    ListItem liBillingSt = new ListItem();
                                    liBillingSt.Text = GetDealerData.Tables[0].Rows[0]["BillingStateName"].ToString();
                                    liBillingSt.Value = GetDealerData.Tables[0].Rows[0]["billingState"].ToString();
                                    ddlInvoiceState.SelectedIndex = ddlInvoiceState.Items.IndexOf(liBillingSt);
                                    txtInvoiceZip.Text = GetDealerData.Tables[0].Rows[0]["billingZip"].ToString();
                                    if ((GetDealerData.Tables[0].Rows[0]["pmntStatus"].ToString() == "1") || (GetDealerData.Tables[0].Rows[0]["pmntStatus"].ToString() == "7") || (GetDealerData.Tables[0].Rows[0]["SmartzStatus"].ToString() == "1"))
                                    {
                                        txtAttentionTo.Enabled = false;
                                        rdbtnInvoiceEmail.Enabled = false;
                                        rdbtnInvoicePostal.Enabled = false;
                                        txtInvoiceEmail.Enabled = false;
                                        txtInvoiceBillingname.Enabled = false;
                                        tyxtInvoiceAddress.Enabled = false;
                                        txtInvoiceCity.Enabled = false;
                                        ddlInvoiceState.Enabled = false;
                                        txtInvoiceZip.Enabled = false;
                                    }
                                }
                                else
                                {
                                    divcard.Style["display"] = "block";
                                    divcheck.Style["display"] = "none";
                                    divpaypal.Style["display"] = "none";
                                    txtCardholderName.Text = objGeneralFunc.ToProper(GetDealerData.Tables[0].Rows[0]["cardholderName"].ToString());
                                    txtCardholderLastName.Text = objGeneralFunc.ToProper(GetDealerData.Tables[0].Rows[0]["cardholderLastName"].ToString());
                                    CardNumber.Text = GetDealerData.Tables[0].Rows[0]["cardNumber"].ToString();
                                    string EXpDate = GetDealerData.Tables[0].Rows[0]["cardExpDt"].ToString();
                                    string[] EXpDt = EXpDate.Split(new char[] { '/' });

                                    //txtExpMon.Text = EXpDt[0].ToString();
                                    ListItem liExpMonth = new ListItem();
                                    liExpMonth.Text = EXpDt[0].ToString();
                                    liExpMonth.Value = EXpDt[0].ToString();
                                    ExpMon.SelectedIndex = ExpMon.Items.IndexOf(liExpMonth);

                                    ListItem liExpYear = new ListItem();
                                    liExpYear.Text = "20" + EXpDt[1].ToString();
                                    liExpYear.Value = EXpDt[1].ToString();
                                    CCExpiresYear.SelectedIndex = CCExpiresYear.Items.IndexOf(liExpYear);

                                    // txtCCExpiresYear.Text = "20" + EXpDt[1].ToString();
                                    cvv.Text = GetDealerData.Tables[0].Rows[0]["cardCode"].ToString();

                                    txtbillingaddress.Text = objGeneralFunc.ToProper(GetDealerData.Tables[0].Rows[0]["billingAdd"].ToString());
                                    txtbillingcity.Text = objGeneralFunc.ToProper(GetDealerData.Tables[0].Rows[0]["billingCity"].ToString());
                                    //ddlbillingstate.SelectedItem.Text = GetDealerData.Tables[0].Rows[0]["State_Code"].ToString();
                                    ListItem liBillingSt = new ListItem();
                                    liBillingSt.Text = GetDealerData.Tables[0].Rows[0]["BillingStateName"].ToString();
                                    liBillingSt.Value = GetDealerData.Tables[0].Rows[0]["billingState"].ToString();
                                    ddlbillingstate.SelectedIndex = ddlbillingstate.Items.IndexOf(liBillingSt);

                                    txtbillingzip.Text = GetDealerData.Tables[0].Rows[0]["billingZip"].ToString();
                                    if ((GetDealerData.Tables[0].Rows[0]["pmntStatus"].ToString() == "1") || (GetDealerData.Tables[0].Rows[0]["pmntStatus"].ToString() == "7"))
                                    {
                                        txtCardholderName.Enabled = false;
                                        txtCardholderLastName.Enabled = false;
                                        CardNumber.Enabled = false;
                                        ExpMon.Enabled = false;
                                        CCExpiresYear.Enabled = false;
                                        cvv.Enabled = false;
                                        txtbillingaddress.Enabled = false;
                                        txtbillingcity.Enabled = false;
                                        ddlbillingstate.Enabled = false;
                                        txtbillingzip.Enabled = false;
                                    }
                                }
                                txtPDAmountNow.Text = GetDealerData.Tables[0].Rows[0]["Amount"].ToString();
                                txtVoicefileConfirmNo.Text = GetDealerData.Tables[0].Rows[0]["VoiceRecord"].ToString();
                                ListItem liVoiceLoc = new ListItem();
                                liVoiceLoc.Text = GetDealerData.Tables[0].Rows[0]["VoiceFileLocationName"].ToString();
                                liVoiceLoc.Value = GetDealerData.Tables[0].Rows[0]["VoiceFileLocation"].ToString();
                                ddlVoiceFileLocation.SelectedIndex = ddlVoiceFileLocation.Items.IndexOf(liVoiceLoc);

                                if (GetDealerData.Tables[0].Rows[0]["SchedulePaymentDate"].ToString() != "")
                                {
                                    //ListItem liPaydate = new ListItem();
                                    //liPaydate.Text = GetDealerData.Tables[0].Rows[0]["SchedulePaymentDate"].ToString();
                                    //liPaydate.Value = GetDealerData.Tables[0].Rows[0]["SchedulePaymentDate"].ToString();
                                    //ddlPaymentDate.SelectedIndex = ddlPaymentDate.Items.IndexOf(liPaydate);

                                    DateTime PayDate = Convert.ToDateTime(GetDealerData.Tables[0].Rows[0]["SchedulePaymentDate"].ToString());
                                    DateTime dtNow = Convert.ToDateTime(dsDatetime.Tables[0].Rows[0]["Datetime"].ToString());
                                    if (Convert.ToDateTime(PayDate.ToString("MM/dd/yyyy")) < Convert.ToDateTime(dtNow.ToString("MM/dd/yyyy")))
                                    {
                                        ddlPaymentDate.SelectedItem.Text = PayDate.ToString("MM/dd/yyyy");
                                        ddlPaymentDate.SelectedItem.Value = PayDate.ToString("MM/dd/yyyy");
                                    }
                                }
                                if (GetDealerData.Tables[0].Rows[0]["ContractSignDate"].ToString() != "")
                                {
                                    ListItem liContractDate = new ListItem();
                                    liContractDate.Text = GetDealerData.Tables[0].Rows[0]["ContractSignDate"].ToString();
                                    liContractDate.Value = GetDealerData.Tables[0].Rows[0]["ContractSignDate"].ToString();
                                    ddlContractDate.SelectedIndex = ddlContractDate.Items.IndexOf(liContractDate);
                                }
                                ListItem liContractStatus = new ListItem();
                                liContractStatus.Text = GetDealerData.Tables[0].Rows[0]["ContractSignStatusName"].ToString();
                                liContractStatus.Value = GetDealerData.Tables[0].Rows[0]["ContractSignStatusID"].ToString();
                                ddlContractStatus.SelectedIndex = ddlContractStatus.Items.IndexOf(liContractStatus);

                                if (GetDealerData.Tables[1].Rows.Count > 0)
                                {
                                    for (int i = 0; i < GetDealerData.Tables[1].Rows.Count; i++)
                                    {
                                        if (GetDealerData.Tables[1].Rows[i]["ProductOptionName"].ToString() == "Website")
                                        {
                                            if (GetDealerData.Tables[1].Rows[i]["ProductOptionStatus"].ToString() == "True")
                                            {
                                                rdbtnWebsiteYes.Checked = true;
                                            }
                                            else
                                            {
                                                rdbtnWebsiteNo.Checked = true;
                                            }
                                            txtPreferredAddress.Text = GetDealerData.Tables[1].Rows[i]["ProductOptionNotes"].ToString();
                                        }
                                        else if (GetDealerData.Tables[1].Rows[i]["ProductOptionName"].ToString() == "Cars promotion")
                                        {
                                            if (GetDealerData.Tables[1].Rows[i]["ProductOptionStatus"].ToString() == "True")
                                            {
                                                rdbtnCarsPromotionYes.Checked = true;
                                            }
                                            else
                                            {
                                                rdbtnCarsPromotionNo.Checked = true;
                                            }
                                            txtGetCarsFrom.Text = GetDealerData.Tables[1].Rows[i]["ProductOptionNotes"].ToString();
                                        }
                                        else if (GetDealerData.Tables[1].Rows[i]["ProductOptionName"].ToString() == "Leads")
                                        {
                                            if (GetDealerData.Tables[1].Rows[i]["ProductOptionStatus"].ToString() == "True")
                                            {
                                                rdbtnLeadsYes.Checked = true;
                                            }
                                            else
                                            {
                                                rdbtnLeadsNo.Checked = true;
                                            }
                                            txtLeadsToSend.Text = GetDealerData.Tables[1].Rows[i]["ProductOptionNotes"].ToString();
                                        }
                                        else if (GetDealerData.Tables[1].Rows[i]["ProductOptionName"].ToString() == "Other")
                                        {
                                            if (GetDealerData.Tables[1].Rows[i]["ProductOptionStatus"].ToString() == "True")
                                            {
                                                rdbtnOthersYes.Checked = true;
                                            }
                                            else
                                            {
                                                rdbtnOthersNo.Checked = true;
                                            }
                                            txtOthersNotes.Text = GetDealerData.Tables[1].Rows[i]["ProductOptionNotes"].ToString();
                                        }
                                    }
                                }
                            }
                            else
                            {
                                FillSurveyQuestions();
                            }
                        }

                    }

                }
            }
        }
    }
 protected override void OnInit(EventArgs e)
 {
     //
     // CODEGEN: This call is required by the ASP.NET Web Form Designer.
     //
     InitializeComponent();
     base.OnInit(e);
     ScriptManager mgrAjax = Page.Master.FindControl("mgrAjax") as ScriptManager;
     if ( mgrAjax != null )
     {
         ServiceReference svc = new ServiceReference("~/Products/ProductCatalog/AutoComplete.asmx");
         ScriptReference  scr = new ScriptReference ("~/Products/ProductCatalog/AutoComplete.js"  );
         mgrAjax.Services.Add(svc);
         mgrAjax.Scripts .Add(scr);
     }
 }