Beispiel #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            int plotId = 0;

            if ((Request.QueryString["plotId"] != "") && (Request.QueryString["plotId"] != null))
            {
                int.TryParse(Request.QueryString["plotId"], out plotId);
            }

            if (plotId == 0)
            {
                Response.Redirect("~/Members/ArchivedPlotList.aspx");
            }

            PlotIdHiddenField.Value = plotId.ToString();

            try
            {
                // Get the common web service instance.
                ServiceAccess           serviceLoader = ServiceAccess.GetInstance();
                FarmService.FarmService farmService   = serviceLoader.GetFarm();

                int userId = farmService.GetUserIdForPlot(plotId);
                UserIdHiddenField.Value = userId.ToString();

                if (!IsAgentRole)
                {
                    ForAgentPanel.Visible           = true;
                    ForAgentUserIdHiddenField.Value = userId.ToString();
                    ForAgentUserNameLabel.Text      = farmService.GetUserName(userId);
                }
                else
                {
                    ForAgentPanel.Visible = false;
                }

                //Getting Archived Plot Header Details
                FarmService.PlotInfo plot = farmService.GetArchivedPlotSummaryDetails(plotId);

                //Getting Parent Farm Details
                FarmService.FarmInfo farm = farmService.GetArchivedFarmSummaryDetails(plot.FarmId);

                PlotNameLabel.Text      = farm.FarmName + " / " + plot.PlotName;
                ContactCountLabel.Text  = plot.ContactCount.ToString();
                CreateDateLabel.Text    = plot.CreateDate.ToShortDateString();
                FarmIdHiddenField.Value = plot.FarmId.ToString();

                FarmService.ContactInfo[] contacts = farmService.GetArchivedContactListForPlot(plotId);
                ContactListGridView.DataSource = contacts;
                ContactListGridView.DataBind();
            }
            catch (Exception exception)
            {
                log.Error("UNKNOWN ERROR LOADING ARCHIVE CONTACT LIST:", exception);
                MessageLiteral.Text = "UNKNOWN ERROR: Please Contact Administrator";
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            int plotId = 0;

            if ((Request.QueryString["plotId"] != "") && (Request.QueryString["plotId"] != null))
            {
                int.TryParse(Request.QueryString["plotId"], out plotId);
            }

            if (plotId == 0)
            {
                Response.Redirect("~/Members/FarmManagement.aspx");
            }

            // Get the common web service instance.
            try
            {
                ServiceAccess           serviceLoader = ServiceAccess.GetInstance();
                FarmService.FarmService farmService   = serviceLoader.GetFarm();

                int userId = farmService.GetUserIdForPlot(plotId);
                UserIdHiddenField.Value = userId.ToString();
                if (!IsAgentRole)
                {
                    ForAgentLiteral.Visible = true;
                    RegistrationService.RegistrationService regservice = serviceLoader.GetRegistration();
                    RegistrationService.RegistrationInfo    regInfo    = regservice.GetDetails(userId);
                    ForAgentLiteral.Text            = "Selected Agent: " + regInfo.UserName + " / " + regInfo.FirstName + " " + regInfo.LastName + " ";
                    ForAgentUserIdHiddenField.Value = userId.ToString();
                }
                else
                {
                    ForAgentLiteral.Visible = false;
                }

                FarmService.PlotInfo plot = farmService.GetPlotDetail(plotId);
                PlotNameLabel.Text     = plot.PlotName;
                ContactCountLabel.Text = plot.ContactCount.ToString();
                CreateDateLabel.Text   = plot.CreateDate.ToShortDateString();

                PlotIdHiddenField.Value = plotId.ToString();
            }
            catch (Exception exception)
            {
                log.Error("UNKNOWN ERROR:", exception);
            }
        }
    }
