Beispiel #1
0
        public void update()
        {
            clsSqlServer objUpdate = new clsSqlServer();

            objUpdate.UpdateCustomer(_CustomerName,
                                     _CountryName,
                                     _Gender,
                                     _Hobbies,
                                     _IsMarried,
                                     _Email);
        }
Beispiel #2
0
        protected void btnEdit_Click(object sender, EventArgs e)
        {
            // Here the update logic will go
            // Lets do some code for update operation
            string email   = "";
            string sex     = "";
            string hobbies = "";
            bool   status  = false;

            //Gender selection grab value
            if (male.Checked)
            {
                sex = "Male";
            }
            else
            {
                sex = "Female";
            }

            // Hobbies selection grab value
            if (Painting.Checked)
            {
                hobbies = "Painting";
            }
            else
            {
                hobbies = "Reading";
            }
            //Status selection grab value
            if (Married.Checked)
            {
                status = true;
            }
            else
            {
                status = false;
            }

            // ADO.net code which will insert to sql server
            clsSqlServer obj = new clsSqlServer();

            //obj.UpdateCustomer(txtCustomerName.Text, ddlcoun.Text, sex, hobbies, status);
            email = txtEmail.Text;
            obj.UpdateCustomer(txtCustomerName.Text, ddlCountries.Text, sex, hobbies, email, status);

            loadCustomers();
        }
Beispiel #3
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            //UPDATING edited records.

            //COMMAND INSERT FIRE
            string gender  = "";
            string hobbies = "";
            string status  = "";

            if (rdoMale.Checked)
            {
                gender = "Male";
            }
            else
            {
                gender = "Female";
            }

            if (chkReading.Checked)
            {
                hobbies = "Reading";
            }
            else
            {
                hobbies = "Sports";
            }

            if (rdoMarried.Checked)
            {
                status = "1";
            }
            else
            {
                status = "0";
            }

            clsSqlServer objUpdate = new clsSqlServer();

            objUpdate.UpdateCustomer(txtCustomerName.Text,
                                     cboCountry.Text,
                                     gender,
                                     hobbies,
                                     status);

            ClearData();
            LoadCustomers();
        }
Beispiel #4
0
        public void UpdateCustomer(string CustomerName, string CountryName, string Gender, string Hobbies, string Email, bool IsMarried)
        {
            clsSqlServer obj = new clsSqlServer();

            obj.UpdateCustomer(CustomerName, CountryName, Gender, Hobbies, Email, IsMarried);
        }