/// <summary>
 /// name:         butSaveJSONFile_Click
 /// description:  button click method that is used to save a new Places.js file   
 /// </summary>
 protected void butSaveJSONFile_Click(object sender, EventArgs e)
 {
     DA_POI PoiDataObject = new DA_POI();
     JSON_Utils jsonUtilityObject = new JSON_Utils();
     jsonUtilityObject.SaveJSONCategoriesAsFile();
     jsonUtilityObject.SaveJSONCategoriesAndLocationsAsFile();
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            this.FillDropDown();
        }
        else
        {
            this.ChangeRecord();
            this.DisplayRecord();
        }
        this.DisplayRecord();

        ///<summary>
        ///This is the code for displaying images. It is also used to navigate to the POI_Images.aspx
        ///</summary>

        string poiID = Request.QueryString["qrypoiID"];

        DA_POI poiDAObject = new DA_POI();

        DataRow dataRowObject = poiDAObject.GetPOI(poiID);

        string imageFilename1 = Convert.ToString(dataRowObject["POI_Image1"]);
        string imageFilename2 = Convert.ToString(dataRowObject["POI_Image2"]);
        string imageFilename3 = Convert.ToString(dataRowObject["POI_Image3"]);

        //Image 1 Info
        if (imageFilename1 == "")
            imageFilename1 = "no-image.jpg";

        Trace.Warn("imageFilename1 = " + imageFilename1);

        //Display Image 1 info
        string image1WithPath = "~/Images/" + imageFilename1;
        imgImage1.ImageUrl = image1WithPath;
        imgImage1.ToolTip = imageFilename1;
        imgImage1.AlternateText = "Image file not found!";

        //Image 2 Info
        if (imageFilename2 == "")
            imageFilename2 = "no-image.jpg";

        //Display Image 2 info
        imgImage2.ImageUrl = "~/Images/" + imageFilename2;
        imgImage2.ToolTip = imageFilename2;
        imgImage2.AlternateText = "Image file not found!";
        hypImage2.NavigateUrl = "POI_Images.aspx?qrypoiID=" + poiID;
        hypImage2.Text = "Edit Images";

        //Image 3 Info
        if (imageFilename3 == "")
            imageFilename3 = "no-image.jpg";
        Trace.Warn("imageFilename3 = " + imageFilename3);

        //Display Image 1 info
        imgImage3.ImageUrl = "~/Images/" + imageFilename3;
        imgImage3.ToolTip = imageFilename3;
        imgImage3.AlternateText = "Image file not found!";
    }
Esempio n. 3
0
    protected void BindGridData()
    {
        DA_POI inventoryDAObject = new DA_POI();

        DataTable dataTableObject = inventoryDAObject.GetPOIs();

        grdvPlaces.DataSource = dataTableObject;

        grdvPlaces.DataBind();
    }
    protected void BindGridData()
    {
        DA_POI inventoryDAObject = new DA_POI();

        DataTable dataTableObject = inventoryDAObject.GetPOIs();

        grdvPlaces.DataSource = dataTableObject;

        grdvPlaces.DataBind();
    }
    private void UpdateDatabaseFieldName(string parPOIID,
                                         string parImageFilename,
                                         int parImageNumber)
    {
        //Save file name in record
        DA_POI poiDAObject = new DA_POI();

        poiDAObject.AddImageFilename(parPOIID, parImageFilename, parImageNumber);

        Trace.Warn("Inside UpdateDatabaseFieldName", "Database field updated.");
    }
    /// <summary>
    /// name:         btnDeleteImage3
    /// description:  link button that deletes the associated image with the image slot
    /// </summary>
    protected void btnDeleteImage3(object sender, EventArgs e)
    {
        string poiID = Request.QueryString["qrypoiID"];

        DA_POI locationObject = new DA_POI();
        locationObject.DeleteImage(poiID, 3);
        locationObject.OrganizeImages(poiID, 3);

        string URLWithQuerystring = "POI_Images.aspx?qrypoiID=" + poiID;
        Response.Redirect(URLWithQuerystring);
    }
    /// <summary>
    /// name:         btnDeleteImage6
    /// description:  link button that deletes the associated image with the image slot
    /// </summary>
    protected void btnDeleteImage6(object sender, EventArgs e)
    {
        string poiID = Request.QueryString["qrypoiID"];

        DA_POI locationObject = new DA_POI();

        locationObject.DeleteImage(poiID, 6);
        locationObject.OrganizeImages(poiID, 6);

        string URLWithQuerystring = "POI_Images.aspx?qrypoiID=" + poiID;

        Response.Redirect(URLWithQuerystring);
    }
    /// <summary>
    /// name:         FillGridView
    /// description:  method used after the "Add" POI button is clicked, fills textboxes with the new POI's information
    /// </summary>
    private void AddNewRecord()
    {
        currentContext.Trace.Warn("inside AddNewRecord Local Method");
        DA_POI inventoryObject = new DA_POI();

        //Declare Variables
        decimal latitude;
        decimal longitude;
        string title;
        string url;
        string description;
        string categoryCode;
        bool isActive = false;

        //Get values for variables
        //If Statements for Missing Long/Lat Values
        if (txtLatitude.Text == "")
        {
            latitude = 0;
        }
        else
        {
            latitude = Convert.ToDecimal(txtLatitude.Text);
        }
        if (txtLongitude.Text == "")
        {
            longitude = 0;
        }
        else
        {
            longitude = Convert.ToDecimal(txtLongitude.Text);
        }

        title = txtTitle.Text;
        url = txtURL.Text;
        description = txtDescription.Text;
        categoryCode = ddlCategory.SelectedItem.Value;

        if (chkIsActive.Checked == true)
        {
            isActive = true;
        }
        else
        {
            isActive = false;
        }

        inventoryObject.AddPOI(latitude, longitude,
                                title, url, description, categoryCode, isActive);
    }
    /// <summary>
    /// name:         butAdd_Click
    /// description:  button click method that inities the FillGridView method   
    /// </summary>
    protected void butAdd_Click(object sender, EventArgs e)
    {
        //First add the record with only text-type stuff, no image filenames
        this.AddNewRecord();

        //Get POI_ID for newly added record
        DA_POI poiDAObject = new DA_POI();
        int newPOI_ID = poiDAObject.GetNewlyAddedPOI_ID();
        Trace.Warn("newPOI_ID = " + newPOI_ID);

        //Display newly added record info
        //Note:  will have a link to the page that allows images to be added.
        hypAddImagePage.NavigateUrl = "POI_Images.aspx?qrypoiID=" + newPOI_ID;
    }