Beispiel #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (IsPrinterRole)
            {
                MoveToButton.Enabled        = false;
                DeleteContactButton.Enabled = false;
                DeletePlotButton.Enabled    = false;
                AddContactButton.Enabled    = false;
                EditPlotButton.Enabled      = false;
            }
            int plotId = 0;

            if ((Request.QueryString["plotId"] != "") && (Request.QueryString["plotId"] != null))
            {
                int.TryParse(Request.QueryString["plotId"], out plotId);
            }

            if (plotId == 0)
            {
                Response.Redirect("~/Members/FarmManagement.aspx");
            }

            ExportToExcelButton.CausesValidation = false;
            ExportToExcelButton.OnClientClick    = "javascript: window.open('./ExcelOrCsvFileDownload.aspx?plotId=" + plotId.ToString() + "');";
            PlotIdHiddenField.Value = plotId.ToString();

            try
            {
                // Get the common web service instance.
                ServiceAccess           serviceLoader = ServiceAccess.GetInstance();
                FarmService.FarmService farmService   = serviceLoader.GetFarm();
                int userId = farmService.GetUserIdForPlot(plotId);
                UserIdHiddenField.Value = userId.ToString();
                if (!IsAgentRole)
                {
                    ForAgentLiteral.Visible = true;
                    RegistrationService.RegistrationService regservice = serviceLoader.GetRegistration();
                    RegistrationService.RegistrationInfo    regInfo    = regservice.GetDetails(userId);
                    ForAgentLiteral.Text            = "Selected Agent: " + regInfo.UserName + " / " + regInfo.FirstName + " " + regInfo.LastName + " ";
                    ForAgentUserIdHiddenField.Value = userId.ToString();
                }
                else
                {
                    ForAgentLiteral.Visible = false;
                }
                FarmService.PlotInfo plot = farmService.GetPlotDetail(plotId);
                PlotNameLabel.Text             = plot.PlotName;
                ContactCountLabel.Text         = plot.ContactCount.ToString();
                CreateDateLabel.Text           = plot.CreateDate.ToShortDateString();
                FarmIdHiddenField.Value        = plot.FarmId.ToString();
                ContactListGridView.DataSource = plot.Contacts;
                ContactListGridView.DataBind();

                //Default Plot flag for validation in Javascript
                if (farmService.IsDefaultPlot(plotId))
                {
                    DefaultPlotFlagHiddenField.Value = "true";
                }
                else
                {
                    DefaultPlotFlagHiddenField.Value = "false";
                }

                //Validation related Data stored in Hidden Field
                if (farmService.IsDefaultPlot(plot.PlotId))
                {
                    DefaultContactHiddenField.Value = "true";
                    MoveToButton.Enabled            = true;

                    //Move to for single contact in a default plot disabled

                    /*if (plot.Contacts.Length < 2)
                     *  MoveToButton.Enabled = false;
                     * else
                     *  MoveToButton.Enabled = true;*/
                }
                else
                {
                    DefaultContactHiddenField.Value = "false";
                    MoveToButton.Enabled            = true;
                }

                ContactCountHiddenField.Value = plot.Contacts.Length.ToString();

                //For Single Contact in Default Plot
                if (IsPrinterRole)
                {
                    for (int i = 0; i < plot.Contacts.Length; i++)
                    {
                        ContactListGridView.Rows[i].Cells[0].FindControl("EditContactHyperLink").Visible = false;
                        ContactListGridView.Rows[i].Cells[0].FindControl("ContactIdCheckBox").Visible    = false;
                    }
                }
            }
            catch (Exception exception)
            {
                log.Error("UNKNOWN ERROR:", exception);
            }
        }
    }
