private void bindLstServiceProvider()
        {
            ManageServiceProvider manageServiceProvider = new ManageServiceProvider();

            var lstSPs = manageServiceProvider.getServiceProviderList(ConfigurationManager.ConnectionStrings["MVSSqlDev2008ConnectionString"].ConnectionString);
            lstServiceProvider.DataSource= lstSPs;
            lstServiceProvider.DataTextField = "SP_Name";
            lstServiceProvider.DataValueField = "SP_ID";
            lstServiceProvider.DataBind();
        }
        protected void btnSaveServiceProvider_ServerClick(object sender, EventArgs e)
        {
            ServiceProviderObject obj = new ServiceProviderObject();

            obj.SP_Name = txtServiceProviderName.Value;
            obj.SP_address= txtServiceProviderAddress.Value;
            obj.Telephone = txtServiceProviderTelephone.Value;
            obj.Category = Convert.ToInt32(lstCategory.Value);
            obj.Disable = chkBoxModelDisable.Checked;

            ManageServiceProvider ManageServiceProviderObj = new ManageServiceProvider();

            bool success = ManageServiceProviderObj.insert(obj, ConfigurationManager.ConnectionStrings["MVSSqlDev2008ConnectionString"].ConnectionString);

            if (success)
            {
                divSuccess.Visible = true;
            }
            else
                divFailure.Visible = true;
        }
        protected void grdServiceProvider_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            int rowIndex = int.Parse(e.CommandArgument.ToString());
            Session.Add("rowIndex", rowIndex);

            ManageServiceProvider ServiceProviderObj = new ManageServiceProvider();
            DataTable dt = ServiceProviderObj.getAServiceProvider(ConfigurationManager.ConnectionStrings["MVSSqlDev2008ConnectionString"].ConnectionString, rowIndex);

            if (dt.Rows.Count > 0)
            {
                DataRow dr = dt.Rows[0];
                txtServiceProviderName.Value = DBUtility.readDBString(dr, "SP_Name");
                lstCategory.Value = DBUtility.readDBString(dr, "ServiceProviderCategory_Name");
                txtServiceProviderAddress.Value = DBUtility.readDBString(dr, "SP_address");
                txtServiceProviderTelephone.Value = DBUtility.readDBString(dr, "Telephone");

                if (dr["Disable"] != null && !dr.IsNull("Disable"))
                {
                    chkBoxModelDisable.Checked = Convert.ToBoolean(dr["Disable"]);
                }
            }
        }
        protected void btnSaveServiceProvider_ServerClick(object sender, EventArgs e)
        {
            ServiceProviderObject obj = new ServiceProviderObject();

            obj.SP_Name = txtServiceProviderName.Value;
            obj.SP_address = txtServiceProviderAddress.Value;
            obj.Telephone = txtServiceProviderTelephone.Value;
            obj.Category = Convert.ToInt32(lstCategory.Items.FindByValue(lstCategory.Value).Value);
            obj.Disable = chkBoxModelDisable.Checked;

            ManageServiceProvider ServiceProviderObj = new ManageServiceProvider();

            bool success = ServiceProviderObj.updateAServiceProvider(ConfigurationManager.ConnectionStrings["MVSSqlDev2008ConnectionString"].ConnectionString, obj, Convert.ToInt32(Session["rowIndex"]));

            if (success)
            {
                divSuccess.Visible = true;
            }
            else
                divFailure.Visible = true;

            Session.Remove("rowIndex");
        }
 protected void grdServiceProvider_Load(object sender, EventArgs e)
 {
     ManageServiceProvider ServiceProviderObj = new ManageServiceProvider();
     grdServiceProvider.DataSource = ServiceProviderObj.getServiceProviders(ConfigurationManager.ConnectionStrings["MVSSqlDev2008ConnectionString"].ConnectionString);
     grdServiceProvider.DataBind();
 }