Ejemplo n.º 1
0
        protected override void Insert()
        {
            HPS.BLL.PortPlacesBLL.BLLPortPlaces_TFactory PortPlacesFactory = new HPS.BLL.PortPlacesBLL.BLLPortPlaces_TFactory();
            try
            {
                HPS.BLL.PortPlacesBLL.BLLPortPlaces_T PortPlacesEntity = new HPS.BLL.PortPlacesBLL.BLLPortPlaces_T();
                PortPlacesEntity.PortPlaces_nvc = Hepsa.Core.Common.PersentationController.GetEntityValue(PortPlaces_nvcTextBox.Text, TypeCode.String).ToString();
                PortPlacesEntity.Active_bit     = Active_bitCheckBox.Checked;

                PortPlacesFactory.BeginProc();
                PortPlacesFactory.Insert(PortPlacesEntity);
                PortPlacesFactory.CommitProc();
                if (DataTable != null)
                {
                    DataRow dr = this.DataTable.NewRow();
                    dr[HPS.BLL.PortPlacesBLL.BLLPortPlaces_T.PortPlaces_TField.PortPlacesID_int.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(PortPlacesEntity.PortPlacesID_int, TypeCode.Int32);
                    dr[HPS.BLL.PortPlacesBLL.BLLPortPlaces_T.PortPlaces_TField.PortPlaces_nvc.ToString()]   = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(PortPlacesEntity.PortPlaces_nvc, TypeCode.String);
                    dr[HPS.BLL.PortPlacesBLL.BLLPortPlaces_T.PortPlaces_TField.Active_bit.ToString()]       = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(PortPlacesEntity.Active_bit, TypeCode.Boolean);

                    DataTable.Rows.Add(dr);
                    DataTable.AcceptChanges();
                }
                this.ClearForm(this);
            }
            catch (Exception ex)
            {
                PortPlacesFactory.RollBackProc();
                throw ex;
            }
        }
Ejemplo n.º 2
0
        protected override void Edit()
        {
            HPS.BLL.PortPlacesBLL.BLLPortPlaces_TFactory PortPlacesFactory = new HPS.BLL.PortPlacesBLL.BLLPortPlaces_TFactory();
            try
            {
                HPS.BLL.PortPlacesBLL.BLLPortPlaces_T PortPlacesEntity = new HPS.BLL.PortPlacesBLL.BLLPortPlaces_T();
                PortPlacesEntity.PortPlaces_nvc = Hepsa.Core.Common.PersentationController.GetEntityValue(PortPlaces_nvcTextBox.Text, TypeCode.String).ToString();
                PortPlacesEntity.Active_bit     = Active_bitCheckBox.Checked;

                if (Hepsa.Core.Common.MessageBox.ConfirmMessage(HPS.Exceptions.ExceptionCs.EditMessage) == true)
                {
                    PortPlacesFactory.BeginProc();
                    PortPlacesFactory.Update(PortPlacesEntity, (HPS.BLL.PortPlacesBLL.BLLPortPlaces_TKeys)Key);
                    PortPlacesFactory.CommitProc();
                    if (DataTable != null)
                    {
                        DataRow[] dr = DataTable.Select(HPS.BLL.PortPlacesBLL.BLLPortPlaces_T.PortPlaces_TField.PortPlacesID_int.ToString() + "='" + ((HPS.BLL.PortPlacesBLL.BLLPortPlaces_TKeys)Key).PortPlacesID_int.ToString() + "'");
                        if (dr.Length > 0)
                        {
                            dr[0][HPS.BLL.PortPlacesBLL.BLLPortPlaces_T.PortPlaces_TField.PortPlaces_nvc.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(PortPlacesEntity.PortPlaces_nvc, TypeCode.String);
                            dr[0][HPS.BLL.PortPlacesBLL.BLLPortPlaces_T.PortPlaces_TField.Active_bit.ToString()]     = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(PortPlacesEntity.Active_bit, TypeCode.Boolean);
                        }
                        DataTable.AcceptChanges();
                    }
                }
            }
            catch (Exception ex)
            {
                PortPlacesFactory.RollBackProc();
                throw ex;
            }
        }
Ejemplo n.º 3
0
        protected override void Delete()
        {
            HPS.BLL.PortPlacesBLL.BLLPortPlaces_TFactory PortPlacesFactory = new HPS.BLL.PortPlacesBLL.BLLPortPlaces_TFactory();

            try
            {
                if (Hepsa.Core.Common.MessageBox.ConfirmMessage(HPS.Exceptions.ExceptionCs.DeleteMessage) == true)
                {
                    PortPlacesFactory.BeginProc();
                    PortPlacesFactory.Delete((HPS.BLL.PortPlacesBLL.BLLPortPlaces_TKeys)Key);
                    PortPlacesFactory.CommitProc();
                    if (DataTable != null)
                    {
                        DataRow[] dr = DataTable.Select(HPS.BLL.PortPlacesBLL.BLLPortPlaces_T.PortPlaces_TField.PortPlacesID_int.ToString() + "='" + ((HPS.BLL.PortPlacesBLL.BLLPortPlaces_TKeys)Key).PortPlacesID_int.ToString() + "'");
                        if (dr.Length > 0)
                        {
                            dr[0].Delete();
                        }
                        DataTable.AcceptChanges();
                    }
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                PortPlacesFactory.RollBackProc();
                throw ex;
            }
        }