Пример #1
0
        protected override void Delete()
        {
            BLL.VerifiedCarsBLL.BLLVerifiedCars_TFactory VerifiedCarsFactory = new BLL.VerifiedCarsBLL.BLLVerifiedCars_TFactory();

            try
            {
                if (Hepsa.Core.Common.MessageBox.ConfirmMessage(HPS.Exceptions.ExceptionCs.DeleteMessage) == true)
                {
                    VerifiedCarsFactory.BeginProc();
                    VerifiedCarsFactory.Delete((BLL.VerifiedCarsBLL.BLLVerifiedCars_TKeys)Key);
                    VerifiedCarsFactory.CommitProc();
                    if (DataTable != null)
                    {
                        DataRow[] dr = DataTable.Select(BLL.VerifiedCarsBLL.BLLVerifiedCars_T.VerifiedCars_TField.VerifiedCarID_int.ToString() + "='" + ((BLL.VerifiedCarsBLL.BLLVerifiedCars_TKeys)Key).VerifiedCarID_int.ToString() + "'");
                        if (dr.Length > 0)
                        {
                            dr[0].Delete();
                        }
                        DataTable.AcceptChanges();
                    }
                    this.Close();
                }
            }
            catch (System.Exception ex)
            {
                VerifiedCarsFactory.RollBackProc();
                throw ex;
            }
        }
