Пример #1
0
    protected void dgNationality_SelectedIndexChanged1(object sender, EventArgs e)
    {
        int iNationalityId = 0;

        int.TryParse(Convert.ToString(dgNationality.DataKeys[dgNationality.SelectedIndex]), out iNationalityId);
        hfId.Value = iNationalityId.ToString();
        RoomCategoryMaster oNationalityMaster = new RoomCategoryMaster();

        RoomCategoryDTO[] oNationalityData = oNationalityMaster.GetData(iNationalityId);
        if (oNationalityData.Length > 0)
        {
            txtRoomcategory.Text      = oNationalityData[0].RoomCategory;
            txtCategoryAlias.Text     = oNationalityData[0].CategoryAlias;
            txtCategoryAlias.ReadOnly = true;
        }
        oNationalityMaster = null;
        oNationalityData   = null;

        //btnAddNew.Enabled = false;
        //btnCancel.Enabled = true;
        btnCancel.Visible = true;
        btnDelete.Enabled = true;
        btnEdit.Text      = "Update";
        //btnEdit.Enabled = true;
        //btnSave.Enabled = false;
        lblStatus.Text = "";
    }
Пример #2
0
    private void RefreshGrid()
    {
        RoomCategoryMaster oNationalityMaster;

        RoomCategoryDTO[] oNationalityData;
        oNationalityMaster = new RoomCategoryMaster();
        oNationalityData   = oNationalityMaster.GetData();
        if (oNationalityData != null)
        {
            if (oNationalityData.Length > 0)
            {
                dgNationality.DataSource = oNationalityData;
                dgNationality.DataBind();
            }
        }
        else
        {
            dgNationality.DataSource = null;
            dgNationality.DataBind();
        }
        txtRoomcategory.Text  = "";
        txtCategoryAlias.Text = "";
        oNationalityMaster    = null;
        oNationalityData      = null;
    }