Esempio n. 10
0
    /// <summary>
    /// name:         delBTN_Click
    /// description:  This method is from button click, it generates the modul Popup to verify deletion of a POI
    /// </summary>
    protected void delBTN_Click(object sender, ImageClickEventArgs e)
    {
        ImageButton btndetails = sender as ImageButton;
        GridViewRow gvrow      = (GridViewRow)btndetails.NamingContainer;

        DA_POI  inventoryDAObject = new DA_POI();
        DataRow dataRowObject     = inventoryDAObject.GetPOI(gvrow.Cells[0].Text);

        string ID    = Convert.ToString(dataRowObject["POI_ID"]);
        string title = Convert.ToString(dataRowObject["POI_Title"]);

        lblID.Text    = ID;
        lblTitle.Text = title;
        this.ModalPopupExtender1.Show();
    }
    /// <summary>
    /// name:         butAdd_Click
    /// description:  button click method that inities the FillGridView method
    /// </summary>
    protected void butAdd_Click(object sender, EventArgs e)
    {
        //First add the record with only text-type stuff, no image filenames
        this.AddNewRecord();

        //Get POI_ID for newly added record
        DA_POI poiDAObject = new DA_POI();
        int    newPOI_ID   = poiDAObject.GetNewlyAddedPOI_ID();

        Trace.Warn("newPOI_ID = " + newPOI_ID);

        //Display newly added record info
        //Note:  will have a link to the page that allows images to be added.
        hypAddImagePage.NavigateUrl = "POI_Images.aspx?qrypoiID=" + newPOI_ID;
    }
    /// <summary>
    /// name:         delBTN_Click
    /// description:  This method is from button click, it generates the modul Popup to verify deletion of a POI
    /// </summary>
    protected void delBTN_Click(object sender, ImageClickEventArgs e)
    {
        ImageButton btndetails = sender as ImageButton;
        GridViewRow gvrow = (GridViewRow)btndetails.NamingContainer;
        
        DA_POI inventoryDAObject = new DA_POI();
        DataRow dataRowObject = inventoryDAObject.GetPOI(gvrow.Cells[0].Text);

        string ID = Convert.ToString(dataRowObject["POI_ID"]);
        string title = Convert.ToString(dataRowObject["POI_Title"]);

        lblID.Text = ID;
        lblTitle.Text = title;
        this.ModalPopupExtender1.Show();
    }
    /// <summary>
    /// name:         butSaveJSONFile_Click
    /// description:  button click method that is used to save a new Places.js file   
    /// </summary>
    protected void butSaveJSONFile_Click(object sender, EventArgs e)
    {
        DA_POI PoiDataObject = new DA_POI();

        ////Fill a DataTable object with test data
        //DataTable PoiDataTableObject = PoiDataObject.GetPOIs();

        ////Retrieve the data from the filled DataTable object 
        //// and concatenate it into a JSON-formatted string
        //JSON_Utils jsonUtilityObject = new JSON_Utils();

        //string jsonString = JSON_Utils.ConvertDataTableToJSON(PoiDataTableObject);

        //jsonUtilityObject.SaveJSONStringAsFile(jsonString);

        JSON_Utils jsonUtilityObject = new JSON_Utils();
        jsonUtilityObject.SaveJSONCategoriesAsFile();
        jsonUtilityObject.SaveJSONCategoriesAndLocationsAsFile();

    }
    /// <summary>
    /// name:         butSaveJSONFile_Click
    /// description:  button click method that is used to save a new Places.js file
    /// </summary>
    protected void butSaveJSONFile_Click(object sender, EventArgs e)
    {
        DA_POI PoiDataObject = new DA_POI();

        ////Fill a DataTable object with test data
        //DataTable PoiDataTableObject = PoiDataObject.GetPOIs();

        ////Retrieve the data from the filled DataTable object
        //// and concatenate it into a JSON-formatted string
        //JSON_Utils jsonUtilityObject = new JSON_Utils();

        //string jsonString = JSON_Utils.ConvertDataTableToJSON(PoiDataTableObject);

        //jsonUtilityObject.SaveJSONStringAsFile(jsonString);

        JSON_Utils jsonUtilityObject = new JSON_Utils();

        jsonUtilityObject.SaveJSONCategoriesAsFile();
        jsonUtilityObject.SaveJSONCategoriesAndLocationsAsFile();
    }
    /// <summary>
    /// name:         ChangeRecord
    /// description:  This method contains the front end code needed to update a POI, it uses the UpdatePOI method in the DA_POI class
    /// </summary>
    private void ChangeRecord()
    {
        //Get ID value
        string locationID = (Request.QueryString["qrypoiID"]);

        //Declare Variables
        string title;
        decimal latitude;
        decimal longitude;
        string url;
        string description;
        string Category;
        bool isActive  ;

        //Get values for variables
        //If Statements for Missing Long/Lat Values
        if (txtLatitude.Text == "")
        {
            latitude = 0;
        }
        else
        {
            latitude = Convert.ToDecimal(txtLatitude.Text);
        }
        if (txtLongitude.Text == "")
        {
            longitude = 0;
        }
        else
        {
            longitude = Convert.ToDecimal(txtLongitude.Text);
        }

        title = Convert.ToString(txtTitle.Text);
        url = Convert.ToString(txtURL.Text);
        description = Convert.ToString(txtDescription.Text);
        Category = ddlCategory.SelectedValue;

        if (chkIsActive.Checked == true)
        {
            isActive = true;
        }
        else
        {
            isActive = false;
        }
        DA_POI inventoryObject = new DA_POI();
        inventoryObject.UpdatePOI(latitude, longitude, title, url,
                        description, Category, isActive, locationID);

        lblDisplay.Text = "The POI information has been saved.";
        this.DisplayRecord();
    }
    /// <summary>
    /// name:         FillGridView
    /// description:  method used after the "Add" POI button is clicked, fills textboxes with the new POI's information
    /// </summary>
    private void AddNewRecord()
    {
        currentContext.Trace.Warn("inside AddNewRecord Local Method");
        DA_POI inventoryObject = new DA_POI();

        //Declare Variables
        decimal latitude;
        decimal longitude;
        string  title;
        string  description;
        string  Address1;
        string  Address2;
        string  City;
        string  State;
        int     ZipCode;
        string  ContactName;
        string  Phone;
        string  URL;
        string  categoryCode;
        bool    isActive    = false;
        bool    petFriendly = false;

        //Get values for variables
        //If Statements for Missing Long/Lat Values
        if (txtLatitude.Text == "")
        {
            latitude = 0;
        }
        else
        {
            latitude = Convert.ToDecimal(txtLatitude.Text);
        }
        if (txtLongitude.Text == "")
        {
            longitude = 0;
        }
        else
        {
            longitude = Convert.ToDecimal(txtLongitude.Text);
        }
        //If Statements for Missing Address2/URL Values
        if (txtURL.Text == "")
        {
            URL = "";
        }
        else
        {
            URL = txtURL.Text;
        }
        if (txtAddress2.Text == "")
        {
            Address2 = "";
        }
        else
        {
            Address2 = txtAddress2.Text;
        }

        title        = txtTitle.Text;
        description  = txtDescription.Text;
        Address1     = txtAddress1.Text;
        City         = txtCity.Text;
        State        = txtState.Text;
        ZipCode      = Convert.ToInt32(txtZipCode.Text);
        ContactName  = txtContactName.Text;
        Phone        = txtPhone.Text;
        categoryCode = ddlCategory.SelectedItem.Value;

        if (chkIsActive.Checked == true)
        {
            isActive = true;
        }
        else
        {
            isActive = false;
        }

        if (chkPetFriendly.Checked == true)
        {
            petFriendly = true;
        }
        else
        {
            petFriendly = false;
        }

        inventoryObject.AddPOI(latitude, longitude,
                               title, description, Address1, Address2, City, State,
                               ZipCode, ContactName, Phone, URL,
                               categoryCode, isActive, petFriendly);
    }
    /// <summary>
    /// name:         FillGridView
    /// description:  method used after the "Add" POI button is clicked, fills textboxes with the new POI's information
    /// </summary>
    private void AddNewRecord()
    {
        currentContext.Trace.Warn("inside AddNewRecord Local Method");
        DA_POI inventoryObject = new DA_POI();

        //Declare Variables
        decimal latitude;
        decimal longitude;
        string title;
        string description;
        string Address1;
        string Address2;
        string City;
        string State;
        int ZipCode;
        string ContactName;
        string Phone;
        string URL;
        string categoryCode;
        bool isActive = false;
        bool petFriendly = false;

        //Get values for variables
        //If Statements for Missing Long/Lat Values
        if (txtLatitude.Text == "")
        {
            latitude = 0;
        }
        else
        {
            latitude = Convert.ToDecimal(txtLatitude.Text);
        }
        if (txtLongitude.Text == "")
        {
            longitude = 0;
        }
        else
        {
            longitude = Convert.ToDecimal(txtLongitude.Text);
        }
        //If Statements for Missing Address2/URL Values
        if (txtURL.Text == "")
        {
            URL = "";
        }
        else
        {
            URL = txtURL.Text;
        }
        if (txtAddress2.Text == "")
        {
            Address2 = "";
        }
        else
        {
            Address2 = txtAddress2.Text;
        }

        title = txtTitle.Text;
        description = txtDescription.Text;
        Address1 = txtAddress1.Text;
        City = txtCity.Text;
        State = txtState.Text;
        ZipCode = Convert.ToInt32(txtZipCode.Text);
        ContactName = txtContactName.Text;
        Phone = txtPhone.Text;
        categoryCode = ddlCategory.SelectedItem.Value;

        if (chkIsActive.Checked == true)
        {
            isActive = true;
        }
        else
        {
            isActive = false;
        }

        if (chkPetFriendly.Checked == true)
        {
            petFriendly = true;
        }
        else
        {
            petFriendly = false;
        }

        inventoryObject.AddPOI(latitude, longitude,
                                title, description, Address1, Address2, City, State,
                        ZipCode, ContactName, Phone, URL,
                        categoryCode, isActive, petFriendly);
    }
    private void UpdateDatabaseFieldName(string parPOIID,
                                            string parImageFilename,
                                            int parImageNumber)
    {
        //Save file name in record
        DA_POI poiDAObject = new DA_POI();
        poiDAObject.AddImageFilename(parPOIID, parImageFilename, parImageNumber);

        Trace.Warn("Inside UpdateDatabaseFieldName", "Database field updated.");
    }
    protected void Page_Load(object sender, EventArgs e)
    {

        ///<summary>
        ///This is the code for displaying images
        ///</summary>
        ///

        string poiID = Request.QueryString["qrypoiID"];

        DA_POI poiDAObject = new DA_POI();

        DataRow dataRowObject = poiDAObject.GetPOI(poiID);

        string imageFilename1 = Convert.ToString(dataRowObject["POI_Image1"]);
        string imageFilename2 = Convert.ToString(dataRowObject["POI_Image2"]);
        string imageFilename3 = Convert.ToString(dataRowObject["POI_Image3"]);
        string imageFilename4 = Convert.ToString(dataRowObject["POI_Image4"]);
        string imageFilename5 = Convert.ToString(dataRowObject["POI_Image5"]);
        string imageFilename6 = Convert.ToString(dataRowObject["POI_Image6"]);

        //Image 1 Info
        if (imageFilename1 == "")
        {
            imgImage1.Visible = false;
            lblNoImage1.Visible = true;
        }
        else
        {
            lbDeleteImage1.Visible = true;
            imagesExist++;
        }

        Trace.Warn("imageFilename1 = " + imageFilename1);
        //Display Image 1 info  
        string image1WithPath = "~/Images/" + imageFilename1;
        imgImage1.ImageUrl = image1WithPath;
        imgImage1.ToolTip = imageFilename1;
        imgImage1.AlternateText = "Image file not found!";

        //Image 2 Info
        if (imageFilename2 == "")
        {
            imgImage2.Visible = false;
            lblNoImage2.Visible = true;
        }
        else
        {
            lbDeleteImage2.Visible = true;
            imagesExist++;
        }

        Trace.Warn("imageFilename2 = " + imageFilename2);
        //Display Image 2 info
        imgImage2.ImageUrl = "~/Images/" + imageFilename2;
        imgImage2.ToolTip = imageFilename2;
        imgImage2.AlternateText = "Image file not found!";

        //Image 3 Info
        if (imageFilename3 == "")
        {
            imgImage3.Visible = false;
            lblNoImage3.Visible = true;
        }
        else
        {
            lbDeleteImage3.Visible = true;
            imagesExist++;
        }

        Trace.Warn("imageFilename3 = " + imageFilename3);

        //Display Image 1 info
        imgImage3.ImageUrl = "~/Images/" + imageFilename3;
        imgImage3.ToolTip = imageFilename3;
        imgImage3.AlternateText = "Image file not found!";

        //Image 4 Info
        if (imageFilename4 == "")
        {
            imgImage4.Visible = false;
            lblNoImage4.Visible = true;
        }
        else
        {
            lbDeleteImage4.Visible = true;
            imagesExist++;
        }

        Trace.Warn("imageFilename4 = " + imageFilename4);
        //Display Image 4 info
        imgImage4.ImageUrl = "~/Images/" + imageFilename4;
        imgImage4.ToolTip = imageFilename2;
        imgImage4.AlternateText = "Image file not found!";

        //Image 5 Info
        if (imageFilename5 == "")
        {
            imgImage5.Visible = false;
            lblNoImage5.Visible = true;
        }
        else
        {
            lbDeleteImage5.Visible = true;
            imagesExist++;
        }

        Trace.Warn("imageFilename5 = " + imageFilename5);
        //Display Image 5 info
        imgImage5.ImageUrl = "~/Images/" + imageFilename5;
        imgImage5.ToolTip = imageFilename5;
        imgImage5.AlternateText = "Image file not found!";

        //Image 6 Info
        if (imageFilename6 == "")
        {
            imgImage6.Visible = false;
            lblNoImage6.Visible = true;
        }
        else
        {
            lbDeleteImage6.Visible = true;
            imagesExist++;
        }

        Trace.Warn("imageFilename6 = " + imageFilename6);
        //Display Image 6 info
        imgImage6.ImageUrl = "~/Images/" + imageFilename6;
        imgImage6.ToolTip = imageFilename6;
        imgImage6.AlternateText = "Image file not found!";


        Trace.Warn("imagesExist = " + imagesExist);
        if (imagesExist == 6)
        {
            pnlUploadImage.Visible = false;
        }
        else if (imagesExist < 6)
        {
            pnlUploadImage.Visible = true;
        }



    }
    protected void Page_Load(object sender, EventArgs e)
    {
        ///<summary>
        ///This is the code for displaying images
        ///</summary>
        ///

        string poiID = Request.QueryString["qrypoiID"];

        DA_POI poiDAObject = new DA_POI();

        DataRow dataRowObject = poiDAObject.GetPOI(poiID);

        string imageFilename1 = Convert.ToString(dataRowObject["POI_Image1"]);
        string imageFilename2 = Convert.ToString(dataRowObject["POI_Image2"]);
        string imageFilename3 = Convert.ToString(dataRowObject["POI_Image3"]);
        string imageFilename4 = Convert.ToString(dataRowObject["POI_Image4"]);
        string imageFilename5 = Convert.ToString(dataRowObject["POI_Image5"]);
        string imageFilename6 = Convert.ToString(dataRowObject["POI_Image6"]);

        //Image 1 Info
        if (imageFilename1 == "")
        {
            imgImage1.Visible   = false;
            lblNoImage1.Visible = true;
        }
        else
        {
            lbDeleteImage1.Visible = true;
            imagesExist++;
        }

        Trace.Warn("imageFilename1 = " + imageFilename1);
        //Display Image 1 info
        string image1WithPath = "~/Images/" + imageFilename1;

        imgImage1.ImageUrl      = image1WithPath;
        imgImage1.ToolTip       = imageFilename1;
        imgImage1.AlternateText = "Image file not found!";

        //Image 2 Info
        if (imageFilename2 == "")
        {
            imgImage2.Visible   = false;
            lblNoImage2.Visible = true;
        }
        else
        {
            lbDeleteImage2.Visible = true;
            imagesExist++;
        }

        Trace.Warn("imageFilename2 = " + imageFilename2);
        //Display Image 2 info
        imgImage2.ImageUrl      = "~/Images/" + imageFilename2;
        imgImage2.ToolTip       = imageFilename2;
        imgImage2.AlternateText = "Image file not found!";

        //Image 3 Info
        if (imageFilename3 == "")
        {
            imgImage3.Visible   = false;
            lblNoImage3.Visible = true;
        }
        else
        {
            lbDeleteImage3.Visible = true;
            imagesExist++;
        }

        Trace.Warn("imageFilename3 = " + imageFilename3);

        //Display Image 1 info
        imgImage3.ImageUrl      = "~/Images/" + imageFilename3;
        imgImage3.ToolTip       = imageFilename3;
        imgImage3.AlternateText = "Image file not found!";

        //Image 4 Info
        if (imageFilename4 == "")
        {
            imgImage4.Visible   = false;
            lblNoImage4.Visible = true;
        }
        else
        {
            lbDeleteImage4.Visible = true;
            imagesExist++;
        }

        Trace.Warn("imageFilename4 = " + imageFilename4);
        //Display Image 4 info
        imgImage4.ImageUrl      = "~/Images/" + imageFilename4;
        imgImage4.ToolTip       = imageFilename2;
        imgImage4.AlternateText = "Image file not found!";

        //Image 5 Info
        if (imageFilename5 == "")
        {
            imgImage5.Visible   = false;
            lblNoImage5.Visible = true;
        }
        else
        {
            lbDeleteImage5.Visible = true;
            imagesExist++;
        }

        Trace.Warn("imageFilename5 = " + imageFilename5);
        //Display Image 5 info
        imgImage5.ImageUrl      = "~/Images/" + imageFilename5;
        imgImage5.ToolTip       = imageFilename5;
        imgImage5.AlternateText = "Image file not found!";

        //Image 6 Info
        if (imageFilename6 == "")
        {
            imgImage6.Visible   = false;
            lblNoImage6.Visible = true;
        }
        else
        {
            lbDeleteImage6.Visible = true;
            imagesExist++;
        }

        Trace.Warn("imageFilename6 = " + imageFilename6);
        //Display Image 6 info
        imgImage6.ImageUrl      = "~/Images/" + imageFilename6;
        imgImage6.ToolTip       = imageFilename6;
        imgImage6.AlternateText = "Image file not found!";


        Trace.Warn("imagesExist = " + imagesExist);
        if (imagesExist == 6)
        {
            pnlUploadImage.Visible = false;
        }
        else if (imagesExist < 6)
        {
            pnlUploadImage.Visible = true;
        }
    }