Beispiel #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            int plotId = 100107;

            //if ((Request.QueryString["plotId"] != "") && (Request.QueryString["plotId"] != null))
            //    int.TryParse(Request.QueryString["plotId"], out plotId);

            //if (plotId == 0)
            //    Response.Redirect("~/Members/FarmManagement.aspx");

            PlotIdHiddenField.Value = plotId.ToString();

            try
            {
                // Get the common web service instance.

                ServiceAccess           serviceLoader = ServiceAccess.GetInstance();
                FarmService.FarmService farmService   = serviceLoader.GetFarm();
                int userId = farmService.GetUserIdForPlot(plotId);
                UserIdHiddenField.Value = userId.ToString();
                if (!IsAgentRole)
                {
                    ForAgentLiteral.Visible = true;
                    RegistrationService.RegistrationService regservice = serviceLoader.GetRegistration();
                    RegistrationService.RegistrationInfo    regInfo    = regservice.GetDetails(userId);
                    ForAgentLiteral.Text            = "Selected Agent: " + regInfo.UserName + " / " + regInfo.FirstName + " " + regInfo.LastName + "&nbsp;";
                    ForAgentUserIdHiddenField.Value = userId.ToString();
                }
                else
                {
                    ForAgentLiteral.Visible = false;
                }
                FarmService.PlotInfo plot = farmService.GetPlotDetail(plotId);
                FarmIdHiddenField.Value        = plot.FarmId.ToString();
                ContactListGridView.DataSource = plot.Contacts;
                ContactListGridView.DataBind();

                //Block Edit Course for the Printer

                /*
                 * if (IsPrinterRole)
                 * {
                 *  ContactListGridView.Columns.RemoveAt(0);
                 *  ContactListGridView.Columns.RemoveAt(1);
                 *
                 *  for (int i = 0; i < plot.Contacts.Length; i++)
                 *  {
                 *      ContactListGridView.Rows[i].Cells[0].FindControl("EditContactHyperLink").Visible = false;
                 *      ContactListGridView.Rows[i].Cells[0].FindControl("ContactIdCheckBox").Visible = false;
                 *  }
                 * }
                 */
            }
            catch (Exception exception)
            {
                log.Error("UNKNOWN ERROR:", exception);
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Int64 contactId = 0;
            if ((Request.QueryString["contactId"] != "") && (Request.QueryString["contactId"] != null))
            {
                Int64.TryParse(Request.QueryString["contactId"], out contactId);
            }

            if (contactId == 0)
            {
                Response.Redirect("~/Members/FarmManagement.aspx");
            }

            if ((Request.QueryString["parentPage"] != "") && (Request.QueryString["parentPage"] != null))
            {
                ParentPageHiddenField.Value = Request.QueryString["parentPage"];
            }
            else
            {
                ParentPageHiddenField.Value = "";
            }

            try
            {
                // Get the common web service instance.

                ServiceAccess           serviceLoader = ServiceAccess.GetInstance();
                FarmService.FarmService farmService   = serviceLoader.GetFarm();

                FarmService.ContactInfo contact = farmService.GetContactDetails(contactId);

                int userId = farmService.GetUserIdForPlot(contact.PlotId);
                UserIdHiddenField.Value = userId.ToString();
                if (!IsAgentRole)
                {
                    ForAgentLiteral.Visible = true;
                    RegistrationService.RegistrationService regservice = serviceLoader.GetRegistration();
                    RegistrationService.RegistrationInfo    regInfo    = regservice.GetDetails(userId);
                    ForAgentLiteral.Text            = "Selected Agent: " + regInfo.UserName + " / " + regInfo.FirstName + " " + regInfo.LastName + "&nbsp;";
                    ForAgentUserIdHiddenField.Value = userId.ToString();
                }
                else
                {
                    ForAgentLiteral.Visible = false;
                }
                ContactIdLabel.Text          = contact.ContactId.ToString();
                ScheduleNumberTextBox.Text   = contact.ScheduleNumber.ToString();
                OwnerFullNameTextBox.Text    = contact.OwnerFullName;
                LotTextBox.Text              = contact.Lot.ToString();
                BlockTextBox.Text            = contact.Block;
                SubDivisionTextBox.Text      = contact.Subdivision;
                FilingTextBox.Text           = contact.Filing;
                SiteAddressTextBox.Text      = contact.SiteAddress;
                BedroomsTextBox.Text         = contact.Bedrooms.ToString();
                FullBathTextBox.Text         = contact.FullBath.ToString();
                ThreeQuarterBathTextBox.Text = contact.ThreeQuarterBath.ToString();
                HalfBathTextBox.Text         = contact.HalfBath.ToString();
                AcresTextBox.Text            = contact.Acres.ToString();
                ActMktCombTextBox.Text       = contact.ActMktComb;
                OwnerFirstNameTextBox.Text   = contact.OwnerFirstName;
                OwnerLastNameTextBox.Text    = contact.OwnerLastName;
                OwnerAddress1TextBox.Text    = contact.OwnerAddress1;
                OwnerAddress2TextBox.Text    = contact.OwnerAddress2;
                OwnerCityTextBox.Text        = contact.OwnerCity;
                OwnerStateTextBox.Text       = contact.OwnerState;
                OwnerZipTextBox.Text         = contact.OwnerZip;
                OwnerCountryTextBox.Text     = contact.OwnerCountry;
                SaleDateTextBox.Text         = contact.SaleDate.ToShortDateString();
                TransAmountTextBox.Text      = contact.TransAmount.ToString();
                PlotIdHiddenField.Value      = contact.PlotId.ToString();

                FarmService.PlotInfo plot = farmService.GetPlotDetail(Convert.ToInt32(PlotIdHiddenField.Value));
                PlotNameLabel.Text     = plot.PlotName;
                ContactCountLabel.Text = plot.ContactCount.ToString();
                CreateDateLabel.Text   = plot.CreateDate.ToShortDateString();
            }
            catch (Exception exception)
            {
                log.Error("UNKNOWN ERROR:", exception);
            }
        }
    }