private void SaveInquiryStatus()
 {
     try
     {
         int result = 0;
         objInquiryStatusLookup = new InquiryStatusLookupDal();
         LookupBDto objStatus = new LookupBDto();
         objLookUpBDto = new LookupBDto();
         objLookUpBDto.LookupName =txtInquiryStatus.Text;
         objLookUpBDto.UserProfile = objAuthorizationBDto.UserProfile;
         result = objInquiryStatusLookup.InsertInquiryStatus(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; }
     }
 }
 private void BindGrid()
 {
     objInquiryStatusLookup = new InquiryStatusLookupDal();
     DataSet dsInquiryStatus = objInquiryStatusLookup.GetInquiryStatus("");
     radgrdInquiryStatus.DataSource = dsInquiryStatus;
     radgrdInquiryStatus.DataBind();
     ViewState[vsInquiryStatus] = dsInquiryStatus;
 }
        protected void acbInquiryStatus_SaveClick(object sender, EventArgs e)
        {
            try
            {
                int result = 0;
                objInquiryStatusLookup = new InquiryStatusLookupDal();
                switch (acbInquiryStatus.SaveButton.CommandName)
                {
                    case "Save":
                        SaveInquiryStatus();
                        pnlAddNewMode.Visible = false;
                        acbInquiryStatus.EditableMode = false;
                        BindGrid();

                        break;
                    case "Update":
                        String xmlData = GenerateXmlString(radgrdInquiryStatus);
                        result = objInquiryStatusLookup.UpdateInquiryStatus(xmlData);
                        if (result == 1)
                        {
                            acbInquiryStatus.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++)
                                radgrdInquiryStatus.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 acbInquiryStatus_SearchClick(object sender, EventArgs e)
        {
            try
            {
                objInquiryStatusLookup = new InquiryStatusLookupDal();
                DataSet dsInquiryStatus = objInquiryStatusLookup.GetInquiryStatus(acbInquiryStatus.SearchTextBox.Text);
                radgrdInquiryStatus.DataSource = dsInquiryStatus;
                radgrdInquiryStatus.DataBind();
                ViewState[vsInquiryStatus] = dsInquiryStatus;
                Reset();
            }
            catch (Exception ex)
            {
                bool rethrow = ExceptionPolicy.HandleException(ex, DALHelper.DAL_EXP_POLICYNAME);
                if (rethrow)
                { throw ex; }
            }

        }
        protected void acbInquiryStatus_DeleteClick(object sender, EventArgs e)
        {
            try
            {
                StringBuilder InquiryStatusId = 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 lblInquiryStatusId = (Label)radgrdInquiryStatus.Items[i].FindControl("lblGrdInquiryStatusIdItem");
                        if (lblInquiryStatusId != null)
                        {
                            InquiryStatusId.Append(lblInquiryStatusId.Text + ",");
                        }
                    }
                }
                objInquiryStatusLookup = new InquiryStatusLookupDal();
                String empStatusId = InquiryStatusId.ToString().TrimEnd(',');
                result = objInquiryStatusLookup.DeleteInquiryStatus(empStatusId);

                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; }
            }
        }