protected void acbCurrency_SearchClick(object sender, EventArgs e)
        {
            try
            {

                objCurrencyLookup = new CurrencyLookupDal();
                DataSet dsCurrency = objCurrencyLookup.GetCurrency(acbCurrency.SearchTextBox.Text);
                radgrdCurrency.DataSource = dsCurrency;
                radgrdCurrency.DataBind();
                ViewState[vsCurrency] = dsCurrency;
                Reset();
            }
            catch (Exception ex)
            {
                bool rethrow = ExceptionPolicy.HandleException(ex, DALHelper.DAL_EXP_POLICYNAME);
                if (rethrow)
                { throw ex; }
            }

        }
        protected void acbCurrency_DeleteClick(object sender, EventArgs e)
        {
            try
            {
                StringBuilder CurrencyId = 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 lblCurrencyId = (Label)radgrdCurrency.Items[i].FindControl("lblgrdCurrencyIdItem");

                        if (lblCurrencyId != null)
                        {
                            CurrencyId.Append(lblCurrencyId.Text + ",");
                        }
                    }
                }

                objCurrencyLookup = new CurrencyLookupDal();
                String CurrenId = CurrencyId.ToString().TrimEnd(',');
                result = objCurrencyLookup.DeleteCurrency(CurrenId);


                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; }
            }
        }
 private void Save()
 {
     try
     {
         int result = 0;
         objCurrencyLookup = new CurrencyLookupDal();
         objCurrencyLookupBDto = new CurrencyBDto();
         objCurrencyLookupBDto.CurrencyName = txtCurrency.Text;
         objCurrencyLookupBDto.CurrencySymbol = txtCurrencySymbol.Text;
         objCurrencyLookupBDto.UserId = objAuthorizationBDto.UserProfile.UserId;
         result = objCurrencyLookup.InsertCurrency(objCurrencyLookupBDto);
         if (result >= 1)
         {
             Master.DisplayMessage(ConfigurationSettings.AppSettings[SuccessMessage.Save].ToString());
             Master.MessageCssClass = "successMessage";
             bisEdit = false;
         }
         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; }
     }
 }
        protected void acbCurrency_SaveClick(object sender, EventArgs e)
        {
            try
            {
                int result = 0;
                objCurrencyLookup = new CurrencyLookupDal();
                switch (acbCurrency.SaveButton.CommandName)
                {
                    case "Save":
                        Save();
                        pnlAddNewMode.Visible = false;
                        acbCurrency.EditableMode = false;

                        break;

                    case "Update":
                        String xmlData = GenerateXmlString(radgrdCurrency);
                        result = objCurrencyLookup.UpdateCurrency(xmlData);
                        if (result == 1)
                        {
                            acbCurrency.DefaultMode = true;
                            Master.DisplayMessage(ConfigurationSettings.AppSettings["UpdateRecord"].ToString());
                            Master.MessageCssClass = "successMessage";

                            if (ViewState[PageConstants.vsItemIndexes] != null)
                                htItemIndex = (Hashtable)ViewState[PageConstants.vsItemIndexes];
                            for (int i = 0; i < htItemIndex.Count; i++)
                                radgrdCurrency.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;
                }
                objCurrencyLookup = new CurrencyLookupDal();

            }
            catch (Exception ex)
            {
                bool rethrow = ExceptionPolicy.HandleException(ex, DALHelper.DAL_EXP_POLICYNAME);
                if (rethrow)
                { throw ex; }
            }
        }
        /// <summary>
        /// Bind RoomType grid
        /// </summary>
        private void BindGrid()
        {

            objCurrencyLookup = new CurrencyLookupDal();
            DataSet dsCurrency = objCurrencyLookup.GetCurrency("");
            radgrdCurrency.DataSource = dsCurrency;
            radgrdCurrency.DataBind();
            ViewState[vsCurrency] = dsCurrency;

        }