Ejemplo n.º 1
0
        protected override void Insert()
        {
            HPS.BLL.PlateCityBLL.BLLPlateCity_TFactory PlateCityFactory = new HPS.BLL.PlateCityBLL.BLLPlateCity_TFactory();
            try
            {
                HPS.BLL.PlateCityBLL.BLLPlateCity_T PlateCityEntity = new HPS.BLL.PlateCityBLL.BLLPlateCity_T();
                PlateCityEntity.PlateCityCode_nvc = Hepsa.Core.Common.PersentationController.GetEntityValue(PlateCityCode_nvcTextBox.Text, TypeCode.String).ToString();
                PlateCityEntity.PlateCity_nvc     = Hepsa.Core.Common.PersentationController.GetEntityValue(PlateCity_nvcTextBox.Text, TypeCode.String).ToString();
                PlateCityEntity.Active_bit        = Active_bitCheckBox.Checked;

                PlateCityFactory.BeginProc();
                PlateCityFactory.Insert(PlateCityEntity);
                PlateCityFactory.CommitProc();
                if (DataTable != null)
                {
                    DataRow dr = this.DataTable.NewRow();
                    dr[HPS.BLL.PlateCityBLL.BLLPlateCity_T.PlateCity_TField.PlateCityID_int.ToString()]   = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(PlateCityEntity.PlateCityID_int, TypeCode.Int32);
                    dr[HPS.BLL.PlateCityBLL.BLLPlateCity_T.PlateCity_TField.PlateCityCode_nvc.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(PlateCityEntity.PlateCityCode_nvc, TypeCode.String);
                    dr[HPS.BLL.PlateCityBLL.BLLPlateCity_T.PlateCity_TField.PlateCity_nvc.ToString()]     = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(PlateCityEntity.PlateCity_nvc, TypeCode.String);
                    dr[HPS.BLL.PlateCityBLL.BLLPlateCity_T.PlateCity_TField.Active_bit.ToString()]        = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(PlateCityEntity.Active_bit, TypeCode.Boolean);

                    DataTable.Rows.Add(dr);
                    DataTable.AcceptChanges();
                }
                this.ClearForm(this);
            }
            catch (Exception ex)
            {
                PlateCityFactory.RollBackProc();
                throw ex;
            }
        }
Ejemplo n.º 2
0
        protected override void Edit()
        {
            HPS.BLL.PlateCityBLL.BLLPlateCity_TFactory PlateCityFactory = new HPS.BLL.PlateCityBLL.BLLPlateCity_TFactory();
            try
            {
                HPS.BLL.PlateCityBLL.BLLPlateCity_T PlateCityEntity = new HPS.BLL.PlateCityBLL.BLLPlateCity_T();
                PlateCityEntity.PlateCityCode_nvc = Hepsa.Core.Common.PersentationController.GetEntityValue(PlateCityCode_nvcTextBox.Text, TypeCode.String).ToString();
                PlateCityEntity.PlateCity_nvc     = Hepsa.Core.Common.PersentationController.GetEntityValue(PlateCity_nvcTextBox.Text, TypeCode.String).ToString();
                PlateCityEntity.Active_bit        = Active_bitCheckBox.Checked;

                if (Hepsa.Core.Common.MessageBox.ConfirmMessage(HPS.Exceptions.ExceptionCs.EditMessage) == true)
                {
                    PlateCityFactory.BeginProc();
                    PlateCityFactory.Update(PlateCityEntity, (HPS.BLL.PlateCityBLL.BLLPlateCity_TKeys)Key);
                    PlateCityFactory.CommitProc();
                    if (DataTable != null)
                    {
                        DataRow[] dr = DataTable.Select(HPS.BLL.PlateCityBLL.BLLPlateCity_T.PlateCity_TField.PlateCityID_int.ToString() + "='" + ((HPS.BLL.PlateCityBLL.BLLPlateCity_TKeys)Key).PlateCityID_int.ToString() + "'");
                        if (dr.Length > 0)
                        {
                            dr[0][HPS.BLL.PlateCityBLL.BLLPlateCity_T.PlateCity_TField.PlateCityCode_nvc.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(PlateCityEntity.PlateCityCode_nvc, TypeCode.String);
                            dr[0][HPS.BLL.PlateCityBLL.BLLPlateCity_T.PlateCity_TField.PlateCity_nvc.ToString()]     = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(PlateCityEntity.PlateCity_nvc, TypeCode.String);
                            dr[0][HPS.BLL.PlateCityBLL.BLLPlateCity_T.PlateCity_TField.Active_bit.ToString()]        = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(PlateCityEntity.Active_bit, TypeCode.Boolean);
                        }
                        DataTable.AcceptChanges();
                    }
                }
            }
            catch (Exception ex)
            {
                PlateCityFactory.RollBackProc();
                throw ex;
            }
        }
Ejemplo n.º 3
0
        protected override void Delete()
        {
            HPS.BLL.PlateCityBLL.BLLPlateCity_TFactory PlateCityFactory = new HPS.BLL.PlateCityBLL.BLLPlateCity_TFactory();

            try
            {
                if (Hepsa.Core.Common.MessageBox.ConfirmMessage(HPS.Exceptions.ExceptionCs.DeleteMessage) == true)
                {
                    PlateCityFactory.BeginProc();
                    PlateCityFactory.Delete((HPS.BLL.PlateCityBLL.BLLPlateCity_TKeys)Key);
                    PlateCityFactory.CommitProc();
                    if (DataTable != null)
                    {
                        DataRow[] dr = DataTable.Select(HPS.BLL.PlateCityBLL.BLLPlateCity_T.PlateCity_TField.PlateCityID_int.ToString() + "='" + ((HPS.BLL.PlateCityBLL.BLLPlateCity_TKeys)Key).PlateCityID_int.ToString() + "'");
                        if (dr.Length > 0)
                        {
                            dr[0].Delete();
                        }
                        DataTable.AcceptChanges();
                    }
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                PlateCityFactory.RollBackProc();
                throw ex;
            }
        }
Ejemplo n.º 4
0
 private void TransferPlateCity(string FilePath, string TableName)
 {
     HPS.BLL.PlateCityBLL.BLLPlateCity_TFactory PlateCityFactory = new HPS.BLL.PlateCityBLL.BLLPlateCity_TFactory();
     try
     {
         PlateCityFactory.BeginProc();
         PlateCityFactory.TransferData(FilePath, TableName);
         PlateCityFactory.CommitProc();
     }
     catch (Exception ex)
     {
         PlateCityFactory.RollBackProc();
         throw ex;
     }
 }