private void btnSave_Click(object sender, EventArgs e)
        {
            int found = 0;

            if (txtname.Text.Equals(""))
            {
                MessageBox.Show("Insert data Please");
            }
            else
            {
                DataTable dt = ClassSetting.searchCityByName(txtname.Text);
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    if (txtname.Text.Equals(dt.Rows[i][0].ToString()))
                    {
                        found = 1;
                    }
                }
                if (found == 1)
                {
                    MessageBox.Show("This name already exists . .");
                }
                else
                {
                    int add = ClassLocation.sp_AddCity(txtname.Text, int.Parse(cmbCountry.SelectedValue.ToString()));
                    txtname.Text = "";
                    MessageBox.Show("Done");
                }
            }
        }
Beispiel #2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            int found = 0;

            if (txtname.Text.Equals(""))
            {
                MessageBox.Show("Insert data please");
            }
            else
            {
                DataTable dt = ClassSetting.searchCountryByName(txtname.Text);
                for (int j = 0; j < dt.Rows.Count; j++)
                {
                    if (txtname.Text.Equals(dt.Rows[j][0].ToString()))
                    {
                        found = 1;
                    }
                }
                if (found == 1)
                {
                    MessageBox.Show("This name already exists . .");
                }
                else
                {
                    int add = ClassLocation.sp_addcountry(txtname.Text);
                    txtname.Text = "";
                    MessageBox.Show("Done");
                }
            }
        }
        void fullcmb()
        {
            DataTable dt = ClassLocation.sp_selectAllCountry();

            cmbCountry.DataSource    = dt;
            cmbCountry.DisplayMember = "country_name";
            cmbCountry.ValueMember   = "country_id";
        }
Beispiel #4
0
            /// <summary>
            /// Determines whether the specified <see cref="System.Object" />, is equal to this instance.
            /// </summary>
            /// <param name="obj">The <see cref="System.Object" /> to compare with this instance.</param>
            /// <returns>
            ///   <c>true</c> if the specified <see cref="System.Object" /> is equal to this instance; otherwise, <c>false</c>.
            /// </returns>
            public override bool Equals(object obj)
            {
                if (obj == null)
                {
                    return(false);
                }

                ClassLocation classLocation = (ClassLocation)obj;

                if (((this.ComponentType == null && classLocation.ComponentType == null) || object.Equals(this.ComponentType, classLocation.ComponentType))
                    &&
                    ((this.ComponentObject == null && classLocation.ComponentObject == null) || this.ComponentObject.Equals(classLocation.ComponentObject)))
                {
                    return(true);
                }

                return(false);
            }
 public ClassVenue()
 {
     Location = new ClassLocation();
 }