Esempio n. 21
0
    /// <summary>
    /// name:         ChangeRecord
    /// description:  This method contains the front end code needed to update a POI, it uses the UpdatePOI method in the DA_POI class
    /// </summary>
    private void ChangeRecord()
    {
        //Get ID value
        string locationID = (Request.QueryString["qrypoiID"]);

        //Declare Variables
        string  title;
        decimal latitude;
        decimal longitude;
        string  description;
        string  Address1;
        string  Address2;
        string  City;
        string  State;
        int     ZipCode;
        string  ContactName;
        string  Phone;
        string  URL;
        string  Category;
        bool    isActive;
        bool    petFriendly;


        //Get values for variables
        //If Statements for Missing Long/Lat Values
        if (txtLongitude.Text == "")
        {
            longitude = 0;
        }
        else
        {
            longitude = Convert.ToDecimal(txtLongitude.Text);
        }
        if (txtLatitude.Text == "")
        {
            latitude = 0;
        }
        else
        {
            latitude = Convert.ToDecimal(txtLatitude.Text);
        }
        //If Statements for Missing Address2/URL Values
        if (txtURL.Text == "")
        {
            URL = "";
        }
        else
        {
            URL = txtURL.Text;
        }
        if (txtAddress2.Text == "")
        {
            Address2 = "";
        }
        else
        {
            Address2 = txtAddress2.Text;
        }

        title       = Convert.ToString(txtTitle.Text);
        description = Convert.ToString(txtDescription.Text);
        Address1    = txtAddress1.Text;
        City        = txtCity.Text;
        State       = txtState.Text;
        ZipCode     = Convert.ToInt32(txtZipCode.Text);
        ContactName = txtContactName.Text;
        Phone       = txtPhone.Text;
        Category    = ddlCategory.SelectedValue;


        if (chkIsActive.Checked == true)
        {
            isActive = true;
        }
        else
        {
            isActive = false;
        }

        if (chkPetFriendly.Checked == true)
        {
            petFriendly = true;
        }
        else
        {
            petFriendly = false;
        }


        DA_POI inventoryObject = new DA_POI();

        inventoryObject.UpdatePOI(latitude, longitude, title,
                                  description, Address1, Address2, City, State,
                                  ZipCode, ContactName, Phone, URL,
                                  Category, isActive, locationID, petFriendly);

        lblDisplay.Text = "The POI information has been saved.";
        this.DisplayRecord();
    }
