Beispiel #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            MLS myMLS = new MLS();

            dlFeaturedListings.DataSource = myMLS.getFeaturedListings("edit");
            dlFeaturedListings.DataBind();


            //List<Listing> lListing = null;
            //if (Request.QueryString["type_id"] != null)
            //{
            //    lListing = myMLS.getListingsByTypeID(Convert.ToInt32(Request.QueryString["type_id"].ToString()),"edit");
            //}
            //else
            //{
            //    lListing = myMLS.getFeaturedListingsToAdmin();
            //}
            //ListingCollection lc = myMLS.getRents("edit");
            //gvRents.DataSource = lListing;
            //gvRents.Columns[3].HeaderStyle.CssClass = "neutral";
            //gvRents.DataBind();
            this.Master.Change_Nav("Admin");
        }
    }
Beispiel #2
0
    protected void gvRents_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        GridViewRow row          = (GridViewRow)(((ImageButton)e.CommandSource).NamingContainer);
        HiddenField hfListingID  = (HiddenField)row.FindControl("hfListingID");
        string      strListingID = hfListingID.Value;
        //if (e.CommandName.ToString() == "Down")
        //{
        MLS myMLS = new MLS();

        //ListingCollection lc = myMLS.getRents("edit");
        List <Listing> lListing = null;

        if (Request.QueryString["type_id"] != null)
        {
            myMLS.SwapSort(Convert.ToInt32(strListingID), Convert.ToInt32(e.CommandArgument.ToString()), Convert.ToInt32(Request.QueryString["type_id"].ToString()));
            lListing = myMLS.getListingsByTypeID(Convert.ToInt32(Request.QueryString["type_id"].ToString()), "edit");
        }
        else//Featured
        {
            myMLS.SwapFeaturedSort(Convert.ToInt32(strListingID), Convert.ToInt32(e.CommandArgument.ToString()), "featured");
            lListing = myMLS.getFeaturedListingsToAdmin();
        }
        gvRents.DataSource = lListing;
        gvRents.Columns[3].HeaderStyle.CssClass = "neutral";
        gvRents.DataBind();
        //Response.Write("From:" + strListingID + "<br/>");
        //Response.Write("To:" + e.CommandArgument.ToString() + "<br/>");

        //}
        //else if (e.CommandName.ToString() == "Up")
        //{
        //}
        //Response.Write(e.CommandName.ToString());
        //Response.Write(e.CommandArgument.ToString());
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        MLS myMLS            = new MLS();
        ListingCollection lc = myMLS.getRents("edit");

        gvRents.DataSource = lc;
        gvRents.Columns[3].HeaderStyle.CssClass = "neutral";
        gvRents.DataBind();
        this.Master.Change_Nav("Admin");
    }
Beispiel #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        MLS     mls = new MLS();
        Listing l   = mls.getListingByID(Convert.ToInt32(Request.QueryString["id"].ToString()));

        if (l.selling_point != null)
        {
            ltSellingPoint.Text = l.selling_point;
        }
        ltImageGallery.Text = l.image_gallery;

        if (Request.QueryString["type_id"] == "100")
        {
            ltPrice.Text = l.price;
        }
        else if (Request.QueryString["type_id"] == "200")
        {
            ltPrice.Text = l.rent + "/month";
        }

        ltBed.Text  = l.bed.ToString();
        ltBath.Text = l.bath.ToString();
        if (l.style != null)
        {
            ltStyle.Text = l.style.ToString();
        }

        if (l.city != null)
        {
            ltCity.Text = l.city;
        }

        if (l.description != null)
        {
            ltDescription.Text = l.description;
        }

        if (l.status == 0)
        {
            imgStatus.ImageUrl = "/images/sale.png";
        }
        else if (l.status == 1)
        {
            imgStatus.ImageUrl = "/images/undercontract_large.png";
        }
        else if (l.status == 2)
        {
            imgStatus.ImageUrl = "/images/sold_large.png";
        }
        else if (l.status == 3)
        {
            imgStatus.ImageUrl = "/images/leased_large.png";
        }
    }
