Ejemplo n.º 1
0
        public CustomerForm(customer c)
        {
            InitializeComponent();
            ControlsUtil.SetBackColor(this.Controls);
            bdgStates.DataSource = state.Fetch("ORDER BY symbol");
            address d;

            if (c == null)
            {
                IsNew = true;
            }

            if (IsNew)
            {
                c = new customer();
                d = new address();
            }
            else
            {
                d = address.SingleOrDefault(c.address_id);
                tfCnpj.Properties.ReadOnly = true;
                tfIE.Properties.ReadOnly   = true;
                rgType.Properties.ReadOnly = true;
                if (c.inactive || c.is_business)
                {
                    pnData.Enabled    = false;
                    pnAddress.Enabled = false;
                }
            }
            bdgCustomer.DataSource = c;
            bdgAddress.DataSource  = d;
        }
Ejemplo n.º 2
0
        public ViewDepositsForm(List <deposits> _ld, freight _fre)
        {
            List <deposits> ld = _ld;// new List<deposits>();

            //ld.Clear();
            //foreach (deposits d in _ld)
            // ld.Add(d);

            InitializeComponent();
            ControlsUtil.SetBackColor(this.Controls);
            fre = _fre;

            if (ld == null)
            {
                ld = new List <deposits>();
                ld.Clear();
            }
            else
            {
                for (int i = 0; i < ld.Count; i++)
                {
                    bank_account ba = bank_account.SingleOrDefault(ld[i].account_id);
                    banks        b  = banks.SingleOrDefault(ba.bank_id);
                    ld[i].account       = String.Format("{0}/{1} - {2}/{3}", ba.agency, ba.account, b.code, b.name);
                    ld[i].customer_name = customer.SingleOrDefault(ld[i].customer_id).corporate_name;
                    ld[i].type_name     = ld[i].type == 0 ? "Dinheiro" : "Cheque";
                    ld[i].truck_board   = truck.SingleOrDefault(ld[i].truck_id).board;
                }
            }
            bdgDeposits.DataSource = ld;
            if (bdgDeposits.Count == 0)
            {
                btnAdd_Click(this, null);
            }
        }
Ejemplo n.º 3
0
 protected void InitMouse()
 {
     this.Mouse = this.GetNode <Sprite>("./Mouse");
     this.Connect("mouse_entered", this, "OnMouseEntered");
     this.Connect("mouse_exited", this, "OnMouseExited");
     ControlsUtil.HideMouse();
 }
Ejemplo n.º 4
0
        public InputMessageForm(string caption, FormatValue fv)
        {
            InitializeComponent();
            ControlsUtil.SetBackColor(this.Controls);
            this.pnPrincipal.Text = caption;

            if (fv == FormatValue.Decimal)
            {
                tfValue.Properties.Mask.EditMask = "c2";
                tfValue.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric;
            }
            else if (fv == FormatValue.Integer)
            {
                tfValue.Properties.Mask.EditMask = "n2";
                tfValue.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric;
            }
            else if (fv == FormatValue.String)
            {
                tfValue.Properties.Mask.EditMask = "";
                tfValue.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.None;
            }
            tfValue.Properties.Mask.UseMaskAsDisplayFormat = true;
            if (Value != null)
            {
                tfValue.EditValue = Value;
            }
        }
Ejemplo n.º 5
0
 public SearchCNPJForm()
 {
     InitializeComponent();
     ControlsUtil.SetBackColor(this.Controls);
     bdgStates.DataSource = state.Fetch("ORDER BY symbol");
     tfCNPJ.Focus();
     tfCNPJ.SelectAll();
 }
Ejemplo n.º 6
0
 public SearchPaymentsForm()
 {
     InitializeComponent();
     ControlsUtil.SetBackColor(this.Controls);
     bdgCustomers.DataSource = customer.Fetch("");
     bdgTrucks.DataSource    = truck.Fetch("");
     rgPaid.EditValue        = 2;
 }
