protected bool ValidateAndSave() { try { long lngID = 0; if (hfIsUpdate.Value == "N") { lngID = objDB.GerMaxIDNumber("CurrencyList", "CURNCID"); } else { lngID = Convert.ToInt32(hfID.Value); } hfID.Value = lngID.ToString(); if (chkDefault.Checked == true) { if (objPayrollMgr.IsDefaultExists(lngID.ToString()) == true) { lblMsg.Text = "There is already a Operational Currency exist in the list. So please change Operational Currency."; if (chkDefault.Enabled == true) { chkDefault.Focus(); } return(false); } } return(true); } catch (Exception ex) { lblMsg.Text = ""; throw (ex); } }