Exemplo n.º 1
0
        private void LoadData()
        {
            if (_Code == 0)
            {
                txtIssuDate.Date     = (new JDataBase()).GetCurrentDateTime();
                grdReport.DataSource = JAUTDocumentDetails.GetBusCredit();

                grdReport.gridEX1.AllowEdit = Janus.Windows.GridEX.InheritableBoolean.True;
                grdReport.gridEX1.CurrentTable.Columns["AccountNo"].EditType  = Janus.Windows.GridEX.EditType.NoEdit;
                grdReport.gridEX1.CurrentTable.Columns["OwnerPCode"].EditType = Janus.Windows.GridEX.EditType.NoEdit;
                grdReport.gridEX1.CurrentTable.Columns["BusCode"].EditType    = Janus.Windows.GridEX.EditType.NoEdit;
                grdReport.gridEX1.CurrentTable.Columns["BusNumber"].EditType  = Janus.Windows.GridEX.EditType.NoEdit;
                grdReport.gridEX1.CurrentTable.Columns["OwnerName"].EditType  = Janus.Windows.GridEX.EditType.NoEdit;
                grdReport.gridEX1.CurrentTable.Columns["TotalPrice"].EditType = Janus.Windows.GridEX.EditType.NoEdit;
            }
            else
            {
                JAUTPayment payment = new JAUTPayment(null, _Code);
                txtDesc.Text                = payment.Description;
                txtIssuDate.Date            = payment.PaymentDate;
                grdReport.DataSource        = JAUTPaymentDetails.GetData(_Code);
                grdReport.gridEX1.AllowEdit = Janus.Windows.GridEX.InheritableBoolean.False;
                DisableAll();
            }
            CalcSum();
        }
Exemplo n.º 2
0
 public bool CascadeDelete(JDataBase db)
 {
     BusManagment.Documents.JAUTDocument document1 = new BusManagment.Documents.JAUTDocument();
     document1.Code = 400000000 + Code;
     {
         if (document1.CascadeDelete(db))
         {
             BusManagment.Documents.JAUTDocument document2 = new BusManagment.Documents.JAUTDocument();
             document2.Code = 700000000 + Code;
             {
                 if (document1.CascadeDelete(db))
                 {
                     JAUTPaymentTable AT = new JAUTPaymentTable();
                     AT.SetValueProperty(this);
                     if (JAUTPaymentDetails.Delete(db, this.Code))
                     {
                         if (AT.Delete(db))
                         {
                             ClassLibrary.JHistory jHistory = new ClassLibrary.JHistory();
                             jHistory.Save("BusManagment.JAUTPayment", AT.Code, 0, 0, 0, "حذف سند پرداخت و جزئیات", "", 0);
                             return(true);
                         }
                         else
                         {
                             return(false);
                         }
                     }
                     else
                     {
                         return(false);
                     }
                 }
                 else
                 {
                     return(false);
                 }
             }
         }
         else
         {
             return(false);
         }
     }
 }