Пример #2
0
        protected override void Edit()
        {
            BLL.VerifiedCarsBLL.BLLVerifiedCars_TFactory VerifiedCarsFactory = new BLL.VerifiedCarsBLL.BLLVerifiedCars_TFactory();

            try
            {
                BLL.VerifiedCarsBLL.BLLVerifiedCars_T VerifiedCarsEntity = VerifiedCarsFactory.GetBy((BLL.VerifiedCarsBLL.BLLVerifiedCars_TKeys)Key);
                //if (VerifiedCarsEntity == null)
                //    throw new TBZRMTO.Exception.VerifiedCarsNotFound();
                VerifiedCarsEntity.NumberPlate_nvc = Hepsa.Core.Common.PersentationController.GetEntityValue(NumberPlate_nvcTextBox.Text, TypeCode.String).ToString();
                VerifiedCarsEntity.SerialPlate_nvc = Hepsa.Core.Common.PersentationController.GetEntityValue(SerialPlate_nvcTextBox.Text, TypeCode.String).ToString();
                VerifiedCarsEntity.CompanyID_int   = Convert.ToInt32(CompanyID_intComboBox.SelectedValue);
                VerifiedCarsEntity.FullName_nvc    = Hepsa.Core.Common.PersentationController.GetEntityValue(FullName_nvcTextBox.Text, TypeCode.String).ToString();
                VerifiedCarsEntity.Unit_nvc        = Hepsa.Core.Common.PersentationController.GetEntityValue(Unit_nvcTextBox.Text, TypeCode.String).ToString();

                if (Hepsa.Core.Common.MessageBox.ConfirmMessage(HPS.Exceptions.ExceptionCs.EditMessage) == true)
                {
                    VerifiedCarsFactory.BeginProc();
                    VerifiedCarsFactory.Update(VerifiedCarsEntity, (BLL.VerifiedCarsBLL.BLLVerifiedCars_TKeys)Key);
                    VerifiedCarsFactory.CommitProc();
                    if (DataTable != null)
                    {
                        DataRow[] dr = DataTable.Select(BLL.VerifiedCarsBLL.BLLVerifiedCars_T.VerifiedCars_TField.VerifiedCarID_int.ToString() + "='" + ((BLL.VerifiedCarsBLL.BLLVerifiedCars_TKeys)Key).VerifiedCarID_int.ToString() + "'");
                        if (dr.Length > 0)
                        {
                            dr[0][BLL.VerifiedCarsBLL.BLLVerifiedCars_T.VerifiedCars_TField.VerifiedCarID_int.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(VerifiedCarsEntity.VerifiedCarID_int, TypeCode.Int32);
                            dr[0][BLL.VerifiedCarsBLL.BLLVerifiedCars_T.VerifiedCars_TField.NumberPlate_nvc.ToString()]   = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(VerifiedCarsEntity.NumberPlate_nvc, TypeCode.String);
                            dr[0][BLL.VerifiedCarsBLL.BLLVerifiedCars_T.VerifiedCars_TField.SerialPlate_nvc.ToString()]   = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(VerifiedCarsEntity.SerialPlate_nvc, TypeCode.String);
                            dr[0]["Company_nvc"] = Hepsa.Core.Common.PersentationController.GetComboBoxDisplayMember(CompanyID_intComboBox);
                            dr[0][BLL.VerifiedCarsBLL.BLLVerifiedCars_T.VerifiedCars_TField.FullName_nvc.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(VerifiedCarsEntity.FullName_nvc, TypeCode.String);
                            dr[0][BLL.VerifiedCarsBLL.BLLVerifiedCars_T.VerifiedCars_TField.Unit_nvc.ToString()]     = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(VerifiedCarsEntity.Unit_nvc, TypeCode.String);
                        }
                        DataTable.AcceptChanges();
                    }
                }
            }
            catch (System.Exception ex)
            {
                VerifiedCarsFactory.RollBackProc();
                throw ex;
            }
        }
Пример #3
0
        protected override void Insert()
        {
            BLL.VerifiedCarsBLL.BLLVerifiedCars_TFactory VerifiedCarsFactory = new BLL.VerifiedCarsBLL.BLLVerifiedCars_TFactory();

            try
            {
                BLL.VerifiedCarsBLL.BLLVerifiedCars_T VerifiedCarsEntity = new BLL.VerifiedCarsBLL.BLLVerifiedCars_T();
                VerifiedCarsEntity.NumberPlate_nvc = Hepsa.Core.Common.PersentationController.GetEntityValue(NumberPlate_nvcTextBox.Text, TypeCode.String).ToString();
                VerifiedCarsEntity.SerialPlate_nvc = Hepsa.Core.Common.PersentationController.GetEntityValue(SerialPlate_nvcTextBox.Text, TypeCode.String).ToString();
                VerifiedCarsEntity.CompanyID_int   = Convert.ToInt32(CompanyID_intComboBox.SelectedValue);
                VerifiedCarsEntity.FullName_nvc    = Hepsa.Core.Common.PersentationController.GetEntityValue(FullName_nvcTextBox.Text, TypeCode.String).ToString();
                VerifiedCarsEntity.Unit_nvc        = Hepsa.Core.Common.PersentationController.GetEntityValue(Unit_nvcTextBox.Text, TypeCode.String).ToString();

                VerifiedCarsFactory.BeginProc();
                VerifiedCarsFactory.Insert(VerifiedCarsEntity);
                VerifiedCarsFactory.CommitProc();
                if (DataTable != null)
                {
                    DataRow dr = this.DataTable.NewRow();
                    dr[BLL.VerifiedCarsBLL.BLLVerifiedCars_T.VerifiedCars_TField.VerifiedCarID_int.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(VerifiedCarsEntity.VerifiedCarID_int, TypeCode.Int32);
                    dr[BLL.VerifiedCarsBLL.BLLVerifiedCars_T.VerifiedCars_TField.NumberPlate_nvc.ToString()]   = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(VerifiedCarsEntity.NumberPlate_nvc, TypeCode.String);
                    dr[BLL.VerifiedCarsBLL.BLLVerifiedCars_T.VerifiedCars_TField.SerialPlate_nvc.ToString()]   = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(VerifiedCarsEntity.SerialPlate_nvc, TypeCode.String);
                    dr["Company_nvc"] = Hepsa.Core.Common.PersentationController.GetComboBoxDisplayMember(CompanyID_intComboBox);
                    dr[BLL.VerifiedCarsBLL.BLLVerifiedCars_T.VerifiedCars_TField.FullName_nvc.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(VerifiedCarsEntity.FullName_nvc, TypeCode.String);
                    dr[BLL.VerifiedCarsBLL.BLLVerifiedCars_T.VerifiedCars_TField.Unit_nvc.ToString()]     = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(VerifiedCarsEntity.Unit_nvc, TypeCode.String);

                    DataTable.Rows.Add(dr);
                    DataTable.AcceptChanges();
                }
                this.ClearForm(this);
            }
            catch (System.Exception ex)
            {
                VerifiedCarsFactory.RollBackProc();
                throw ex;
            }
        }