Beispiel #1
0
        private void ExcuteRadioCommand()
        {
            RadioButton     = RadioButtons.Where(p => p.IsCheck).First();
            RadioTimeButton = RadioTimeButtons.Where(p => p.IsCheck).First();
            switch (RadioButton.Content)
            {
            case "所有":
            {
                QuerySnEna         = false;
                QueryOperatorEna   = false;
                QueryDepartmentEna = false;
                QueryPersonEna     = false;
            }
            break;

            case "录入部门":
            {
                QuerySnEna         = false;
                QueryOperatorEna   = false;
                QueryDepartmentEna = true;
                QueryPersonEna     = false;
            }
            break;

            case "发票号码":
            {
                QuerySnEna         = true;
                QueryOperatorEna   = false;
                QueryDepartmentEna = false;
                QueryPersonEna     = false;
            }
            break;

            case "报销人":
            {
                QuerySnEna         = false;
                QueryOperatorEna   = false;
                QueryDepartmentEna = true;
                QueryPersonEna     = true;
            }
            break;

            case "录入人员":
            {
                QuerySnEna         = false;
                QueryOperatorEna   = true;
                QueryDepartmentEna = false;
                QueryPersonEna     = false;
            }
            break;

            default:
                break;
            }
            QueryDateEna = RadioTimeButton.Content == "所有" ? false : true;
        }
 private void CheckItem(RadioButton radioBtn)
 {
     if (!radioBtn.Checked)
     {
         radioBtn.Checked = true;
         foreach (RadioButton otherRadioBtn in RadioButtons.Where(x => x != radioBtn))
         {
             otherRadioBtn.Checked = false;
         }
     }
 }
Beispiel #3
0
 private void ExcuteRadioCommand()
 {
     RadioButton = RadioButtons.Where(p => p.IsCheck).First();
 }
Beispiel #4
0
 /// <summary>
 /// Returns a radio button by id.
 /// </summary>
 /// <param name="commandId"></param>
 /// <returns></returns>
 public RibbonRadioButton GetRadioButton(int commandId)
 {
     return(RadioButtons.Where(x => x.CommandId == commandId).FirstOrDefault());
 }
Beispiel #5
0
        private void ExcuteQueryCommand()
        {
            RadioButton     = RadioButtons.Where(p => p.IsCheck).First();
            RadioTimeButton = RadioTimeButtons.Where(p => p.IsCheck).First();
            using (var db = new DataModel())
            {
                if (QueryDateEna)
                {
                    switch (RadioButton.Content)
                    {
                    case "录入部门":
                        if (QueryDepartment != null)
                        {
                            QueryInvoices = db.Invoices.Where(i => i.Person.DepId == QueryDepartment.DepartmentId).ToList();
                        }
                        break;

                    case "所有":
                        QueryInvoices = db.Invoices.ToList();
                        break;

                    case "发票号码":
                        QueryInvoices = db.Invoices.Where(i => i.InvoiceNumber.ToString().Contains(InvoiceSN)).ToList();
                        break;

                    case "录入人员":
                        if (QueryAccountant != null)
                        {
                            QueryInvoices = db.Invoices.Where(i => i.AccountantId == QueryAccountant.AccountantId).ToList();
                        }
                        break;

                    case "报销人":
                        if (QueryPerson != null)
                        {
                            QueryInvoices = db.Invoices.Where(i => i.PersonId == QueryPerson.PersonId).ToList();
                        }
                        break;

                    default:
                        break;
                    }
                    if (RadioTimeButton.Content == "录入日期")
                    {
                        QueryInvoices = QueryInvoices.Where(i => i.RecDate >= FromDate && i.RecDate <= ToDate).ToList();
                    }
                    else if (RadioTimeButton.Content == "发票日期")
                    {
                        QueryInvoices = QueryInvoices.Where(i => i.Date >= FromDate && i.Date <= ToDate).ToList();
                    }
                }
                else
                {
                    switch (RadioButton.Content)
                    {
                    case "录入部门":
                        if (QueryDepartment != null)
                        {
                            QueryInvoices = db.Invoices.Where(i => i.Person.DepId == QueryDepartment.DepartmentId).ToList();
                        }
                        break;

                    case "所有":
                        QueryInvoices = db.Invoices.ToList();
                        break;

                    case "发票号码":
                        QueryInvoices = db.Invoices.Where(i => i.InvoiceNumber.ToString().Contains(InvoiceSN)).ToList();
                        break;

                    case "录入人员":
                        if (QueryAccountant != null)
                        {
                            QueryInvoices = db.Invoices.Where(i => i.AccountantId == QueryAccountant.AccountantId).ToList();
                        }
                        break;

                    case "报销人":
                        if (QueryPerson != null)
                        {
                            QueryInvoices = db.Invoices.Where(i => i.PersonId == QueryPerson.PersonId).ToList();
                        }
                        break;

                    default:
                        break;
                    }
                }
                ViewInvoices.Clear();
                QueryInvoices.ForEach(i =>
                {
                    InputInvoice viewInvoice = new InputInvoice();
                    i.Person                     = db.Persons.Where(p => p.PersonId == i.PersonId).FirstOrDefault();
                    i.Accountant                 = db.Accountants.Where(o => o.AccountantId == i.AccountantId).FirstOrDefault();
                    i.Accountant.Person          = db.Persons.Where(p => p.PersonId == i.AccountantId).FirstOrDefault();
                    viewInvoice.ID               = i.ID;
                    viewInvoice.InvoiceNumber    = i.InvoiceNumber;
                    viewInvoice.InvoiceCode      = i.InvoiceCode;
                    viewInvoice.Date             = i.Date;
                    viewInvoice.RecDate          = i.RecDate;
                    viewInvoice.AcctId           = i.AccountantId;
                    viewInvoice.PersonId         = i.Person.PersonId;
                    viewInvoice.PersonName       = i.Person.PersonName;
                    viewInvoice.AcctName         = i.Accountant.Person.PersonName;
                    viewInvoice.Amount           = i.Amount;
                    viewInvoice.Verification     = i.Verification;
                    viewInvoice.VerificationCode = i.VerificationCode;
                    viewInvoice.VerifyState      = i.VerifyState;
                    ViewInvoices.Add(viewInvoice);
                });
                QueryCount = ViewInvoices.Count;
                calSummary();
                //TempViewInvoice = null;
                //Department = null;
                //Person = null;
                //Accountant = null;
            }
        }