コード例 #1
0
 public void GetBy(HPS.BLL.PriceNormBLL.BLLPriceNorm_TKeys keys, ref System.Data.DataTable dataTable)
 {
     try{
         _dataObject.SelectByPrimaryKey(keys, ref dataTable);
     }catch (System.Exception ex) {
         throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this);
     }
 }
コード例 #2
0
 public HPS.BLL.PriceNormBLL.BLLPriceNorm_T GetBy(HPS.BLL.PriceNormBLL.BLLPriceNorm_TKeys keys)
 {
     try{
         return(_dataObject.SelectByPrimaryKey(keys));
     }catch (System.Exception ex) {
         throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this);
     }
 }
コード例 #3
0
 public void Delete(HPS.BLL.PriceNormBLL.BLLPriceNorm_TKeys keys)
 {
     try{
         _dataObject.Delete(keys);
     }catch (System.Exception ex) {
         throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this);
     }
 }
コード例 #4
0
        public HPS.BLL.PriceNormBLL.BLLPriceNorm_T SelectByPrimaryKey(HPS.BLL.PriceNormBLL.BLLPriceNorm_TKeys businessObjectKey)
        {
            bool ControlConnection = !(this.ConnectionState == System.Data.ConnectionState.Open);

            this.Command.CommandText = "[sp_PriceNorm_T_SelectByPrimaryKey]";
            this.Command.CommandType = CommandType.StoredProcedure;

            try{
                this.Command.Parameters.Clear();

                SqlParameter PriceNormID_int = new SqlParameter();
                PriceNormID_int.ParameterName = "@PriceNormID_int";
                PriceNormID_int.SqlDbType     = SqlDbType.Int;
                PriceNormID_int.Direction     = ParameterDirection.Input;
                PriceNormID_int.IsNullable    = false;
                PriceNormID_int.Value         = businessObjectKey.PriceNormID_int;
                this.Command.Parameters.Add(PriceNormID_int);



                if (ControlConnection)
                {
                    this.BeginTransaction();
                }

                IDataReader dataReader = this.Command.ExecuteReader();
                HPS.BLL.PriceNormBLL.BLLPriceNorm_T businessObject = new HPS.BLL.PriceNormBLL.BLLPriceNorm_T();
                if (dataReader.Read())
                {
                    PopulateBusinessObjectFromReader(businessObject, dataReader);
                }
                else
                {
                    businessObject = null;
                }

                if (dataReader.IsClosed == false)
                {
                    dataReader.Close();
                }


                if (ControlConnection)
                {
                    this.Commit();
                }
                return(businessObject);
            }
            catch (System.Exception ex) {
                if (ControlConnection)
                {
                    this.RollBack();
                }
                throw ex;
            }
        }
コード例 #5
0
        public void SelectByPrimaryKey(HPS.BLL.PriceNormBLL.BLLPriceNorm_TKeys businessObjectKey, ref System.Data.DataTable dataTable)
        {
            bool           ControlConnection = !(this.ConnectionState == System.Data.ConnectionState.Open);
            SqlDataAdapter sqlDataAdapter    = new System.Data.SqlClient.SqlDataAdapter(this.Command);

            this.Command.CommandText = "[sp_PriceNorm_T_SelectByPrimaryKey]";
            this.Command.CommandType = CommandType.StoredProcedure;

            try{
                this.Command.Parameters.Clear();

                SqlParameter PriceNormID_int = new SqlParameter();
                PriceNormID_int.ParameterName = "@PriceNormID_int";
                PriceNormID_int.SqlDbType     = SqlDbType.Int;
                PriceNormID_int.Direction     = ParameterDirection.Input;
                PriceNormID_int.IsNullable    = false;
                PriceNormID_int.Value         = businessObjectKey.PriceNormID_int;
                this.Command.Parameters.Add(PriceNormID_int);



                if (ControlConnection)
                {
                    this.BeginTransaction();
                }

                sqlDataAdapter.Fill(dataTable);

                if (ControlConnection)
                {
                    this.Commit();
                }
            }
            catch (System.Exception ex) {
                if (ControlConnection)
                {
                    this.RollBack();
                }
                throw ex;
            }
        }
コード例 #6
0
        public void Update(HPS.BLL.PriceNormBLL.BLLPriceNorm_T businessObject, HPS.BLL.PriceNormBLL.BLLPriceNorm_TKeys businessObjectKey)
        {
            try{
                if (businessObject.PriceNormID_int == businessObjectKey.PriceNormID_int)
                {
                    if (businessObject.IsValid(Hepsa.Core.Validation.ValidationExceptionType.Except, "UniquePriceNormID_int") == false)
                    {
                        throw new Hepsa.Core.Validation.InvalidBusinessObjectException(businessObject.BrokenRulesList().ToString());
                    }
                }
                else
                {
                    if (businessObject.IsValid() == false)
                    {
                        throw new Hepsa.Core.Validation.InvalidBusinessObjectException(businessObject.BrokenRulesList().ToString());
                    }
                }

                _dataObject.Update(businessObject, businessObjectKey);
            }catch (System.Exception ex) {
                throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this);
            }
        }