Esempio n. 22
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            this.FillDropDown();
        }
        else
        {
            this.ChangeRecord();
            this.DisplayRecord();
        }
        this.DisplayRecord();

        ///<summary>
        ///This is the code for displaying images. It is also used to navigate to the POI_Images.aspx
        ///</summary>

        string poiID = Request.QueryString["qrypoiID"];

        DA_POI poiDAObject = new DA_POI();

        DataRow dataRowObject = poiDAObject.GetPOI(poiID);

        string imageFilename1 = Convert.ToString(dataRowObject["POI_Image1"]);
        string imageFilename2 = Convert.ToString(dataRowObject["POI_Image2"]);
        string imageFilename3 = Convert.ToString(dataRowObject["POI_Image3"]);
        string imageFilename4 = Convert.ToString(dataRowObject["POI_Image4"]);
        string imageFilename5 = Convert.ToString(dataRowObject["POI_Image5"]);
        string imageFilename6 = Convert.ToString(dataRowObject["POI_Image6"]);

        //Image 1 Info
        if (imageFilename1 == "")
        {
            imageFilename1 = "no-image.jpg";
        }

        Trace.Warn("imageFilename1 = " + imageFilename1);

        //Display Image 1 info
        string image1WithPath = "~/Images/" + imageFilename1;

        imgImage1.ImageUrl      = image1WithPath;
        imgImage1.ToolTip       = imageFilename1;
        imgImage1.AlternateText = "Image file not found!";

        //Image 2 Info
        if (imageFilename2 == "")
        {
            imageFilename2 = "no-image.jpg";
        }
        //Display Image 2 info
        imgImage2.ImageUrl      = "~/Images/" + imageFilename2;
        imgImage2.ToolTip       = imageFilename2;
        imgImage2.AlternateText = "Image file not found!";
        hypImage2.NavigateUrl   = "POI_Images.aspx?qrypoiID=" + poiID;
        hypImage2.Text          = "Edit Images";

        //Image 3 Info
        if (imageFilename3 == "")
        {
            imageFilename3 = "no-image.jpg";
        }
        Trace.Warn("imageFilename3 = " + imageFilename3);

        //Display Image 3info
        imgImage3.ImageUrl      = "~/Images/" + imageFilename3;
        imgImage3.ToolTip       = imageFilename3;
        imgImage3.AlternateText = "Image file not found!";

        //Image 4 Info
        if (imageFilename4 == "")
        {
            imageFilename4 = "no-image.jpg";
        }


        //Display Image 4 info
        imgImage4.ImageUrl      = "~/Images/" + imageFilename4;
        imgImage4.ToolTip       = imageFilename4;
        imgImage4.AlternateText = "Image file not found!";

        //Image 5 Info
        if (imageFilename5 == "")
        {
            imageFilename5 = "no-image.jpg";
        }

        //Display Image 5 info
        imgImage5.ImageUrl      = "~/Images/" + imageFilename5;
        imgImage5.ToolTip       = imageFilename5;
        imgImage5.AlternateText = "Image file not found!";

        //Image 6 Info
        if (imageFilename6 == "")
        {
            imageFilename6 = "no-image.jpg";
        }
        //Display Image 6 info
        imgImage6.ImageUrl      = "~/Images/" + imageFilename6;
        imgImage6.ToolTip       = imageFilename6;
        imgImage6.AlternateText = "Image file not found!";
    }
    /// <summary>
    /// name:         ChangeRecord
    /// description:  This method contains the front end code needed to update a POI, it uses the UpdatePOI method in the DA_POI class
    /// </summary>
    private void ChangeRecord()
    {
        //Get ID value
        string locationID = (Request.QueryString["qrypoiID"]);

        //Declare Variables
        string title;
        decimal latitude;
        decimal longitude;
        string description;
        string Address1;
        string Address2;
        string City;
        string State;
        int ZipCode;
        string ContactName;
        string Phone;
        string URL;
        string Category;
        bool isActive;
        bool petFriendly;
        string image1Desc="";
        string image2Desc="";
        string image3Desc="";

        //Get values for variables
        //If Statements for Missing Long/Lat Values
        if (txtLongitude.Text == "")
        {
            longitude = 0;
        }
        else
        {
            longitude = Convert.ToDecimal(txtLongitude.Text);
        }
        if (txtLatitude.Text == "")
        {
            latitude = 0;
        }
        else
        {
            latitude = Convert.ToDecimal(txtLatitude.Text);
        }
        //If Statements for Missing Address2/URL Values
        if (txtURL.Text == "")
        {
            URL = "";
        }
        else
        {
            URL = txtURL.Text;
        }
        if (txtAddress2.Text == "")
        {
            Address2 = "";
        }
        else
        {
            Address2 = txtAddress2.Text;
        }

        title = Convert.ToString(txtTitle.Text);
        description = Convert.ToString(txtDescription.Text);
        Address1 = txtAddress1.Text;
        City = txtCity.Text;
        State = txtState.Text;
        ZipCode = Convert.ToInt32(txtZipCode.Text);
        ContactName = txtContactName.Text;
        Phone = txtPhone.Text;
        Category = ddlCategory.SelectedValue;
        image1Desc = txtImage1Desc.Text;
        image2Desc = txtImage2Desc.Text;
        image3Desc = txtImage3Desc.Text;

        if (chkIsActive.Checked == true)
        {
            isActive = true;
        }
        else
        {
            isActive = false;
        }

        if (chkPetFriendly.Checked == true)
        {
            petFriendly = true;
        }
        else
        {
            petFriendly = false;
        }

        Trace.Warn("1" + image1Desc);
        Trace.Warn("2" + image2Desc);
        Trace.Warn("3" + image3Desc);
        DA_POI inventoryObject = new DA_POI();
        inventoryObject.UpdatePOI(latitude, longitude, title,
                        description, Address1, Address2, City, State,
                        ZipCode, ContactName, Phone, URL,
                        Category, isActive, locationID, petFriendly, image1Desc, image2Desc, image3Desc);

        lblDisplay.Text = "The POI information has been saved.";
        this.DisplayRecord();
    }