Beispiel #5
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            ds_mainTableAdapters.listingTableAdapter listingTA = new ds_mainTableAdapters.listingTableAdapter();
            ds_main.listingDataTable listingDT = new ds_main.listingDataTable();
            ds_main.listingRow       listingR  = listingDT.NewlistingRow();

            listingR["listing_id"]    = tbListingID.Text;
            listingR["num_of_images"] = tbNumOfImages.Text;
            //listingR["ts"] = tbTimeStamp.Text;
            //listingR["path"] = tbPath.Text;
            listingDT.Rows.Add(listingR);

            listingTA.Update(listingDT);

            if (cbSale.Checked)
            {
                ds_mainTableAdapters.x_listing_typeTableAdapter x_listing_typeTA = new ds_mainTableAdapters.x_listing_typeTableAdapter();
                ds_main.x_listing_typeDataTable x_listing_typeDT = new ds_main.x_listing_typeDataTable();
                ds_main.x_listing_typeRow       x_listing_typeR  = x_listing_typeDT.Newx_listing_typeRow();
                x_listing_typeR.listing_id = Convert.ToInt32(tbListingID.Text);
                x_listing_typeR.type_id    = 100;
                x_listing_typeR.sort       = MLS.getMaxSortByTypeID(100) + 1;
                x_listing_typeDT.Rows.Add(x_listing_typeR);
                x_listing_typeTA.Update(x_listing_typeDT);
            }

            if (cbRental.Checked)
            {
                ds_mainTableAdapters.x_listing_typeTableAdapter x_listing_typeTA = new ds_mainTableAdapters.x_listing_typeTableAdapter();
                ds_main.x_listing_typeDataTable x_listing_typeDT = new ds_main.x_listing_typeDataTable();
                ds_main.x_listing_typeRow       x_listing_typeR  = x_listing_typeDT.Newx_listing_typeRow();
                x_listing_typeR.listing_id = Convert.ToInt32(tbListingID.Text);
                x_listing_typeR.type_id    = 200;
                x_listing_typeR.sort       = MLS.getMaxSortByTypeID(200) + 1;
                x_listing_typeDT.Rows.Add(x_listing_typeR);
                x_listing_typeTA.Update(x_listing_typeDT);
            }

            if (cbSale.Checked)
            {
                Response.Redirect("./listings.aspx?type_id=100");
            }
            else if (cbRental.Checked)
            {
                Response.Redirect("./listings.aspx?type_id=200");
            }
        }
    }
Beispiel #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        MLS mls = new MLS();

        dlFeaturedListings.DataSource = mls.getFeaturedListings("listing");
        dlFeaturedListings.DataBind();

        if (Request.UrlReferrer != null)
        {
            referral = Request.UrlReferrer.ToString();
        }

        //ltrFeatures.Text = "<h1>"+sbCode.ToString()+"</h1>";
    }
Beispiel #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        MLS myMLS = new MLS();

        //ListingCollection lc = myMLS.getRents("listing");
        //gvRents.DataSource = lc;
        if (Request.QueryString["type_id"] != null)
        {
            gvRents.DataSource = myMLS.getListingsByTypeID(Convert.ToInt32(Request.QueryString["type_id"].ToString()), "listing").FindAll(a => a.city != null && a.price != null);
            //gvRents.DataSource = myMLS.getListingsByTypeID(Convert.ToInt32(Request.QueryString["type_id"].ToString()), "listing");
            gvRents.Columns[3].HeaderStyle.CssClass = "neutral";
            gvRents.DataBind();
        }
    }
