private void SaveInqFollowMode()
 {
     try
     {
         int result = 0;
         objInquiriesFollowsModeLookup = new InquiriesFollowsModeLookupDal();
         LookupBDto objReligion = new LookupBDto();
         objLookUpBDto = new LookupBDto();
         objLookUpBDto.LookupName = txtInquiriesFollowsMode.Text;
         objLookUpBDto.UserProfile = objAuthorizationBDto.UserProfile;
         result = objInquiriesFollowsModeLookup.InsertInquiriesFollowsMode(objLookUpBDto);
         if (result >= 1)
         {
             Master.DisplayMessage(ConfigurationSettings.AppSettings[SuccessMessage.Save].ToString());
             Master.MessageCssClass = "successMessage";
         }
         else
         {
             Master.DisplayMessage(ConfigurationSettings.AppSettings[FailureMessage.Save].ToString());
             Master.MessageCssClass = "errorMessage";
         }
         BindGrid();
         Reset();
     }
     catch (Exception ex)
     {
         bool rethrow = ExceptionPolicy.HandleException(ex, DALHelper.DAL_EXP_POLICYNAME);
         if (rethrow)
         { throw ex; }
     }
 }
 /// <summary>
 /// Bind InquiriesFollowsModeLookup grid
 /// </summary>
 private void BindGrid()
 {
     objInquiriesFollowsModeLookup = new InquiriesFollowsModeLookupDal();
     DataSet dsInqFollowsMode = objInquiriesFollowsModeLookup.GetInquiriesFollowsMode("");
     radgrdInquiriesFollowsMode.DataSource = dsInqFollowsMode;
     radgrdInquiriesFollowsMode.DataBind();
     ViewState[vsInqFollowsMode] = dsInqFollowsMode;
 }
        protected void acbInquiriesFollowsMode_SaveClick(object sender, EventArgs e)
        {
            try
            {
                int result = 0;
                objInquiriesFollowsModeLookup = new InquiriesFollowsModeLookupDal();
                switch (acbInquiriesFollowsMode.SaveButton.CommandName)
                {
                    case "Save":
                        SaveInqFollowMode();
                        pnlAddNewMode.Visible = false;
                        acbInquiriesFollowsMode.EditableMode = false;
                        BindGrid();

                        break;
                    case "Update":
                        String xmlData = GenerateXmlString(radgrdInquiriesFollowsMode);
                        result = objInquiriesFollowsModeLookup.UpdateInquiriesFollowsMode(xmlData);
                        if (result == 1)
                        {
                            acbInquiriesFollowsMode.DefaultMode = true;
                            Master.DisplayMessage(ConfigurationSettings.AppSettings[SuccessMessage.Update].ToString());
                            Master.MessageCssClass = "successMessage";

                            if (ViewState[PageConstants.vsItemIndexes] != null)
                                htItemIndex = (Hashtable)ViewState[PageConstants.vsItemIndexes];
                            for (int i = 0; i < htItemIndex.Count; i++)
                                radgrdInquiriesFollowsMode.Items[Convert.ToInt32(htItemIndex[i])].Edit = false;
                            bisEdit = false;
                            ViewState[PageConstants.vsItemIndexes] = null;
                            BindGrid();
                        }
                        else
                        {
                            Master.DisplayMessage(ConfigurationSettings.AppSettings[FailureMessage.Update].ToString());
                            Master.MessageCssClass = "errorMessage";
                        }
                        break;
                }

                Reset();
            }
            catch (Exception ex)
            {
                bool rethrow = ExceptionPolicy.HandleException(ex, DALHelper.DAL_EXP_POLICYNAME);
                if (rethrow)
                { throw ex; }
            }
        }
        protected void acbInquiriesFollowsMode_SearchClick(object sender, EventArgs e)
        {
            try
            {
                objInquiriesFollowsModeLookup = new InquiriesFollowsModeLookupDal();
                DataSet dsInqFollowsMode = objInquiriesFollowsModeLookup.GetInquiriesFollowsMode(acbInquiriesFollowsMode.SearchTextBox.Text);
                radgrdInquiriesFollowsMode.DataSource = dsInqFollowsMode;
                radgrdInquiriesFollowsMode.DataBind();
                ViewState[vsInqFollowsMode] = dsInqFollowsMode;
                Reset();

            }
            catch (Exception ex)
            {
                bool rethrow = ExceptionPolicy.HandleException(ex, DALHelper.DAL_EXP_POLICYNAME);
                if (rethrow)
                { throw ex; }
            }
        }
        protected void acbInquiriesFollowsMode_DeleteClick(object sender, EventArgs e)
        {
            try
            {
                StringBuilder inqFollowsModeId = new StringBuilder();
                int result = 0;
                if (ViewState[PageConstants.vsItemIndexes] != null)
                    htItemIndex = (Hashtable)ViewState[PageConstants.vsItemIndexes];

                if (htItemIndex != null)
                {
                    foreach (int i in htItemIndex.Values)
                    {
                        Label lblinqFollowsModeId = (Label)radgrdInquiriesFollowsMode.Items[i].FindControl("lblGrdInqFollowsModeItem");
                        if (lblinqFollowsModeId != null)
                        {
                            inqFollowsModeId.Append(lblinqFollowsModeId.Text + ",");
                        }
                    }
                }
                objInquiriesFollowsModeLookup = new InquiriesFollowsModeLookupDal();
                String inqFollowModeId = inqFollowsModeId.ToString().TrimEnd(',');
                result = objInquiriesFollowsModeLookup.DeleteInquiriesFollowsMode(inqFollowModeId);

                if (result == 1)
                {
                    Master.DisplayMessage(ConfigurationSettings.AppSettings[SuccessMessage.Delete].ToString());
                    Master.MessageCssClass = "successMessage";
                    ViewState[PageConstants.vsItemIndexes] = null;
                    BindGrid();
                }
                else if (result == 547)
                {
                    Master.DisplayMessage(ConfigurationSettings.AppSettings[FailureMessage.Delete].ToString());
                    Master.MessageCssClass = "errorMessage";
                }
            }
            catch (Exception ex)
            {
                bool rethrow = ExceptionPolicy.HandleException(ex, DALHelper.DAL_EXP_POLICYNAME);
                if (rethrow)
                { throw ex; }
            }
        }