Esempio n. 24
0
    /// <summary>
    /// name:         DisplayRecord
    /// description:  method to display data when modifying a POI
    /// </summary>
    private void DisplayRecord()
    {
        string locationID = (Request.QueryString["qrypoiID"]);


        DA_POI  inventoryObject = new DA_POI();
        DataRow dataRowObject   = inventoryObject.GetPOI(locationID);

        //Assign the field values of the DataRow object to variables
        string  ID          = Convert.ToString(dataRowObject["POI_ID"]);
        decimal latitude    = Convert.ToDecimal(dataRowObject["POI_Latitude"]);
        decimal longitude   = Convert.ToDecimal(dataRowObject["POI_Longitude"]);
        string  title       = Convert.ToString(dataRowObject["POI_Title"]);
        string  description = Convert.ToString(dataRowObject["POI_Description"]);
        string  address1    = Convert.ToString(dataRowObject["POI_Address1"]);
        string  address2    = Convert.ToString(dataRowObject["POI_Address2"]);
        string  city        = Convert.ToString(dataRowObject["POI_City"]);
        string  state       = Convert.ToString(dataRowObject["POI_State"]);
        string  ZipCode     = Convert.ToString(dataRowObject["POI_ZipCode"]);
        string  contactName = Convert.ToString(dataRowObject["POI_ContactName"]);
        string  phone       = Convert.ToString(dataRowObject["POI_Phone"]);
        string  url         = Convert.ToString(dataRowObject["POI_URL"]);
        string  category    = Convert.ToString(dataRowObject["POI_Category"]);
        bool    isActive    = Convert.ToBoolean(dataRowObject["IsActive"]);
        bool    petFriendly = Convert.ToBoolean(dataRowObject["Pet_Friendly"]);


        lblID.Text                = ID.ToString();
        txtLongitude.Text         = longitude.ToString();
        txtLatitude.Text          = latitude.ToString();
        txtTitle.Text             = title;
        txtDescription.Text       = description;
        txtAddress1.Text          = address1;
        txtAddress2.Text          = address2;
        txtCity.Text              = city;
        txtState.Text             = state;
        txtZipCode.Text           = ZipCode;
        txtContactName.Text       = contactName;
        txtPhone.Text             = phone;
        txtURL.Text               = url;
        ddlCategory.SelectedValue = category.ToString();



        if (isActive == true)
        {
            chkIsActive.Checked = true;
        }
        else
        {
            chkIsActive.Checked = false;
        }

        if (petFriendly == true)
        {
            chkPetFriendly.Checked = true;
        }
        else
        {
            chkPetFriendly.Checked = false;
        }
    }
    /// <summary>
    /// name:         DisplayRecord
    /// description:  method to display data when modifying a POI
    /// </summary>
    private void DisplayRecord()
    {
        string locationID = (Request.QueryString["qrypoiID"]);

        DA_POI inventoryObject = new DA_POI();
        DataRow dataRowObject = inventoryObject.GetPOI(locationID);

        //Assign the field values of the DataRow object to variables
        string ID = Convert.ToString(dataRowObject["POI_ID"]);
        decimal latitude = Convert.ToDecimal(dataRowObject["POI_Latitude"]);
        decimal longitude = Convert.ToDecimal(dataRowObject["POI_Longitude"]);
        string title = Convert.ToString(dataRowObject["POI_Title"]);
        string description = Convert.ToString(dataRowObject["POI_Description"]);
        string address1 = Convert.ToString(dataRowObject["POI_Address1"]);
        string address2 = Convert.ToString(dataRowObject["POI_Address2"]);
        string city = Convert.ToString(dataRowObject["POI_City"]);
        string state = Convert.ToString(dataRowObject["POI_State"]);
        string ZipCode = Convert.ToString(dataRowObject["POI_ZipCode"]);
        string contactName = Convert.ToString(dataRowObject["POI_ContactName"]);
        string phone = Convert.ToString(dataRowObject["POI_Phone"]);
        string url = Convert.ToString(dataRowObject["POI_URL"]);
        string category = Convert.ToString(dataRowObject["POI_Category"]);
        bool isActive = Convert.ToBoolean(dataRowObject["IsActive"]);
        bool petFriendly = Convert.ToBoolean(dataRowObject["Pet_Friendly"]);
        string image1Desc = Convert.ToString(dataRowObject["Image1Desc"]);
        string image2Desc = Convert.ToString(dataRowObject["Image2Desc"]);
        string image3Desc = Convert.ToString(dataRowObject["Image3Desc"]);

        lblID.Text = ID.ToString();
        txtLongitude.Text = longitude.ToString();
        txtLatitude.Text = latitude.ToString();
        txtTitle.Text = title;
        txtDescription.Text = description;
        txtAddress1.Text = address1;
        txtAddress2.Text = address2;
        txtCity.Text = city;
        txtState.Text = state;
        txtZipCode.Text = ZipCode;
        txtContactName.Text = contactName;
        txtPhone.Text = phone;
        txtURL.Text = url;
        ddlCategory.SelectedValue = category.ToString();
        txtImage1Desc.Text = image1Desc;
        txtImage2Desc.Text = image2Desc;
        txtImage3Desc.Text = image3Desc;

        if (isActive == true)
        {
            chkIsActive.Checked = true;
        }
        else
        {
            chkIsActive.Checked = false;
        }

        if (petFriendly == true)
        {
            chkPetFriendly.Checked = true;
        }
        else
        {
            chkPetFriendly.Checked = false;
        }
    }
    /// <summary>
    /// name:         DisplayRecord
    /// description:  method to display data when modifying a POI
    /// </summary>
    private void DisplayRecord()
    {
        string locationID = (Request.QueryString["qrypoiID"]);

        DA_POI inventoryObject = new DA_POI();
        DataRow dataRowObject = inventoryObject.GetPOI(locationID);

        //Assign the field values of the DataRow object to variables
        string ID = Convert.ToString(dataRowObject["POI_ID"]);
        decimal latitude = Convert.ToDecimal(dataRowObject["POI_Latitude"]);
        decimal longitude = Convert.ToDecimal(dataRowObject["POI_Longitude"]);
        string title = Convert.ToString(dataRowObject["POI_Title"]);
        string url = Convert.ToString(dataRowObject["POI_URL"]);
        string description = Convert.ToString(dataRowObject["POI_Description"]);
        string category = Convert.ToString(dataRowObject["POI_Category"]);
        bool isActive = Convert.ToBoolean(dataRowObject["IsActive"]);

        lblID.Text = ID.ToString();
        txtLatitude.Text = latitude.ToString();
        txtLongitude.Text = longitude.ToString();
        txtTitle.Text = title;
        txtDescription.Text = description;
        txtURL.Text = url;
        ddlCategory.SelectedValue = category.ToString();

        if (isActive == true)
        {
            chkIsActive.Checked = true;
        }
        else
        {
            chkIsActive.Checked = false;
        }
    }