Beispiel #8
0
        //***********************************************************************************
        static public void TEST_MLS()
        {
            Profiler profiler = new Profiler();

            profiler.Setup(true, 0, "Test");

            //warmup
            MLS   wmls   = new MLS();
            XwMLS wxwmls = new XwMLS();

            profiler.Start("NEW");
            for (long i = 0; i < 50000; i++)
            {
                XwMLS  mls  = new XwMLS("[PT-PT]String de Teste #[/PT-PT][EN-GB]Test String #[/EN-GB][FR-FR]chaîne de test #[/FR-FR][ES-ES]cadena de prueba #[/ES-ES]");
                string PTPT = mls.GetTranslation("PT-PT");
                string ENGB = mls.GetTranslation("EN-GB");
                string FRFR = mls.GetTranslation("FR-FR");
                string ESES = mls.GetTranslation("ES-ES");
                mls.SetTranslation("PT-PT", PTPT.Replace("#", i.ToString()));
                mls.SetTranslation("EN-GB", PTPT.Replace("#", i.ToString()));
                mls.SetTranslation("FR-FR", PTPT.Replace("#", i.ToString()));
                mls.SetTranslation("ES-ES", PTPT.Replace("#", i.ToString()));
                string s = mls;
            }
            profiler.Stop("NEW");


            profiler.Start("OLD");
            for (long i = 0; i < 50000; i++)
            {
                MLS    mls  = new MLS("[PT-PT]String de Teste #[/PT-PT][EN-GB]Test String #[/EN-GB][FR-FR]chaîne de test #[/FR-FR][ES-ES]cadena de prueba #[/ES-ES]");
                string PTPT = mls.GetTranslation("PT-PT");
                string ENGB = mls.GetTranslation("EN-GB");
                string FRFR = mls.GetTranslation("FR-FR");
                string ESES = mls.GetTranslation("ES-ES");
                mls.SetTranslation("PT-PT", PTPT.Replace("#", i.ToString()));
                mls.SetTranslation("EN-GB", PTPT.Replace("#", i.ToString()));
                mls.SetTranslation("FR-FR", PTPT.Replace("#", i.ToString()));
                mls.SetTranslation("ES-ES", PTPT.Replace("#", i.ToString()));
                string s = mls;
            }
            profiler.Stop("OLD");


            Console.Write(profiler.Print());
        }
        /// <summary>
        /// Sets the thermostat fan mode then checks to see if it was set properly.
        /// </summary>
        /// <param name="newMode"></param>
        private void setAndValidateThermostatFanMode(int thermostatShortId, MLS.HA.DeviceController.Common.ThermoFanMode newMode)
        {
            // Get the device associated with the thermostat
            var thermostatDevice = getNodeByShortId(thermostatShortId) as MLS.HA.DeviceController.Common.Device.ZWave.Thermostat;

            if (thermostatDevice != null) {
                // Set the thermostat fan mode to auto
                dm.setZWaveThermostatFanMode(thermostatDevice.deviceId, newMode);

                // Force poll the thermostat to see if the value stuck
                dm.pollDevice(thermostatDevice.deviceId);

                // This is a delay to wait for the thermostat to respond back to the poll attempt
                System.Threading.Thread.Sleep(6000);

                // Grab a fresh copy of the device
                thermostatDevice = getNodeByShortId(thermostatShortId) as Thermostat;

                // Check the new thermostat fan mode
                if (thermostatDevice.thermostatFanMode == newMode) {
                    setStatus("... Success!");
                } else {
                    setStatus("... Failed!");
                }

            } else {
                // Something is wrong - perhaps the shortId is wrong?
                // Notify the user that no thermostat was found
                setStatus("No thermostat with a short Id of " + thermostatShortId + " was found.");
            }
        }