Ejemplo n.º 7
0
 public TrailerForm(truck idTruck)
 {
     InitializeComponent();
     lbDriver.Text = "";
     ControlsUtil.SetBackColor(this.Controls);
     CurrentTruck = idTruck;
     setValidations();
     loadTrucks();
 }
Ejemplo n.º 8
0
 public ConfigBackupForm()
 {
     InitializeComponent();
     ControlsUtil.SetBackColor(this.Controls);
     PathBackup             = Paths.PathBackupFile;
     PathPG                 = Paths.PathPG;
     tfPathBackup.EditValue = PathBackup;
     tfPathPG.EditValue     = PathPG;
     GetLastBackup();
 }
Ejemplo n.º 9
0
    public override void _Ready()
    {
        ControlsUtil.HideMouse();

        this.GameState  = (GameState)GetNode("/root/GameState");
        this.LevelAudio = (LevelAudio)GetNode("/root/LevelAudio");

        this.InitNodes(this.GameState.CurrentLevel, this.GameState.CheckPoint);

        this.Start();
    }
Ejemplo n.º 10
0
        public SearchFreightsForm()
        {
            InitializeComponent();
            ControlsUtil.SetBackColor(this.Controls);
            bdgTruck.DataSource = truck.Fetch("");

            DateTime dt = freight.Now();

            tfEnd.EditValue   = dt;
            tfStart.EditValue = dt.AddMonths(-3);
        }
Ejemplo n.º 11
0
    public override void _Input(InputEvent @event)
    {
        if (@event is InputEventMouseButton)
        {
            ControlsUtil.ShowMouse();
        }

        if (@event.IsAction(SkipAction) && this.NextScene != null)
        {
            this.GoToScene();
        }
    }
Ejemplo n.º 12
0
 public PaymentForm(payment p)
 {
     InitializeComponent();
     ControlsUtil.SetBackColor(this.Controls);
     if (p == null)
     {
         p     = new payment();
         IsNew = true;
     }
     loadData();
     bdgPayment.DataSource = p;
 }
Ejemplo n.º 13
0
 public FueledForm(freight f)
 {
     InitializeComponent();
     ControlsUtil.SetBackColor(this.Controls);
     bdgFueled.DataSource = new fueled()
     {
         freight_id = 0, truck_id = f.truck_id, driver_id = f.driver_id
     };
     bdgCustomers.DataSource    = customer.Fetch("");
     tfDate.Properties.MaxValue = Convert.ToDateTime(f.end);
     tfDate.Properties.MinValue = Convert.ToDateTime(f.start);
     cbGasStation.Focus();
 }
Ejemplo n.º 14
0
 public OutputsFreightForm(freight f)
 {
     InitializeComponent();
     ControlsUtil.SetBackColor(this.Controls);
     bdgOutput.DataSource = new output()
     {
         freight_id = 0, truck_id = f.truck_id, others_outputs = false
     };
     bdgCustomers.DataSource    = customer.Fetch("");
     tfDate.Properties.MaxValue = Convert.ToDateTime(f.end);
     tfDate.Properties.MinValue = Convert.ToDateTime(f.start);
     cbCustomer.Focus();
 }
Ejemplo n.º 15
0
 public NewDepositForm(deposits _d, freight fre)
 {
     InitializeComponent();
     ControlsUtil.SetBackColor(this.Controls);
     loadModels();
     if (_d == null)
     {
         _d = new deposits()
         {
             type = -1, freight_id = fre.id, truck_id = fre.truck_id, date = null
         }
     }
     ;
     bdgDeposit.DataSource = _d;
 }
Ejemplo n.º 16
0
        public ConfigureMailForm()
        {
            InitializeComponent();
            ControlsUtil.SetBackColor(this.Controls);
            btnViewSignature.Visible = false;
            mails smt = mails.SingleOrDefault(1);

            if (smt == null)
            {
                smt = new mails();
            }
            else
            {
                smt.password = Util.Decrypt(smt.password);
            }
            bdgMail.DataSource = smt;
        }
