示例#1
0
        private void buttonAdd_Click(object sender, EventArgs e)
        {
            //Get the value from the input feilds
            m.Room = comboBoxRoom.Text;
            m.Day  = comboBoxDay.Text;
            m.Time = textBoxTime.Text;

            //inserting Data into Databse using the method we creted in pervious episode
            bool success = m.Insert(m);

            if (success == true)
            {
                //successfully Inserted
                MessageBox.Show("Data is added successfully");
                //call the clear method here
                Clear();
            }
            else
            {
                //Failed to insert data
                MessageBox.Show("Failed to add data. Please try again.....");
            }
            //Load Data on DataGridVeiw
            DataTable dt = m.Select();

            dataGridView3.DataSource = dt;
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            Choose_SearchByUserLocation_Click(sender, e);

            if (!IsPostBack)
            {
            }

            if (!ClientScript.IsStartupScriptRegistered("initialize"))
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(),
                                                        "initialize", "initialize();", true);
            }



            if (Request.QueryString["Product_ID_Array"] != null)
            {
                product_id_array = Request.QueryString["Product_ID_Array"].Split(',');

                SelectedProduct_div.InnerHtml = "<table border='10', width=100%, borderColor='#00FF00'><tr><td style=\"padding: 5px 10px 5px 10px; background-color: #666666; font-size:large;\">Order Information:</td></tr></table>";
                int orderNumber = 0;
                // Loop over strings
                for (int i = 0; i < product_id_array.Length; i++)
                {
                    orderNumber++;

                    products = products.Select(Convert.ToInt32(product_id_array[i]));
                    warehouse_product_location = warehouse_product_location.Select_By_Product_ID(Convert.ToInt32(product_id_array[i]));
                    Location = Location.Select(warehouse_product_location.Location_ID);



                    Lat  = Convert.ToDecimal(Location.n_lat);
                    Long = Convert.ToDecimal(Location.n_long);

                    passProduct_ID_hf.Value = Convert.ToString(products.FEMA_Description);



                    SelectedProduct_div.InnerHtml += "<Table border='2' width='100%' align ='center'><tr><td width='10%'>" + "<b><font color='black' size='3'>#" + orderNumber + "</b></font></td ><td width='90%' bgcolor='#333333' ></td></tr>" +
                                                     "<tr><td colspan='2'><b><font color='black'>Name: </b>" + products.product_name + "</td></tr>" +
                                                     "<tr><td colspan='2'><b><font color='black'>Type: </b>" + products.product_type + "</font></td></tr>" +
                                                     "<tr><td colspan='2'><b><font color='black'>Discription: </b>" + products.product_desc + "</font></td></tr>" +
                                                     "<tr><td colspan='2'><b><font color='black'>Lat/Long: </b>" + Lat + "/" + Long + "</font></td></tr>" +
                                                     "</td></tr></Table>";

                    EName.Add(products.product_name);
                    EType.Add(products.product_type);
                    EDescription.Add(products.product_desc);

                    //Page.ClientScript.RegisterStartupScript(this.GetType(),
                    //"showMap", "showMap("+ Lat +", " + Long + ");", true);
                }
            }
            else
            {
                //Response.Write("<script>alert('Your order does not exist; This instance has been loged and well be looked into.');</script>");
            }
        }
 public location Insert_location_select(int ID)
 {
     location                      = location.Select(ID);
     Insert_type_txt.Text          = Convert.ToString(location.type);
     Insert_city_txt.Text          = Convert.ToString(location.city);
     Insert_state_txt.Text         = Convert.ToString(location.state);
     Insert_zip_txt.Text           = Convert.ToString(location.zip);
     Insert_county_txt.Text        = Convert.ToString(location.county);
     Insert_location_desc_txt.Text = Convert.ToString(location.location_desc);
     Insert_n_long_txt.Text        = Convert.ToString(location.n_long);
     Insert_s_long_txt.Text        = Convert.ToString(location.s_long);
     Insert_e_long_txt.Text        = Convert.ToString(location.e_long);
     Insert_w_long_txt.Text        = Convert.ToString(location.w_long);
     Insert_n_lat_txt.Text         = Convert.ToString(location.n_lat);
     Insert_s_lat_txt.Text         = Convert.ToString(location.s_lat);
     Insert_e_lat_txt.Text         = Convert.ToString(location.e_lat);
     Insert_w_lat_txt.Text         = Convert.ToString(location.w_lat);
     return(location);
 }