コード例 #7
0
        public void Update(HPS.BLL.PriceNormBLL.BLLPriceNorm_T businessObject, HPS.BLL.PriceNormBLL.BLLPriceNorm_TKeys businessObjectKey)
        {
            bool ControlConnection = !(this.ConnectionState == System.Data.ConnectionState.Open);

            this.Command.CommandText = "[sp_PriceNorm_T_Update]";
            this.Command.CommandType = CommandType.StoredProcedure;

            try{
                this.Command.Parameters.Clear();

                SqlParameter CityID_int = new SqlParameter();
                CityID_int.ParameterName = "@CityID_int";
                CityID_int.SqlDbType     = SqlDbType.Int;
                CityID_int.Direction     = ParameterDirection.Input;
                CityID_int.IsNullable    = false;
                CityID_int.Value         = businessObject.CityID_int;
                this.Command.Parameters.Add(CityID_int);

                SqlParameter LaderTypeID_int = new SqlParameter();
                LaderTypeID_int.ParameterName = "@LaderTypeID_int";
                LaderTypeID_int.SqlDbType     = SqlDbType.Int;
                LaderTypeID_int.Direction     = ParameterDirection.Input;
                LaderTypeID_int.IsNullable    = false;
                LaderTypeID_int.Value         = businessObject.LaderTypeID_int;
                this.Command.Parameters.Add(LaderTypeID_int);

                SqlParameter GoodID_int = new SqlParameter();
                GoodID_int.ParameterName = "@GoodID_int";
                GoodID_int.SqlDbType     = SqlDbType.Int;
                GoodID_int.Direction     = ParameterDirection.Input;
                GoodID_int.IsNullable    = false;
                if (businessObject.GoodID_int.HasValue == false)
                {
                    GoodID_int.Value = DBNull.Value;
                }
                else
                {
                    GoodID_int.Value = businessObject.GoodID_int;
                }
                this.Command.Parameters.Add(GoodID_int);

                SqlParameter Price_dec = new SqlParameter();
                Price_dec.ParameterName = "@Price_dec";
                Price_dec.SqlDbType     = SqlDbType.Decimal;
                Price_dec.Direction     = ParameterDirection.Input;
                Price_dec.IsNullable    = true;
                if (businessObject.Price_dec.HasValue == false)
                {
                    Price_dec.Value = DBNull.Value;
                }
                else
                {
                    Price_dec.Value = businessObject.Price_dec;
                }
                this.Command.Parameters.Add(Price_dec);

                SqlParameter OldPrice_dec = new SqlParameter();
                OldPrice_dec.ParameterName = "@OldPrice_dec";
                OldPrice_dec.SqlDbType     = SqlDbType.Decimal;
                OldPrice_dec.Direction     = ParameterDirection.Input;
                OldPrice_dec.IsNullable    = true;
                if (businessObject.OldPrice_dec.HasValue == false)
                {
                    OldPrice_dec.Value = DBNull.Value;
                }
                else
                {
                    OldPrice_dec.Value = businessObject.OldPrice_dec;
                }
                this.Command.Parameters.Add(OldPrice_dec);

                SqlParameter CreateDate_nvc = new SqlParameter();
                CreateDate_nvc.ParameterName = "@CreateDate_nvc";
                CreateDate_nvc.SqlDbType     = SqlDbType.NVarChar;
                CreateDate_nvc.Direction     = ParameterDirection.Input;
                CreateDate_nvc.IsNullable    = true;
                if (String.IsNullOrEmpty(businessObject.CreateDate_nvc))
                {
                    CreateDate_nvc.Value = DBNull.Value;
                }
                else
                {
                    CreateDate_nvc.Value = businessObject.CreateDate_nvc;
                }
                this.Command.Parameters.Add(CreateDate_nvc);

                SqlParameter UpdateDate_nvc = new SqlParameter();
                UpdateDate_nvc.ParameterName = "@UpdateDate_nvc";
                UpdateDate_nvc.SqlDbType     = SqlDbType.NVarChar;
                UpdateDate_nvc.Direction     = ParameterDirection.Input;
                UpdateDate_nvc.IsNullable    = true;
                if (String.IsNullOrEmpty(businessObject.UpdateDate_nvc))
                {
                    UpdateDate_nvc.Value = DBNull.Value;
                }
                else
                {
                    UpdateDate_nvc.Value = businessObject.UpdateDate_nvc;
                }
                this.Command.Parameters.Add(UpdateDate_nvc);

                SqlParameter OriginCityID_int = new SqlParameter();
                OriginCityID_int.ParameterName = "@OriginCityID_int";
                OriginCityID_int.SqlDbType     = SqlDbType.Int;
                OriginCityID_int.Direction     = ParameterDirection.Input;
                OriginCityID_int.IsNullable    = true;
                if (businessObject.OriginCityID_int.HasValue == false)
                {
                    OriginCityID_int.Value = DBNull.Value;
                }
                else
                {
                    OriginCityID_int.Value = businessObject.OriginCityID_int;
                }
                this.Command.Parameters.Add(OriginCityID_int);


                SqlParameter pk_PriceNormID_int = new SqlParameter();
                pk_PriceNormID_int.ParameterName = "@pk_PriceNormID_int";
                pk_PriceNormID_int.SqlDbType     = SqlDbType.Int;
                pk_PriceNormID_int.Direction     = ParameterDirection.Input;
                pk_PriceNormID_int.IsNullable    = false;
                pk_PriceNormID_int.Value         = businessObjectKey.PriceNormID_int;
                this.Command.Parameters.Add(pk_PriceNormID_int);



                if (ControlConnection)
                {
                    this.BeginTransaction();
                }

                this.Command.ExecuteNonQuery();

                if (ControlConnection)
                {
                    this.Commit();
                }
            }
            catch (System.Exception ex) {
                if (ControlConnection)
                {
                    this.RollBack();
                }
                throw ex;
            }
        }