protected void btnAddUser_Click(object sender, EventArgs e)
    {
        DealerUsers objUsers = new DealerUsers();

        DataTable dtUsers = new DataTable();

        dtUsers = (DataTable)Session["DealerUsers"];

        DataView dv = new DataView();

        DataTable dt = new DataTable();

        dv = dtUsers.DefaultView;

        dv.RowFilter = "UserID='" + txtUserID.Text + "'";

        dt = dv.ToTable();

        if (dt.Rows.Count == 0)
        {
            objUsers.AddDealerUsers(Session[Constants.DealerCode].ToString(), "0", txtName.Text, txtUserID.Text, txtPassword.Text, txtUserName.Text, txtPhoneNumber.Text, Convert.ToInt32(ddlActive.SelectedItem.Value));

            FillUsers();
        }
        else
        {
            MpeAlert.Show();
            lblErrorMSg.Visible = true;
            lblErrorMSg.Text = "User ID already exists.";

        }
    }
    protected void btnEdit_Click1(object sender, EventArgs e)
    {
        DealerUsers objUsers = new DealerUsers();

        objUsers.AddDealerUsers(Session[Constants.DealerCode].ToString(), txtEditUId.Value, txtEditName.Text, txtEditUserID.Text, txtEditNewPassword.Text, txtEditUserName.Text, txtEditPhoneNumber.Text, Convert.ToInt32(ddlEditActive.SelectedItem.Value));

        FillUsers();
    }