public List <BOMerchantLevel> SelectMerchantLevelList(BOMerchantLevel _bomerlvl)
        {
            SqlCommand     _sqlcommand;
            SqlDataAdapter _sqlDataAdapter;

            using (SqlConnection _con = ConnectionInfo.GetConnection())
            {
                _sqlcommand             = new SqlCommand();
                _sqlcommand.CommandText = "SP_GetMerchantLevel";
                _sqlcommand.CommandType = System.Data.CommandType.StoredProcedure;
                _sqlcommand.Connection  = _con;
                _con.Open();
                _sqlcommand.Parameters.AddWithValue("@Event", _bomerlvl.Event);
                _sqlDataAdapter = new SqlDataAdapter(_sqlcommand);

                DataTable _dataTable = new DataTable();
                _sqlDataAdapter.Fill(_dataTable);

                List <BOMerchantLevel> _merlvl = (from cu in _dataTable.AsEnumerable()
                                                  select new BOMerchantLevel
                {
                    MerchantLevelId = cu.Field <int>("MerchantLevelId"),
                    MerchantLevel = cu.Field <string>("MerchantLevel"),
                    AnnualFee = cu.Field <decimal>("AnnualFee")
                }).ToList();

                _con.Close();
                return(_merlvl);
            }
        }
        private void FillMerchantLevelCombo()
        {
            BOMerchantLevel _bomerlvl = new BOMerchantLevel();

            _bomerlvl.Event = "GETALL";
            List <BOMerchantLevel> _bomerlvllist = _bamerlvl.GetMerchantLevelList(_bomerlvl);

            cmbMerchantLevel.DataSource    = _bomerlvllist;
            cmbMerchantLevel.DisplayMember = "MerchantLevel";
            cmbMerchantLevel.ValueMember   = "MerchantLevelId";
        }
        public int IUDMerchantLevel(BOMerchantLevel _bomerlvl)
        {
            int returnValue = default(int);

            using (SqlConnection _sqlconnection = ConnectionInfo.GetConnection())
            {
                _sqlcommand             = new SqlCommand();
                _sqlcommand.Connection  = _sqlconnection;
                _sqlcommand.CommandText = "SP_IUDMerchantLevel";
                _sqlcommand.CommandType = CommandType.StoredProcedure;
                _sqlconnection.Open();

                _sqlcommand.Parameters.AddWithValue("@MerchantLevelId", _bomerlvl.MerchantLevelId);
                _sqlcommand.Parameters.AddWithValue("@MerchantLevel", _bomerlvl.MerchantLevel);
                _sqlcommand.Parameters.AddWithValue("@AnnualFee", _bomerlvl.AnnualFee);
                _sqlcommand.Parameters.AddWithValue("@ExamCount", _bomerlvl.ExamCount);
                _sqlcommand.Parameters.AddWithValue("@StudentCount", _bomerlvl.StudentCount);
                _sqlcommand.Parameters.AddWithValue("@ShopperFee", _bomerlvl.ShopperFee);
                _sqlcommand.Parameters.AddWithValue("@QuestionType", _bomerlvl.QuestionType);
                _sqlcommand.Parameters.AddWithValue("@ExtraPermission", _bomerlvl.ExtraPermission);
                _sqlcommand.Parameters.AddWithValue("@IsActive", _bomerlvl.IsActive);
                _sqlcommand.Parameters.AddWithValue("@IsDelete", _bomerlvl.IsDelete);
                _sqlcommand.Parameters.AddWithValue("@CreatedBy", _bomerlvl.CreatedBy);
                _sqlcommand.Parameters.AddWithValue("@CreatedDate", _bomerlvl.CreatedDate);
                _sqlcommand.Parameters.AddWithValue("@UpdateBy", _bomerlvl.UpdateBy);
                _sqlcommand.Parameters.AddWithValue("@UpdateDate", _bomerlvl.UpdateDate);
                _sqlcommand.Parameters.AddWithValue("@Event", _bomerlvl.Event);
                _sqlcommand.Parameters.AddWithValue("@returnValue", 0).Direction = System.Data.ParameterDirection.InputOutput;

                try
                {
                    _sqlcommand.ExecuteNonQuery();
                    returnValue = Convert.ToInt32(_sqlcommand.Parameters["@returnValue"].Value);
                }
                catch (Exception ex)
                {
                    Common.LogError(ex);
                }
                finally
                {
                    _sqlconnection.Close();
                    _sqlcommand.Dispose();
                }
            }
            return(returnValue);
        }
 public int Delete(BOMerchantLevel _bomerlvl)
 {
     return(_damerlvl.IUDMerchantLevel(_bomerlvl));
 }
 public int Insert(BOMerchantLevel _bomerlvl)
 {
     return(_damerlvl.IUDMerchantLevel(_bomerlvl));
 }
 public List <BOMerchantLevel> GetMerchantLevelList(BOMerchantLevel _bomerlvl)
 {
     return(_damerlvl.SelectMerchantLevelList(_bomerlvl));
 }