private void SaveData(string strIsDelete) { try { if (hfIsUpdate.Value == "Y") { hfId.Value = hfId.Value; } else { hfId.Value = Common.getMaxId("EmpEmergencyContact", "ContactId"); } objEmpMgr.InsertEmergencyContact(hfId.Value.ToString(), txtEmpID.Text.Trim(), txtName.Text.Trim(), txtAdd.Text.Trim(), txtPhone.Text.Trim(), ddlRelation.SelectedValue.ToString(), Session["USERID"].ToString(), Common.SetDateTime(DateTime.Now.ToString()), hfIsUpdate.Value.ToString(), strIsDelete); if (hfIsUpdate.Value == "N") { lblMsg.Text = "Record Saved Successfully"; } else { lblMsg.Text = "Record Updated Successfully"; } this.OpenRecord(); this.EntryMode(false); this.ClearControl(); } catch (Exception ex) { lblMsg.Text = ""; throw (ex); } }