Ejemplo n.º 17
0
        public StayForm(freight _f)
        {
            InitializeComponent();
            ControlsUtil.SetBackColor(this.Controls);
            f = _f;
            stay s = stay.SingleOrDefault("WHERE freight_id=@0", f.id);

            if (s == null)
            {
                s = new stay();
            }
            bdgStay.DataSource = s;

            tfTruck.EditValue      = truck.SingleOrDefault(f.truck_id).board;
            tfNameDriver.EditValue = driver.SingleOrDefault(f.driver_id).full_name;
            tfFreight.EditValue    = f.id;
        }
Ejemplo n.º 18
0
 public AccountsToPayForm(accounts_to_pay atp)
 {
     InitializeComponent();
     ControlsUtil.SetBackColor(this.tabGeneral.Controls);
     ControlsUtil.SetBackColor(this.tabPayment.Controls);
     if (atp == null)
     {
         atp = new accounts_to_pay()
         {
             emission_at = null
         };
         IsNew = true;
     }
     loadData();
     bdgAccountToPay.DataSource = atp;
     EmissionAt(atp.emission_at);
 }
Ejemplo n.º 19
0
 public TruckForm(truck t)
 {
     InitializeComponent();
     ControlsUtil.SetBackColor(this.Controls);
     setValidations();
     loadData(null, null);
     if (t == null)
     {
         t     = new truck();
         IsNew = true;
     }
     else
     {
         tfBoardTruck.Properties.ReadOnly = true;
     }
     bdgTruck.DataSource = t;
 }
Ejemplo n.º 20
0
        public DriverForm(driver d)
        {
            InitializeComponent();
            ControlsUtil.SetBackColor(this.Controls);
            lbBirthday.Text     = "";
            bdgState.DataSource = state.Fetch("");
            address ad;

            if (d == null)
            {
                IsNew = true;
            }
            if (IsNew)
            {
                d = new driver()
                {
                    birthday = null, admitted_at = null, dismissed_at = null, genre = -1
                };
                ad = new address();
                btnFiles.Enabled = false;
            }
            else
            {
                ad = address.SingleOrDefault(d.address);
                tfCpf.Properties.ReadOnly = true;
                //tfNumberCnh.Properties.ReadOnly = true;

                if (d.inactive)
                {
                    pnGeneral.Enabled = false;
                    btnSave.Visible   = false;
                }
            }
            bdgAddress.DataSource = ad;
            bdgDriver.DataSource  = d;
            DateTime now = driver.Now();

            tfBirthday.Properties.MaxValue    = now;
            tfAdmittedAt.Properties.MaxValue  = now;
            tfDismissedAt.Properties.MaxValue = now;
        }
Ejemplo n.º 21
0
        public FreightForm(freight f)
        {
            InitializeComponent();
            ControlsUtil.SetBackColor(this.Controls);
            if (f == null)
            {
                IsNew = true;
            }
            if (IsNew)
            {
                f = new freight()
                {
                    number_note = null, number_cte = null
                }
            }
            ;
            else
            {
                ListFueleds  = fueled.Fetch("WHERE freight_id=@0", f.id);
                ListOutputs  = output.Fetch("WHERE freight_id=@0", f.id);
                ListDeposits = deposits.Fetch("WHERE freight_id=@0", f.id);
                loadValuesFueledsAndOutputs(f);
                tfNumberNote.Properties.ReadOnly = true;
                cbTruck.Properties.ReadOnly      = true;
                btnStay.Visible = true;
            }
            loadData();
            bdgFreight.DataSource = f;
            DateTime now = freight.Now();

            tfStart.Properties.MaxValue = now;
            tfEnd.Properties.MaxValue   = now;

            if (!IsNew)
            {
                //cbDriver.EditValue = f.driver_id;
                //tfPercentComission.EditValue = f.taxe_comission;
            }
        }
