Esempio n. 1
0
        //public void Insert(HPS.BLL.ITS.BLLITS_T businessObject)
        //{
        //    try
        //    {
        //        if (businessObject.IsValid(Hepsa.Core.Validation.ValidationExceptionType.Except, "UniqueITSID_bint") == false)
        //        {
        //            throw new HPS.Validation.InvalidBusinessObjectException(businessObject.BrokenRulesList().ToString());
        //        }

        //        _dataObject.Insert(businessObject);
        //    }
        //    catch (System.Exception ex)
        //    {
        //        throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this);
        //    }
        //}

        //public void Update(HPS.BLL.ITS.BLLITS_T businessObject, HPS.BLL.ITS.BLLITS_TKeys businessObjectKey)
        //{
        //    try
        //    {
        //        List<string> ExceptList = new List<string>();
        //        if (businessObject.ITSID_bint == businessObjectKey.ITSID_bint)
        //        {
        //            ExceptList.Add("UniqueITSID_bint");
        //        }
        //        if (businessObject.IsValid(Hepsa.Core.Validation.ValidationExceptionType.Except, ExceptList.ToArray()) == false)
        //        {
        //            throw new HPS.Validation.InvalidBusinessObjectException(businessObject.BrokenRulesList().ToString());
        //        }

        //        _dataObject.Update(businessObject, businessObjectKey);
        //    }
        //    catch (System.Exception ex)
        //    {
        //        throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this);
        //    }
        //}

        //public HPS.BLL.ITS.BLLITS_T GetBy(HPS.BLL.ITS.BLLITS_TKeys keys)
        //{
        //    try
        //    {
        //        return _dataObject.SelectByPrimaryKey(keys);
        //    }
        //    catch (System.Exception ex)
        //    {
        //        throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this);
        //    }
        //}

        //public void GetBy(HPS.BLL.ITS.BLLITS_TKeys keys, ref  System.Data.DataSet dataSet, String srcTable)
        //{
        //    try
        //    {
        //        _dataObject.SelectByPrimaryKey(keys, ref dataSet, srcTable);
        //    }
        //    catch (System.Exception ex)
        //    {
        //        throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this);
        //    }
        //}

        public void GetBy(HPS.BLL.ITS.BLLITS_TKeys keys, ref System.Data.DataSet dataSet)
        {
            try
            {
                _dataObject.SelectByPrimaryKey(keys, ref dataSet);
            }
            catch (System.Exception ex)
            {
                throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this);
            }
        }
Esempio n. 2
0
 public void Delete(HPS.BLL.ITS.BLLITS_TKeys keys)
 {
     try
     {
         _dataObject.Delete(keys);
     }
     catch (System.Exception ex)
     {
         throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this);
     }
 }
Esempio n. 3
0
        public void SelectByPrimaryKey(HPS.BLL.ITS.BLLITS_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_ITS_T_SelectByPrimaryKey]";
            this.Command.CommandType = CommandType.StoredProcedure;

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

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



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

                sqlDataAdapter.Fill(dataTable);

                if (ControlConnection)
                {
                    this.Commit();
                }
            }
            catch (System.Exception ex)
            {
                if (ControlConnection)
                {
                    this.RollBack();
                }
                throw ex;
            }
        }
Esempio n. 4
0
        public void Update(HPS.BLL.ITS.BLLITS_T businessObject, HPS.BLL.ITS.BLLITS_TKeys businessObjectKey)
        {
            bool ControlConnection = !(this.ConnectionState == System.Data.ConnectionState.Open);

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

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

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

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

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

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

                SqlParameter NumberPlate_nvc = new SqlParameter();
                NumberPlate_nvc.ParameterName = "@NumberPlate_nvc";
                NumberPlate_nvc.SqlDbType     = SqlDbType.NVarChar;
                NumberPlate_nvc.Direction     = ParameterDirection.Input;
                NumberPlate_nvc.IsNullable    = true;
                NumberPlate_nvc.Value         = businessObject.NumberPlate_nvc;
                this.Command.Parameters.Add(NumberPlate_nvc);

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


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



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

                this.Command.ExecuteNonQuery();

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