Beispiel #10
0
        // GET: MLS
        public ActionResult Index(string todo = "")
        {
            string access_token = "fded13cccfd9e14b47b0fb1818c67954";            //"a57e5dfd4ce945cc52206e83bf534718";
            string msg          = "Started " + DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToShortTimeString() + "<br />";

            if (todo == "go")
            {
                Server.ScriptTimeout = 300;
                MLSManager mgr = new MLSManager();
                mgr.PreUpdate();
                MLS mls         = new MLS();
                int offset      = 0;
                int recordsRes  = 0;
                int recordsLand = 0;
                int recordsComm = 0;
                int deleted     = 0;
                System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;

                using (HttpClient _httpClient = new HttpClient()) {
                    _httpClient.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));

                    //Residential
                    HttpResponseMessage result = _httpClient.GetAsync(new Uri("https://api.bridgedataoutput.com/api/v2/onekey/listings?access_token=" + access_token + "&limit=200&sortBy=ListingId&order=asc&CountyOrParish=Sullivan&MlsStatus=A&PropertyType=Residential")).Result;
                    if (result.IsSuccessStatusCode)
                    {
                        mls        = Newtonsoft.Json.JsonConvert.DeserializeObject <MLS>(result.Content.ReadAsStringAsync().Result);
                        recordsRes = mls.total;
                    }
                    foreach (var prop in mls.bundle)
                    {
                        mgr.SaveProp(prop);
                    }
                    while (offset < recordsRes)
                    {
                        offset += 200;
                        result  = _httpClient.GetAsync(new Uri("https://api.bridgedataoutput.com/api/v2/onekey/listings?access_token=" + access_token + "&limit=200&sortBy=ListingId&order=asc&CountyOrParish=Sullivan&MlsStatus=A&offset=" + offset.ToString() + "&PropertyType=Residential")).Result;
                        if (result.IsSuccessStatusCode)
                        {
                            mls = Newtonsoft.Json.JsonConvert.DeserializeObject <MLS>(result.Content.ReadAsStringAsync().Result);
                        }
                        foreach (var prop in mls.bundle)
                        {
                            mgr.SaveProp(prop);
                        }
                    }

                    //Land
                    offset = 0;
                    result = _httpClient.GetAsync(new Uri("https://api.bridgedataoutput.com/api/v2/onekey/listings?access_token=" + access_token + "&limit=200&sortBy=ListingId&order=asc&CountyOrParish=Sullivan&MlsStatus=A&PropertyType=Land")).Result;
                    if (result.IsSuccessStatusCode)
                    {
                        mls         = Newtonsoft.Json.JsonConvert.DeserializeObject <MLS>(result.Content.ReadAsStringAsync().Result);
                        recordsLand = mls.total;
                    }
                    foreach (var prop in mls.bundle)
                    {
                        mgr.SaveProp(prop);
                    }
                    while (offset < recordsLand)
                    {
                        offset += 200;
                        result  = _httpClient.GetAsync(new Uri("https://api.bridgedataoutput.com/api/v2/onekey/listings?access_token=" + access_token + "&limit=200&sortBy=ListingId&order=asc&CountyOrParish=Sullivan&MlsStatus=A&offset=" + offset.ToString() + "&PropertyType=Land")).Result;
                        if (result.IsSuccessStatusCode)
                        {
                            mls = Newtonsoft.Json.JsonConvert.DeserializeObject <MLS>(result.Content.ReadAsStringAsync().Result);
                        }
                        foreach (var prop in mls.bundle)
                        {
                            mgr.SaveProp(prop);
                        }
                    }

                    //Commercial
                    offset = 0;
                    result = _httpClient.GetAsync(new Uri("https://api.bridgedataoutput.com/api/v2/onekey/listings?access_token=" + access_token + "&limit=200&sortBy=ListingId&order=asc&CountyOrParish=Sullivan&MlsStatus=A&PropertyType=Commercial Sale")).Result;
                    if (result.IsSuccessStatusCode)
                    {
                        mls         = Newtonsoft.Json.JsonConvert.DeserializeObject <MLS>(result.Content.ReadAsStringAsync().Result);
                        recordsComm = mls.total;
                    }
                    foreach (var prop in mls.bundle)
                    {
                        mgr.SaveProp(prop);
                    }
                    while (offset < recordsComm)
                    {
                        offset += 200;
                        result  = _httpClient.GetAsync(new Uri("https://api.bridgedataoutput.com/api/v2/onekey/listings?access_token=" + access_token + "&limit=200&sortBy=ListingId&order=asc&CountyOrParish=Sullivan&MlsStatus=A&offset=" + offset.ToString() + "&PropertyType=Commercial Sale")).Result;
                        if (result.IsSuccessStatusCode)
                        {
                            mls = Newtonsoft.Json.JsonConvert.DeserializeObject <MLS>(result.Content.ReadAsStringAsync().Result);
                        }
                        foreach (var prop in mls.bundle)
                        {
                            mgr.SaveProp(prop);
                        }
                    }
                }

                deleted = mgr.PostUpdate();
                Gaiocorp.Geocoding.BingGeocoder.UpdateGeoCoding3();

                msg += recordsRes.ToString() + " residential records completed.<br />" +
                       recordsLand.ToString() + " land records completed.<br />" +
                       recordsComm.ToString() + " commercial records completed.<br />" +
                       deleted.ToString() + " deleted<br />" +
                       DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToShortTimeString();
                MailMessage mm = new MailMessage();
                mm.Body       = msg;
                mm.IsBodyHtml = true;
                mm.From       = new MailAddress("*****@*****.**");
                mm.Subject    = "Lazy Meadows Upload";
                mm.To.Add("*****@*****.**");
                SmtpClient smtp = new SmtpClient();
                smtp.Send(mm);
            }
            return(Content(msg));
        }