Ejemplo n.º 22
0
    public override void _PhysicsProcess(float delta)
    {
        if (this.IsJumping())
        {
            this.JumpSound.Play();
        }

        var originalVelocity = this.Velocity;

        Vector2 inputVelocity = this.Disabled ? Vector2.Zero : ControlsUtil.DirectionFromInput();

        this.Velocity = this.MoveAndSlide(this.GetRealVelocityFromInputVelocity(inputVelocity, delta), Vector2.Up);
        this.Bounce(originalVelocity);

        if (!this.Disabled)
        {
            this.Animate(this.GetStateFromVelocity(inputVelocity));
            if (inputVelocity != Vector2.Zero)
            {
                this.Sprite.FlipH = inputVelocity.x < 0;
            }
        }
    }
Ejemplo n.º 23
0
 public ViewOutputsForm(List <output> lo, freight fr)
 {
     InitializeComponent();
     ControlsUtil.SetBackColor(this.Controls);
     fre = fr;
     if (lo == null)
     {
         bdgOutputs.DataSource = new List <output>();
         bdgOutputs.Clear();
     }
     else
     {
         for (int i = 0; i < lo.Count; i++)
         {
             lo[i].customer_name = customer.SingleOrDefault(lo[i].customer_id).corporate_name;
         }
         bdgOutputs.DataSource = lo;
     }
     if (bdgOutputs.Count == 0)
     {
         btnAdd_Click(this, null);
     }
 }
Ejemplo n.º 24
0
        public ViewFueledsForm(List <fueled> lf, freight fr)
        {
            InitializeComponent();
            ControlsUtil.SetBackColor(this.Controls);
            fre = fr;
            if (lf == null)
            {
                bdgFueleds.DataSource = new List <fueled>();
                bdgFueleds.Clear();
            }
            else
            {
                for (int i = 0; i < lf.Count; i++)
                {
                    lf[i].gas_station_name = customer.SingleOrDefault(lf[i].gas_station_id).corporate_name;
                }
                bdgFueleds.DataSource = lf;
            }

            if (bdgFueleds.Count == 0)
            {
                btnAdd_Click(this, null);
            }
        }
Ejemplo n.º 25
0
        public BankAccountForm(bank_account bc)
        {
            InitializeComponent();
            ControlsUtil.SetBackColor(this.Controls);
            bdgBanks.DataSource     = banks.Fetch("ORDER BY code");
            bdgCustomers.DataSource = customer.Fetch("ORDER BY corporate_name");

            if (bc == null)
            {
                bc = new bank_account()
                {
                    type = -1
                };
            }
            else
            {
                /*if (Util.RemoveSpecialCharacters(bc.document).Length == 11)
                 *  rgTypeHolder.EditValue = "cpf";
                 * else
                 *  rgTypeHolder.EditValue = "cnpj";
                 * rgType_SelectedIndexChanged(null, null);*/
            }
            bdgBankAccount.DataSource = bc;
        }
Ejemplo n.º 26
0
 public SingleReceipt()
 {
     InitializeComponent();
     ControlsUtil.SetBackColor(this.Controls);
     bdgState.DataSource = state.Fetch("ORDER BY symbol");
 }
Ejemplo n.º 27
0
 public AnttForm()
 {
     InitializeComponent();
     ControlsUtil.SetBackColor(this.Controls);
     bdgCustomer.DataSource = customer.Fetch("ORDER BY id");
 }
Ejemplo n.º 28
0
 public SearchCustomersForm()
 {
     InitializeComponent();
     ControlsUtil.SetBackColor(this.Controls);
     rgSearch.EditValue = "name";
 }
Ejemplo n.º 29
0
 public LubrificationForm()
 {
     InitializeComponent();
     ControlsUtil.SetBackColor(this.Controls);
 }
Ejemplo n.º 30
0
 private bool IsJumping()
 {
     return(!this.Disabled && (this.IsOnFloor() || this.IsSlidingOnWall()) && ControlsUtil.IsJumpJustPressed());
 }