Beispiel #1
0
        private void DeleteButton_Click(object sender, EventArgs e)
        {
            HPS.BLL.LadBillCancelCommentBLL.BLLLadBillCancelComment_TFactory LadBillCancelCommentFactory = new HPS.BLL.LadBillCancelCommentBLL.BLLLadBillCancelComment_TFactory();

            try
            {
                if (Hepsa.Core.Common.MessageBox.ConfirmDeleteMessage() == false)
                {
                    return;
                }


                HPS.BLL.LadBillCancelCommentBLL.BLLLadBillCancelComment_TFactory LadBillCancelComment_TFactory = new HPS.BLL.LadBillCancelCommentBLL.BLLLadBillCancelComment_TFactory();
                HPS.BLL.LadBillCancelCommentBLL.BLLLadBillCancelComment_TKeys    LadBillCancelCommentKey       = new HPS.BLL.LadBillCancelCommentBLL.BLLLadBillCancelComment_TKeys();

                LadBillCancelCommentKey.LadBillCancelCommentID_int = (Int32)LadBillCancelCommentGridView.CurrentRow.Cells["colLadBillCancelCommentID_int"].Value;
                LadBillCancelCommentFactory.Delete(LadBillCancelCommentKey);

                DataRow[] dr = ((DataTable)this.LadBillCancelCommentGridView.DataSource).Select(HPS.BLL.LadBillCancelCommentBLL.BLLLadBillCancelComment_T.LadBillCancelComment_TField.LadBillCancelCommentID_int.ToString() + "='" + LadBillCancelCommentKey.LadBillCancelCommentID_int.ToString() + "'");
                if (dr.Length > 0)
                {
                    dr[0].Delete();
                }
                ((DataTable)this.LadBillCancelCommentGridView.DataSource).AcceptChanges();
            }

            catch (Exception ex)
            {
                Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message);
            }
        }
Beispiel #2
0
        private void EditButton_Click(object sender, EventArgs e)
        {
            HPS.BLL.LadBillCancelCommentBLL.BLLLadBillCancelComment_TKeys LadBillCancelCommentKey = new HPS.BLL.LadBillCancelCommentBLL.BLLLadBillCancelComment_TKeys();
            LadBillCancelCommentKey.LadBillCancelCommentID_int = (Int32)this.LadBillCancelCommentGridView.CurrentRow.Cells["colLadBillCancelCommentID_int"].Value;
            LadBillCancelCommentEntityForm LadBillCancelComment = new LadBillCancelCommentEntityForm(BaseEntityForm1.enmState.Edit, (DataTable)this.LadBillCancelCommentGridView.DataSource, LadBillCancelCommentKey);

            LadBillCancelComment.ShowDialog();
        }
Beispiel #3
0
 public void GetBy(HPS.BLL.LadBillCancelCommentBLL.BLLLadBillCancelComment_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);
     }
 }
Beispiel #4
0
 public HPS.BLL.LadBillCancelCommentBLL.BLLLadBillCancelComment_T GetBy(HPS.BLL.LadBillCancelCommentBLL.BLLLadBillCancelComment_TKeys keys)
 {
     try
     {
         return(_dataObject.SelectByPrimaryKey(keys));
     }
     catch (System.Exception ex)
     {
         throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this);
     }
 }
Beispiel #5
0
 public void Delete(HPS.BLL.LadBillCancelCommentBLL.BLLLadBillCancelComment_TKeys keys)
 {
     try
     {
         _dataObject.Delete(keys);
     }
     catch (System.Exception ex)
     {
         throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this);
     }
 }
Beispiel #6
0
        public void SelectByPrimaryKey(HPS.BLL.LadBillCancelCommentBLL.BLLLadBillCancelComment_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_LadBillCancelComment_T_SelectByPrimaryKey]";
            this.Command.CommandType = CommandType.StoredProcedure;

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

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



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

                sqlDataAdapter.Fill(dataTable);

                if (ControlConnection)
                {
                    this.Commit();
                }
            }
            catch (System.Exception ex)
            {
                if (ControlConnection)
                {
                    this.RollBack();
                }
                throw ex;
            }
        }
Beispiel #7
0
        public void Update(HPS.BLL.LadBillCancelCommentBLL.BLLLadBillCancelComment_T businessObject, HPS.BLL.LadBillCancelCommentBLL.BLLLadBillCancelComment_TKeys businessObjectKey)
        {
            try
            {
                if (businessObject.LadBillCancelCommentID_int == businessObjectKey.LadBillCancelCommentID_int)
                {
                    if (businessObject.IsValid(Hepsa.Core.Validation.ValidationExceptionType.Except, "UniqueLadBillCancelCommentID_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);
            }
        }
Beispiel #8
0
 public LadBillCancelCommentEntityForm(Hepsa.Core.PL.BaseEntityParentForm.enmState State, DataTable DataTable, HPS.BLL.LadBillCancelCommentBLL.BLLLadBillCancelComment_TKeys Key)
     : base(State, DataTable, Key)
 {
     InitializeComponent();
 }
Beispiel #9
0
        public void Update(HPS.BLL.LadBillCancelCommentBLL.BLLLadBillCancelComment_T businessObject, HPS.BLL.LadBillCancelCommentBLL.BLLLadBillCancelComment_TKeys businessObjectKey)
        {
            bool ControlConnection = !(this.ConnectionState == System.Data.ConnectionState.Open);

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

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

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

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


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



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

                this.Command.ExecuteNonQuery();

                if (ControlConnection)
                {
                    this.Commit();
                }
            }
            catch (System.Exception ex)
            {
                if (ControlConnection)
                {
                    this.RollBack();
                }
                throw ex;
            }
        }
Beispiel #10
0
        public HPS.BLL.LadBillCancelCommentBLL.BLLLadBillCancelComment_T SelectByPrimaryKey(HPS.BLL.LadBillCancelCommentBLL.BLLLadBillCancelComment_TKeys businessObjectKey)
        {
            bool ControlConnection = !(this.ConnectionState == System.Data.ConnectionState.Open);

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

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

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



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

                IDataReader dataReader = this.Command.ExecuteReader();
                HPS.BLL.LadBillCancelCommentBLL.BLLLadBillCancelComment_T businessObject = new HPS.BLL.LadBillCancelCommentBLL.BLLLadBillCancelComment_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;
            }
        }