Beispiel #11
0
 public static void Reg(Control contr, string mls_const)
 {
     MLS.Reg(contr, mls_const);
     SpectroWizard.Log.Reg(mls_const, contr);
 }
Beispiel #12
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            ds_mainTableAdapters.listingTableAdapter listingTA = new ds_mainTableAdapters.listingTableAdapter();
            ds_main.listingDataTable listingDT = listingTA.GetDataByID(Convert.ToInt32(Request.QueryString["id"].ToString()));
            listingDT.Rows[0]["selling_point"] = tbSellingPoint.Text;
            //listingDT.Rows[0]["price"] = tbPrice.Text.Replace("$", "");
            listingDT.Rows[0]["listing_id"]    = tbListingID.Text;
            listingDT.Rows[0]["num_of_images"] = tbNumOfImages.Text;
            //listingDT.Rows[0]["ts"] = tbTimeStamp.Text;
            //listingDT.Rows[0]["path"] = tbPath.Text;
            listingDT.Rows[0]["bed"]     = tbBed.Text;
            listingDT.Rows[0]["bath"]    = tbBath.Text;
            listingDT.Rows[0]["style"]   = ddlStyle.SelectedValue;
            listingDT.Rows[0]["address"] = tbAddress.Text;
            listingDT.Rows[0]["city"]    = tbCity.Text;
            listingDT.Rows[0]["zip"]     = tbZip.Text;
            Debug.WriteLine(RTESafe(Request.Form["message"].ToString()));
            listingDT.Rows[0]["description"] = RTESafe(Request.Form["message"].ToString());
            //bool featuredUpdated = false;
            if (cbFeatured.Checked)
            {
                //if (listingDT.Rows[0]["featured"].ToString() == "")
                //{
                //    featuredUpdated = true;
                //}
                //else
                //{
                //    if (!Convert.ToBoolean(listingDT.Rows[0]["featured"].ToString()))
                //    {
                //        featuredUpdated = true;
                //    }
                //}
                listingDT.Rows[0]["featured"]      = 1;
                listingDT.Rows[0]["featured_sort"] = MLS.getMaxFeaturedSort() + 1;
            }
            else
            {
                //if (listingDT.Rows[0]["featured"].ToString() == "")
                //{
                //    featuredUpdated = false;
                //}
                //else
                //{
                //    if (Convert.ToBoolean(listingDT.Rows[0]["featured"].ToString()))
                //    {
                //        featuredUpdated = true;
                //    }
                //}
                listingDT.Rows[0]["featured"] = 0;
            }

            listingDT.Rows[0]["status"] = ddlStatus.SelectedValue;



            listingTA.Update(listingDT);

            int sort = 0;
            ds_mainTableAdapters.x_listing_typeTableAdapter x_listing_typeTA = new ds_mainTableAdapters.x_listing_typeTableAdapter();

            if (cbSale.Checked)
            {
                ds_main.x_listing_typeDataTable x_listing_typeDT = x_listing_typeTA.GetDataByListingIDTypeID(Convert.ToInt32(tbListingID.Text), 100);
                if (x_listing_typeDT.Rows.Count > 0)
                {
                    x_listing_typeDT.Rows[0]["price"] = Convert.ToDecimal(tbPrice.Text.Replace("$", ""));
                    x_listing_typeTA.Update(x_listing_typeDT);
                }
                else//Not listed as 'Sale'. So add it!
                {
                    x_listing_typeTA.InsertData(Convert.ToInt32(Request.QueryString["id"].ToString()),
                                                100,
                                                Convert.ToDecimal(tbPrice.Text.Replace("$", "")),
                                                MLS.getMaxSortByTypeID(100) + 1);
                }
            }
            else
            {
                x_listing_typeTA.DeleteXListingTypeByListingIDTypeID(Convert.ToInt32(Request.QueryString["id"].ToString()), 100);
            }

            if (cbRental.Checked)
            {
                ds_main.x_listing_typeDataTable x_listing_typeDT = x_listing_typeTA.GetDataByListingIDTypeID(Convert.ToInt32(tbListingID.Text), 200);
                if (x_listing_typeDT.Rows.Count > 0)
                {
                    x_listing_typeDT.Rows[0]["price"] = Convert.ToDecimal(tbRent.Text.Replace("$", ""));
                    x_listing_typeTA.Update(x_listing_typeDT);
                }
                else//Not listed as 'Rental'. So add it!
                {
                    x_listing_typeTA.InsertData(Convert.ToInt32(Request.QueryString["id"].ToString()),
                                                200,
                                                Convert.ToDecimal(tbRent.Text.Replace("$", "")),
                                                MLS.getMaxSortByTypeID(200) + 1);
                }
            }
            else
            {
                x_listing_typeTA.DeleteXListingTypeByListingIDTypeID(Convert.ToInt32(Request.QueryString["id"].ToString()), 200);
            }

            MLS.InsertModifiedDate();


            //ds_main.x_listing_typeDataTable x_listing_typeDT = x_listing_typeTA.GetDataByListingID(Convert.ToInt32(tbListingID.Text));
            //if (x_listing_typeDT.Rows.Count > 0)
            //    sort = Convert.ToInt32(x_listing_typeDT.Rows[0]["sort"].ToString());

            //x_listing_typeTA.DeleteXListingTypeByListingID(Convert.ToInt32(Request.QueryString["id"].ToString()));

            //if (cbSale.Checked)
            //{
            //    x_listing_typeTA.InsertData(Convert.ToInt32(Request.QueryString["id"].ToString()),
            //                                100,
            //                                Convert.ToDecimal(tbPrice.Text.Replace("$", "")),
            //                                MLS.getMaxSortByTypeID(100) + 1);

            //    //ds_main.x_listing_typeDataTable x_listing_typeDT = new ds_main.x_listing_typeDataTable();
            //    //ds_main.x_listing_typeRow x_listing_TypeR = x_listing_typeDT.Newx_listing_typeRow();
            //    //x_listing_TypeR.listing_id = Convert.ToInt32(Request.QueryString["id"].ToString());
            //    //x_listing_TypeR.type_id = 100;
            //    //x_listing_TypeR.price = Convert.ToDecimal(tbPrice.Text.Replace("$", ""));
            //    //x_listing_TypeR.sort = MLS.getMaxSortByTypeID(100)+1;
            //    //x_listing_typeDT.Addx_listing_typeRow(x_listing_TypeR);
            //    //x_listing_typeTA.Update(x_listing_typeDT);
            //}

            //if (cbRental.Checked)
            //{
            //    x_listing_typeTA.InsertData(Convert.ToInt32(Request.QueryString["id"].ToString()),
            //                200,
            //                Convert.ToDecimal(tbPrice.Text.Replace("$", "")),
            //                MLS.getMaxSortByTypeID(200) + 1);

            //    //ds_main.x_listing_typeDataTable x_listing_typeDT = new ds_main.x_listing_typeDataTable();
            //    //ds_main.x_listing_typeRow x_listing_TypeR = x_listing_typeDT.Newx_listing_typeRow();
            //    //x_listing_TypeR.listing_id = Convert.ToInt32(Request.QueryString["id"].ToString());
            //    //x_listing_TypeR.type_id = 200;
            //    //x_listing_TypeR.sort = MLS.getMaxSortByTypeID(200) + 1;
            //    //x_listing_TypeR.price = Convert.ToDecimal(tbRent.Text.Replace("$", ""));
            //    //x_listing_typeDT.Addx_listing_typeRow(x_listing_TypeR);
            //    //x_listing_typeTA.Update(x_listing_typeDT);

            //}



            //ds_main.x_listing_typeDataTable x_listing_typeDT = x_listing_typeTA.GetDataByListingID(Convert.ToInt32(Request.QueryString["id"].ToString()));
            ////x_listing_typeDT.Rows[0]["price"] = "100";

            //foreach (ds_main.x_listing_typeRow r in x_listing_typeDT.Rows)
            //{
            //    if (r["type_id"].ToString() == "100")
            //    {
            //        if (cbSale.Checked)
            //        {
            //            r["price"] = tbPrice.Text.Replace("$", "");
            //        }
            //    }

            //    if (r["type_id"].ToString() == "200")
            //    {
            //        if (cbRental.Checked)
            //        {
            //            r["price"] = tbRent.Text.Replace("$", "");
            //        }
            //    }
            //}

            //x_listing_typeTA.Update(x_listing_typeDT);
            //if (featuredUpdated)
            //{
            //    Response.Redirect("./");
            //}
            //else if (cbSale.Checked)
            if (cbSale.Checked)
            {
                Response.Redirect("./listings.aspx?type_id=100&id=" + Request.QueryString["id"].ToString());
            }
            else if (cbRental.Checked)
            {
                Response.Redirect("./listings.aspx?type_id=200&id=" + Request.QueryString["id"].ToString());
            }
        }
    }
