private async void GenerateSmsReport(int billId) { BillItem bill = BillsItems.First(b => b.Id == billId); var smsReport = new SmsSimpleReport(DialogService, bill); smsReport.Generate(); await smsReport.CopyToBuffer(); }
public BillsItems SaveBillsItems(BillsItems item) { SqlServerConnection conn = new SqlServerConnection(); item.Id = conn.SqlServerUpdate("IF NOT EXISTS (SELECT bi_idnt FROM BillsItems WHERE bi_idnt=" + item.Id + ") BEGIN INSERT INTO BillsItems(bi_bill, bi_item, bi_cost, bi_amount, bi_description) OUTPUT INSERTED.bi_idnt VALUES (" + item.Bill.Id + ", " + item.Item.Id + ", " + item.Cost + ", " + item.Amount + ", '" + item.Description + "') END ELSE BEGIN UPDATE BillsItems SET bi_cost=" + item.Cost + ", bi_amount=" + item.Amount + ", bi_description='" + item.Description + "' OUTPUT INSERTED.bi_idnt WHERE bi_idnt=" + item.Id + " END"); return(item); }
private void RefreshBillsItems() { BillsItems.Clear(); IOrderedEnumerable <BillItem> bills = BillRepository.GetItems() .OrderByDescending(b => b.DateOfReading); foreach (BillItem bill in bills) { BillsItems.Add(bill); } }
private BillItem GetLastBill() { BillItem lastBill = BillsItems .OrderByDescending(b => b.DateOfReading) .FirstOrDefault(); // Если нет платежей, то значения берем из настроек. if (lastBill == null) { lastBill = GetInitBulks(); } return(lastBill.Clone() as BillItem); }
private BillItem GetPreviousBill(BillItem bill) { BillItem prevBill = BillsItems .Where(b => b.DateOfReading < bill.DateOfReading) .OrderByDescending(b => b.DateOfReading) .FirstOrDefault(); // Если нет платежей, то значения берем из настроек. if (prevBill == null) { prevBill = GetInitBulks(); } return(prevBill.Clone() as BillItem); }
public IActionResult PostRegistration(RegistrationNewViewModel model) { Input.Patient.Person.DoB = DateTime.ParseExact(Input.DoB, "dd/MM/yyyy", CultureInfo.InvariantCulture); Input.Patient.Save(); Input.NextOfKin.Person = Input.Patient.Person; Input.NextOfKin.Save(); Bills bill = new Bills { Amount = Input.Billables.Amount, Patient = Input.Patient, Notes = "New Patient Visit" }; if (bill.Amount.Equals(0)) { bill.Flag = 1; } bill.Save(); BillsItems items = new BillsItems { Bill = bill, Item = Input.Billables, Amount = Input.Billables.Amount, Description = Input.Billables.Description }; items.Save(); PatientQueue queue = new PatientQueue { Patient = Input.Patient, Queue = new Queue(Input.Room), Bill = bill }; queue.Save(); return(LocalRedirect("/patient-registration/new-patient")); }
public List <BillsItems> GetBillItems(Bills bill) { List <BillsItems> items = new List <BillsItems>(); SqlServerConnection conn = new SqlServerConnection(); SqlDataReader dr = conn.SqlServerConnect("SELECT bi_idnt, bi_cost, bi_amount, bs_idnt, bs_name, bl_idnt, bl_date, bl_time, bl_flag, bl_cost, bl_amount, bl_notes, pt_idnt, ps_idnt, ps_names, ps_gender, ps_dob FROM BillsItems INNER JOIN BillableServices ON bi_item=bs_idnt INNER JOIN Bills ON bi_bill=bl_idnt INNER JOIN Patient ON bl_patient=pt_idnt INNER JOIN Person ON pt_person=ps_idnt WHERE bi_bill=" + bill.Id); if (dr.HasRows) { while (dr.Read()) { BillsItems item = new BillsItems { Id = Convert.ToInt16(dr[0]), Cost = Convert.ToDouble(dr[1]), Amount = Convert.ToDouble(dr[2]) }; item.Item.Id = Convert.ToInt16(dr[3]); item.Item.Name = dr[4].ToString(); item.Bill.Id = Convert.ToInt16(dr[5]); item.Bill.Date = Convert.ToDateTime(dr[6]); item.Bill.Time = TimeSpan.Parse(dr[7].ToString()); item.Bill.Flag = Convert.ToInt16(dr[8]); item.Bill.Cost = Convert.ToDouble(dr[9]); item.Bill.Amount = Convert.ToDouble(dr[10]); item.Bill.Notes = dr[11].ToString(); item.Bill.Patient.Id = Convert.ToInt16(dr[12]); item.Bill.Patient.Person.Id = Convert.ToInt16(dr[13]); item.Bill.Patient.Person.Name = dr[14].ToString(); item.Bill.Patient.Person.Gender = dr[15].ToString(); item.Bill.Patient.Person.DoB = Convert.ToDateTime(dr[16]); items.Add(item); } } return(items); }