Ejemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            Common.BLL.Logic.GasStation.Car  lCar = new Common.BLL.Logic.GasStation.Car(Common.Enum.EDatabase.GasStation);
            Common.BLL.Entity.GasStation.Car car  = new Common.BLL.Entity.GasStation.Car();
            CommandResult result;

            car.capacity   = 10;
            car.carTypeId  = 1;
            car.engineCode = "ENG100000";
            car.chasisCode = "CHS9900";

            result = lCar.create(car);


            car.id = 1;
            result = lCar.read(car);
            car.load_Base__CarType_carTypeId();
            var x = car.Base__CarType_carTypeId;


            result = lCar.allData("(capacity = @capacity)", "", false, true,
                                  new KeyValuePair("@capacity", 10)
                                  );


            //dataGridView1.DataSource = result.model as DataTable;
        }
Ejemplo n.º 2
0
        private bool deleteCar_Plate(int carId)
        {
            bool result = false;

            int id, plateId;

            id = carId;
            Common.BLL.Entity.GasStation.Car model = new Common.BLL.Entity.GasStation.Car()
            {
                id = carId
            };

            Common.BLL.Logic.GasStation.Car lCar = new Common.BLL.Logic.GasStation.Car(Common.Enum.EDatabase.GasStation);
            CommandResult resultCar = lCar.read(model, "id");

            if (resultCar.status == BaseDAL.Base.EnumCommandStatus.success)
            {
                plateId = model.plateId;
                CommandResult opResult = lCar.delete(model);
                if (opResult.status == BaseDAL.Base.EnumCommandStatus.success)
                {
                    Common.BLL.Entity.GasStation.Plate modelPlate = new Common.BLL.Entity.GasStation.Plate()
                    {
                        id = plateId
                    };

                    Common.BLL.Logic.GasStation.Plate lPlate = new Common.BLL.Logic.GasStation.Plate(Common.Enum.EDatabase.GasStation);
                    CommandResult resultPlate = lPlate.delete(modelPlate);
                    if (resultPlate.status == BaseDAL.Base.EnumCommandStatus.success)
                    {
                        result = true;
                    }
                }
            }


            return(result);
        }