Beispiel #13
0
    public string sContent = string.Empty;//For email blaster
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            MLS     mls = new MLS();
            Listing l   = mls.getListingByID(Convert.ToInt32(Request.QueryString["id"].ToString()));
            tbSellingPoint.Text = l.selling_point;
            ltImageGallery.Text = l.image_gallery;

            tbListingID.Text   = l.listing_id.ToString();
            tbNumOfImages.Text = l.number_of_images.ToString();
            //tbTimeStamp.Text = l.ts;
            //tbPath.Text = l.path.ToString();
            tbBed.Text = l.bed.ToString();
            if (l.bath != null)
            {
                tbBath.Text = l.bath.ToString();
            }
            //tbStyle.Text = l.style;
            if (l.style != null)
            {
                ddlStyle.SelectedValue = l.style.ToString();
            }
            tbAddress.Text = l.address;
            tbCity.Text    = l.city;
            tbZip.Text     = l.zip;
            if (l.description != null)
            {
                sContent = RTESafe(l.description);
            }
            if (l.sale)
            {
                cbSale.Checked = true;
                tbPrice.Text   = l.price;
            }

            if (l.rental)
            {
                cbRental.Checked = true;
                tbRent.Text      = l.rent;
            }

            if (l.featured)
            {
                cbFeatured.Checked = true;
            }

            ddlStatus.SelectedValue = l.status.ToString();

            if (l.status == 0)
            {
                imgStatus.ImageUrl = "/images/sale.png";
            }
            else if (l.status == 1)
            {
                imgStatus.ImageUrl = "/images/undercontract_large.png";
            }
            else if (l.status == 2)
            {
                imgStatus.ImageUrl = "/images/sold_large.png";
            }
            else if (l.status == 3)
            {
                imgStatus.ImageUrl = "/images/leased_large.png";
            }
        }
        this.Master.Change_Nav("<a href=\"./\">Admin</a> :: Edit");
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     ltrLastModified.Text = MLS.GetMostRecentModifiedDate().AddHours(3).ToString();
 }
 public void executeSpecialCommand(object providerDeviceId, MLS.HA.DeviceController.Common.SpecialCommand command, object value)
 {
 }