コード例 #1
0
        protected override void Insert()
        {
            HPS.BLL.TrafficTypeBLL.BLLTrafficType_TFactory TrafficTypeFactory = new HPS.BLL.TrafficTypeBLL.BLLTrafficType_TFactory();
            try
            {
                HPS.BLL.TrafficTypeBLL.BLLTrafficType_T TrafficTypeEntity = new HPS.BLL.TrafficTypeBLL.BLLTrafficType_T();
                TrafficTypeEntity.TrafficType_nvc = Hepsa.Core.Common.PersentationController.GetEntityValue(TrafficType_nvcTextBox.Text, TypeCode.String).ToString();

                TrafficTypeFactory.BeginProc();
                TrafficTypeFactory.Insert(TrafficTypeEntity);
                TrafficTypeFactory.CommitProc();
                if (DataTable != null)
                {
                    DataRow dr = this.DataTable.NewRow();
                    dr[HPS.BLL.TrafficTypeBLL.BLLTrafficType_T.TrafficType_TField.TrafficTypeID_int.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(TrafficTypeEntity.TrafficTypeID_int, TypeCode.Int32);
                    dr[HPS.BLL.TrafficTypeBLL.BLLTrafficType_T.TrafficType_TField.TrafficType_nvc.ToString()]   = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(TrafficTypeEntity.TrafficType_nvc, TypeCode.String);

                    DataTable.Rows.Add(dr);
                    DataTable.AcceptChanges();
                }
                this.ClearForm(this);
            }
            catch (Exception ex)
            {
                TrafficTypeFactory.RollBackProc();
                throw ex;
            }
        }
コード例 #2
0
        protected override void Edit()
        {
            HPS.BLL.TrafficTypeBLL.BLLTrafficType_TFactory TrafficTypeFactory = new HPS.BLL.TrafficTypeBLL.BLLTrafficType_TFactory();
            try
            {
                HPS.BLL.TrafficTypeBLL.BLLTrafficType_T TrafficTypeEntity = new HPS.BLL.TrafficTypeBLL.BLLTrafficType_T();
                TrafficTypeEntity.TrafficType_nvc = Hepsa.Core.Common.PersentationController.GetEntityValue(TrafficType_nvcTextBox.Text, TypeCode.String).ToString();


                if (Hepsa.Core.Common.MessageBox.ConfirmMessage(HPS.Exceptions.ExceptionCs.EditMessage) == true)
                {
                    TrafficTypeFactory.BeginProc();
                    TrafficTypeFactory.Update(TrafficTypeEntity, (HPS.BLL.TrafficTypeBLL.BLLTrafficType_TKeys)Key);
                    TrafficTypeFactory.CommitProc();
                    if (DataTable != null)
                    {
                        DataRow[] dr = DataTable.Select(HPS.BLL.TrafficTypeBLL.BLLTrafficType_T.TrafficType_TField.TrafficTypeID_int.ToString() + "='" + ((HPS.BLL.TrafficTypeBLL.BLLTrafficType_TKeys)Key).TrafficTypeID_int.ToString() + "'");
                        if (dr.Length > 0)
                        {
                            dr[0][HPS.BLL.TrafficTypeBLL.BLLTrafficType_T.TrafficType_TField.TrafficType_nvc.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(TrafficTypeEntity.TrafficType_nvc, TypeCode.String);
                        }
                        DataTable.AcceptChanges();
                    }
                }
            }
            catch (Exception ex)
            {
                TrafficTypeFactory.RollBackProc();
                throw ex;
            }
        }
コード例 #3
0
        protected override void Delete()
        {
            HPS.BLL.TrafficTypeBLL.BLLTrafficType_TFactory TrafficTypeFactory = new HPS.BLL.TrafficTypeBLL.BLLTrafficType_TFactory();

            try
            {
                if (Hepsa.Core.Common.MessageBox.ConfirmMessage(HPS.Exceptions.ExceptionCs.DeleteMessage) == true)
                {
                    TrafficTypeFactory.BeginProc();
                    TrafficTypeFactory.Delete((HPS.BLL.TrafficTypeBLL.BLLTrafficType_TKeys)Key);
                    TrafficTypeFactory.CommitProc();
                    if (DataTable != null)
                    {
                        DataRow[] dr = DataTable.Select(HPS.BLL.TrafficTypeBLL.BLLTrafficType_T.TrafficType_TField.TrafficTypeID_int.ToString() + "='" + ((HPS.BLL.TrafficTypeBLL.BLLTrafficType_TKeys)Key).TrafficTypeID_int.ToString() + "'");
                        if (dr.Length > 0)
                        {
                            dr[0].Delete();
                        }
                        DataTable.AcceptChanges();
                    }
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                TrafficTypeFactory.RollBackProc();
                throw ex;
            }
        }