/// <summary>
        /// Populates fields from database record
        /// </summary>
        /// <param name="patientResponseId"></param>
        private void PopulateFields(int patientResponseId)
        {
            PatientProtocolResponse biz = new PatientProtocolResponse();

            biz.Get(patientResponseId);
            base.PopulateForm(biz);
        }
 /// <summary>
 ///
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void DeleteClick(object sender, EventArgs e)
 {
     if (!IsNew && !string.IsNullOrEmpty(PatientResponseId))
     {
         PatientProtocolResponse biz = new PatientProtocolResponse();
         biz.Delete(int.Parse(PatientResponseId));
     }
     RegisterOnSaveScript(string.Empty);
 }
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void SaveClick(object sender, EventArgs e)
        {
            PatientProtocolResponse biz = new PatientProtocolResponse();

            // Load existing record if updating
            if (!IsNew && !string.IsNullOrEmpty(PatientResponseId))
            {
                biz.Get(int.Parse(PatientResponseId));
            }
            // reference parent key
            int parKey = int.Parse(PatientProtocolId);

            // set fields value
            CICHelper.SetBOValues(this.Controls, biz, parKey);
            // finally save and call update script
            biz.Save();

            string updateResponseId = biz[PatientProtocolResponse.PatientResponseId].ToString();

            RegisterOnSaveScript(updateResponseId);
        }