Esempio n. 1
0
    //method to select data on edit
    private void BindSelected(int intDealerSNo)
    {
        lblMessage.Text       = "";
        txtDealerCode.Enabled = false;
        objDealerMaster.BindDealerOnSNo(intDealerSNo, "SELECT_ON_Dealer_SNo");
        txtDealerCode.Text = objDealerMaster.DealerCode;
        txtDealerDesc.Text = objDealerMaster.DealerDesc;
        txtAddress.Text    = objDealerMaster.Address;
        txtEmail.Text      = objDealerMaster.DealerEmail;

        // Code for selecting Status as in database
        for (intCnt = 0; intCnt < rdoStatus.Items.Count; intCnt++)
        {
            if (rdoStatus.Items[intCnt].Value.ToString().Trim() == objDealerMaster.ActiveFlag.ToString().Trim())
            {
                rdoStatus.Items[intCnt].Selected = true;
            }
            else
            {
                rdoStatus.Items[intCnt].Selected = false;
            }
        }

        ddlCountryCode.SelectedValue = objDealerMaster.CountryCode;
        ddlRegion.SelectedValue      = objDealerMaster.region;

        objCommonClass.BindStatebyregion(ddlStateCode, Convert.ToInt32(ddlRegion.SelectedValue));

        objCommonClass.BindCity(ddlCityCode, Convert.ToInt32(objDealerMaster.StateCode));
        objCommonClass.BindBranchBasedOnState(ddlBranch, Convert.ToInt32(objDealerMaster.StateCode));

        ddlStateCode.SelectedValue = objDealerMaster.StateCode;
        ddlCityCode.SelectedValue  = objDealerMaster.CityCode;
        ddlBranch.SelectedValue    = objDealerMaster.BranchCode;

        ddlCountryCode.SelectedValue = objDealerMaster.CountryCode;
    }