Exemplo n.º 1
0
        public void UpdateInfo(CheckClass chk)
        {
            check = chk;

            Customer customer = DataManager.GetCustomer (check.CustomerID);

            // Name
            SetCustomerName (customer.Name);

            // Identification
            if (customer.IdentityType == Customer.TypeID.CPF) {
                entryID.Text = Formatter.FormatCPF (customer.Identity);
                lbl_ID.Text = "CPF";
            } else {
                entryID.Text = Formatter.FormatCNPJ (customer.Identity);
                lbl_ID.Text = "CNPJ";
            }

            // Number
            entryNumber.Text = check.Number;

            // Bank
            entryBankNum.Text = check.BankNumber;

            // Branch
            entryBranch.Text = check.BranchNumber;

            // Serial
            entrySerial.Text = check.Serial;

            // Due Date
            entryDueDate.Text = check.DueDate.ToShortDateString ();

            // Value
            entryValue.Text = String.Format ("{0:C}", check.Value);

            // Cash Date
            if (check.CashDate.Date <= DateTime.Now.Date) {
                if (check.IsCashed) {
                    entryCashDate.Text = check.CashDate.ToShortDateString ();
                    if (!checkBtnCashed.Active)
                        checkBtnCashed.Active = true;
                } else {
                    entryCashDate.Text = DateTime.Now.ToShortDateString ();
                    if (checkBtnCashed.Active)
                        checkBtnCashed.Active = false;
                }
                if (check.CashedOverdue) {
                    if (!checkBtnOverdue.Active)
                        checkBtnOverdue.Active = true;
                } else {
                    if (checkBtnOverdue.Active)
                        checkBtnOverdue.Active = false;
                }
            }

            // Issue Date
            lblIssueDate.Text = "Data de Cadastro: " + check.IssueDate.ToString ();
        }
Exemplo n.º 2
0
 public static int DeleteCheck(CheckClass check)
 {
     return DL.Database.DeleteItem<CheckClass> (check);
 }
Exemplo n.º 3
0
 public static CheckClass GetCheck(CheckClass check)
 {
     return DL.Database.GetCheck (check.Number, check.BankNumber, check.BranchNumber, check.Serial, check.CustomerID);
 }
Exemplo n.º 4
0
 public static int AddCheck(CheckClass check)
 {
     return DL.Database.SaveItem<CheckClass> (check);
 }