コード例 #1
0
 async void PrintOrder(Order order)
 {
     try
     {
         //if (MyMessageBox.Show("هل تريد طباعة وصل استلام؟", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
         {
             if (Properties.Settings.Default.VoucherType == 0)
             {
                 PrintTicket.printReport(order, img.Source as BitmapImage);
             }
             else
             {
                 PrintTicket.printReportA6(order);
             }
         }
     }
     catch (Exception ex) { MyMessageBox.Show("خطأ في الطباعة\n" + ex.Message); }
     await Task.Delay(10);
 }
コード例 #2
0
        private void btnAdd_Click(object sender, RoutedEventArgs e)
        {
            var i = this.DataContext as Invoice;

            i.Description = i.Transitions[0].Details;
            if (i.IsValidate())
            {
                if (i.TotalValue < double.Parse(txtBalance.Text))
                {
                    MyMessageBox.Show("لايوجد رصيد كافي في الصندوق");
                }
                else if (Invoice.InsertData(i) && Transition.InsertData(i.Transitions[0]))
                {
                    PrintTicket.printInvoiceA6(i, 1);
                    MyMessage.InsertMessage();
                    DialogResult = true;
                }
            }
        }
コード例 #3
0
        private void btnAdd_Click(object sender, RoutedEventArgs e)
        {
            var i = this.DataContext as Invoice;

            if (i.IsValidate())
            {
                if (Invoice.InsertData(i))
                {
                    foreach (var t in i.Transitions)
                    {
                        if (Transition.InsertData(t))
                        {
                            Transition tt = new Transition();
                            tt.Details       = "ترصيد حساب اليتيم في الكفيل";
                            tt.LeftAccount   = t.RightAccount;
                            tt.RightAccount  = Account.GetAccountByOwnerID(Account.AccountType.Sponsor, t.RelatedSponsorship.AvailableSponsorship.RelatedSponsor.SponsorID.Value, false);
                            tt.SponsorshipID = t.RelatedSponsorship.ID;
                            tt.Value         = t.Value;
                            tt.AccountType   = t.AccountType;
                            Transition.InsertData(tt);
                        }
                        else
                        {
                            MyMessageBox.Show("حدث خطأ اثناء حفظ البيانات يرجى مراجعة مسؤل البرنامج");
                            return;
                        }
                    }
                    PrintTicket.printInvoiceA6(i, 2);
                    MyMessage.InsertMessage();
                    DialogResult = true;
                }
                else
                {
                    MyMessageBox.Show("حدث خطأ اثناء حفظ البيانات يرجى مراجعة مسؤل البرنامج");
                    return;
                }
            }
        }
コード例 #4
0
        private void btnAdd_Click(object sender, RoutedEventArgs e)
        {
            var i = this.DataContext as Invoice;

            i.Description = i.Transitions[0].Details;
            if (i.IsValidate())
            {
                if (Invoice.InsertData(i) && Transition.InsertData(i.Transitions[0]))
                {
                    Transition tt = new Transition();
                    tt.Details       = "ترصيد حساب طالب العلم في الكفيل";
                    tt.LeftAccount   = i.Transitions[0].RightAccount;
                    tt.RightAccount  = Account.GetAccountByOwnerID(Account.AccountType.Sponsor, o.CurrentSponsorship.AvailableSponsorship.RelatedSponsor.SponsorID.Value, false);
                    tt.SponsorshipID = o.CurrentSponsorship.ID;
                    tt.Value         = i.Transitions[0].Value;
                    tt.AccountType   = Account.AccountType.Student;
                    Transition.InsertData(tt);
                    PrintTicket.printInvoiceA6(i, 2);
                    MyMessage.InsertMessage();
                    DialogResult = true;
                }
            }
        }
コード例 #5
0
        private void btnAdd_Click(object sender, RoutedEventArgs e)
        {
            var i = this.DataContext as Invoice;

            if (cmboAccounts.SelectedItem == null)
            {
                MyMessageBox.Show("يجب اختيار الحساب");
                return;
            }
            i.Transitions[0].RightAccount = new Account()
            {
                Id = (int)cmboAccounts.SelectedValue
            };
            i.Description = i.Transitions[0].Details;
            if (i.IsValidate())
            {
                if (Invoice.InsertData(i) && Transition.InsertData(i.Transitions[0]))
                {
                    PrintTicket.printInvoiceA6(i, 1);
                    MyMessage.InsertMessage();
                    DialogResult = true;
                }
            }
        }