public void setTransaction(transaction transactionArray) { List <columnsValues> valuesArray = new List <columnsValues>(); valuesArray.Add(createItem.ofTypeColumnsValues("trn_User_ID", transactionArray.userId)); //valuesArray.Add(createList.ofTypeColumnsValues("trn_DateRegistered", transactionArray.dateRegistered)); valuesArray.Add(createItem.ofTypeColumnsValues("trn_Comment", transactionArray.comment)); valuesArray.Add(createItem.ofTypeColumnsValues("trn_Type", transactionArray.type)); valuesArray.Add(createItem.ofTypeColumnsValues("trn_AmountCharged", transactionArray.amountCharged)); valuesArray.Add(createItem.ofTypeColumnsValues("trn_Cash", transactionArray.cash)); valuesArray.Add(createItem.ofTypeColumnsValues("trn_Credit", transactionArray.credit)); valuesArray.Add(createItem.ofTypeColumnsValues("trn_Check", transactionArray.check)); valuesArray.Add(createItem.ofTypeColumnsValues("trn_CheckNumber", transactionArray.checkNumber)); valuesArray.Add(createItem.ofTypeColumnsValues("trn_Change", transactionArray.change)); valuesArray.Add(createItem.ofTypeColumnsValues("trn_PatientFirstName", transactionArray.patientFirstName)); valuesArray.Add(createItem.ofTypeColumnsValues("trn_Copayment", transactionArray.copayment)); valuesArray.Add(createItem.ofTypeColumnsValues("trn_SelfPay", transactionArray.selfPay)); valuesArray.Add(createItem.ofTypeColumnsValues("trn_Deductible", transactionArray.deductible)); valuesArray.Add(createItem.ofTypeColumnsValues("trn_Labs", transactionArray.labs)); valuesArray.Add(createItem.ofTypeColumnsValues("trn_Other", transactionArray.other)); //valuesArray.Add(createList.ofTypeColumnsValues("trn_OtherComments", transactionArray.otherComments)); valuesArray.Add(createItem.ofTypeColumnsValues("trn_Closed", transactionArray.closed)); valuesArray.Add(createItem.ofTypeColumnsValues("trn_RegisterID", "1")); //Cambiar esto valuesArray.Add(createItem.ofTypeColumnsValues("trn_ModifiedBy_ID", transactionArray.modifiedById)); //valuesArray.Add(listService.ofTypeColumnsValues("trn_ModificationDate", transactionArray.modificationDate)); createQuery.toInsert("transactions", valuesArray); }
private void setTransactionAndPrintReceip() { var transactionService = new transactionService(); var transaction = new transaction(); transaction.userId = userInformation.user.usr_ID; //transaction.dateRegistered = DateTime.Today.ToString("d"); transaction.comment = txtbox_comment.Text; transaction.type = (int)TRANSACTIONTYPE.IN; transaction.amountCharged = (float)Convert.ToDouble(txtbox_amountCharge.Text.Remove(0, 1)); transaction.cash = (float)Convert.ToDouble(txtbox_cash.Text.Remove(0, 1)); transaction.credit = (float)Convert.ToDouble(txtbox_credit.Text.Remove(0, 1)); transaction.check = (float)Convert.ToDouble(txtbox_check.Text.Remove(0, 1)); transaction.checkNumber = Convert.ToInt32(txtbox_numberChecks.Text); transaction.change = (float)Convert.ToDouble(label_change.Text.Remove(0, 1)); transaction.patientFirstName = txtbox_patientFirstName.Text; transaction.copayment = (bool)checkbox_copayment.IsChecked; transaction.selfPay = (bool)checkbox_selfPay.IsChecked; ; transaction.deductible = (bool)checkbox_deductible.IsChecked; ; transaction.labs = (bool)checkbox_labs.IsChecked; ; transaction.other = (bool)checkbox_other.IsChecked; ; transaction.closed = false; transaction.registerId = userInformation.user.usr_Username; transaction.modifiedById = userInformation.user.usr_ID; transaction.type = (int)TRANSACTIONTYPE.IN; transactionService.setTransaction(transaction); var lis = new List<valuesWhere>(); int maxid = sqlservice.toMax("trn_ID", "transactions", lis); transaction.trn_id = maxid; printReceip(transaction); }
public transaction getObjTransactionByTransactionID(string transactionID) { var terms = new List <valuesWhere>(); var items = new transaction(); terms.Add(createItem.ofTypeValuesWhere(false, "trn_ID", transactionID, (int)OPERATORBOOLEAN.AND, (int)OPERATOR.EQUALITY)); terms.Add(createItem.ofTypeValuesWhere(true, "trn_Comment", "Initial Cash", (int)OPERATORBOOLEAN.NONE, (int)OPERATOR.INEGUALITY)); var data = createQuery.toSelectAll("transactions", terms); for (int i = 0; i < data.Rows.Count; i++) { DataRow filas = data.Rows[i]; items.amountCharged = Convert.ToInt32(filas["trn_AmountCharged"]); items.copayment = Convert.ToBoolean(filas["trn_Copayment"]); items.selfPay = Convert.ToBoolean(filas["trn_SelfPay"]); items.deductible = Convert.ToBoolean(filas["trn_Deductible"]); items.labs = Convert.ToBoolean(filas["trn_Labs"]); items.otherComments = Convert.ToString(filas["trn_OtherComments"]); items.comment = Convert.ToString(filas["trn_Comment"]); items.cash = (float)Convert.ToDouble(filas["trn_Cash"]); items.credit = (float)Convert.ToDouble(filas["trn_Credit"]); items.check = (float)Convert.ToDouble(filas["trn_Check"]); items.checkNumber = Convert.ToInt32(filas["trn_CheckNumber"]); items.change = (float)Convert.ToDouble(filas["trn_Change"]); items.patientFirstName = Convert.ToString(filas["trn_PatientFirstName"]); } return(items); }
public void updateTransaction(transaction trn) { var columns = new List <columnsValues>(); var terms = new List <valuesWhere>(); columns.Add(createItem.ofTypeColumnsValues("trn_PatientFirstName", trn.patientFirstName)); columns.Add(createItem.ofTypeColumnsValues("trn_AmountCharged", trn.amountCharged)); columns.Add(createItem.ofTypeColumnsValues("trn_Cash", trn.cash)); columns.Add(createItem.ofTypeColumnsValues("trn_Credit", trn.credit)); columns.Add(createItem.ofTypeColumnsValues("trn_Check", trn.check)); columns.Add(createItem.ofTypeColumnsValues("trn_CheckNumber", trn.checkNumber)); columns.Add(createItem.ofTypeColumnsValues("trn_Change", trn.change)); columns.Add(createItem.ofTypeColumnsValues("trn_Copayment", trn.copayment)); columns.Add(createItem.ofTypeColumnsValues("trn_SelfPay", trn.selfPay)); columns.Add(createItem.ofTypeColumnsValues("trn_Deductible", trn.deductible)); columns.Add(createItem.ofTypeColumnsValues("trn_Labs", trn.labs)); columns.Add(createItem.ofTypeColumnsValues("trn_Other", trn.other)); columns.Add(createItem.ofTypeColumnsValues("trn_OtherComments", trn.otherComments)); columns.Add(createItem.ofTypeColumnsValues("trn_ModifiedBy_ID", userInformation.user.usr_ID)); columns.Add(createItem.ofTypeColumnsValues("trn_Comment", trn.comment)); columns.Add(createItem.ofTypeColumnsValues("trn_ModificationDate", date.getCurrentDate())); terms.Add(createItem.ofTypeValuesWhere(false, "trn_ID", cashInUpdate.transactionID.ToString(), (int)OPERATORBOOLEAN.NONE, (int)OPERATOR.EQUALITY)); createQuery.toUpdate("transactions", columns, terms); }
public List <transaction> getTransactionsByRegisterID(string registerID, string fromDate) { var terms = new List <valuesWhere>(); var list = new List <transaction>(); terms.Add(createItem.ofTypeValuesWhere(false, "trn_RegisterID", registerID, (int)OPERATORBOOLEAN.AND, (int)OPERATOR.EQUALITY)); terms.Add(createItem.ofTypeValuesWhere(true, "trn_DateRegistered", date.convertToFormatDate(fromDate), (int)OPERATORBOOLEAN.AND, (int)OPERATOR.GREATER_THAN_OR_EQUAL)); terms.Add(createItem.ofTypeValuesWhere(true, "trn_DateRegistered", date.convertToFormatDateFinal(fromDate), (int)OPERATORBOOLEAN.AND, (int)OPERATOR.LESS_THAN_OR_EQUAL)); terms.Add(createItem.ofTypeValuesWhere(true, "trn_Comment", "Initial Cash", (int)OPERATORBOOLEAN.NONE, (int)OPERATOR.INEGUALITY)); var data = createQuery.toSelectAll("transactions", terms); for (int i = 0; i < data.Rows.Count; i++) { DataRow filas = data.Rows[i]; var items = new transaction(); items.trn_id = Convert.ToInt32(filas["trn_ID"]); items.amountCharged = Convert.ToInt32(filas["trn_AmountCharged"]); items.cash = Convert.ToInt32(filas["trn_Cash"]); items.credit = Convert.ToInt32(filas["trn_Credit"]); items.check = Convert.ToInt32(filas["trn_Check"]); items.change = Convert.ToInt32(filas["trn_Change"]); list.Add(items); } return(list); }
public void setTransactionInitialCash(string initialCash) { var transaction = new transaction(); initialCash = initialCash.Remove(0, 1); transaction.cash = (float)Convert.ToDouble(initialCash); transaction.type = (int)TRANSACTIONTYPE.INITIAL; transaction.comment = "Initial Cash"; transaction.userId = userInformation.user.usr_ID; transaction.registerId = userInformation.user.usr_Username; List <columnsValues> valuesArray = new List <columnsValues>(); valuesArray.Add(createItem.ofTypeColumnsValues("trn_User_ID", transaction.userId)); //valuesArray.Add(createItem.ofTypeColumnsValues("trn_DateRegistered", date.getCurrentDate())); valuesArray.Add(createItem.ofTypeColumnsValues("trn_Comment", transaction.comment)); valuesArray.Add(createItem.ofTypeColumnsValues("trn_Type", transaction.type)); //valuesArray.Add(createItem.ofTypeColumnsValues("trn_Initial_Cash", transactionArray.cash)); valuesArray.Add(createItem.ofTypeColumnsValues("trn_Cash", transaction.cash)); valuesArray.Add(createItem.ofTypeColumnsValues("trn_CheckNumber", transaction.checkNumber)); valuesArray.Add(createItem.ofTypeColumnsValues("trn_Copayment", transaction.copayment)); valuesArray.Add(createItem.ofTypeColumnsValues("trn_SelfPay", transaction.selfPay)); valuesArray.Add(createItem.ofTypeColumnsValues("trn_Deductible", transaction.deductible)); valuesArray.Add(createItem.ofTypeColumnsValues("trn_Labs", transaction.labs)); valuesArray.Add(createItem.ofTypeColumnsValues("trn_Other", transaction.other)); valuesArray.Add(createItem.ofTypeColumnsValues("trn_Closed", transaction.closed)); valuesArray.Add(createItem.ofTypeColumnsValues("trn_RegisterID", "1")); //TODO: cambiar esto createQuery.toInsert("transactions", valuesArray); }
public List <transaction> getTransactionByTransactionID(string transactionID) { var terms = new List <valuesWhere>(); var list = new List <transaction>(); terms.Add(createItem.ofTypeValuesWhere(false, "trn_ID", transactionID, (int)OPERATORBOOLEAN.AND, (int)OPERATOR.EQUALITY)); terms.Add(createItem.ofTypeValuesWhere(true, "trn_Comment", "Initial Cash", (int)OPERATORBOOLEAN.NONE, (int)OPERATOR.INEGUALITY)); var data = createQuery.toSelectAll("transactions", terms); for (int i = 0; i < data.Rows.Count; i++) { DataRow filas = data.Rows[i]; var items = new transaction(); items.amountCharged = Convert.ToInt32(filas["trn_AmountCharged"]); items.copayment = Convert.ToBoolean(filas["trn_Copayment"]); items.selfPay = Convert.ToBoolean(filas["trn_SelfPay"]); items.deductible = Convert.ToBoolean(filas["trn_Deductible"]); items.labs = Convert.ToBoolean(filas["trn_Labs"]); items.otherComments = Convert.ToString(filas["trn_OtherComments"]); list.Add(items); } return(list); }
private List <transaction> setTransactionsInList(DataTable data) { var list = new List <transaction>(); for (int i = 0; i < data.Rows.Count; i++) { DataRow filas = data.Rows[i]; var items = new transaction(); items.trn_id = Convert.ToInt32(filas["trn_ID"]); items.userId = Convert.ToInt32(filas["trn_User_ID"]); items.dateRegistered = Convert.ToString(filas["trn_DateRegistered"]); items.type = Convert.ToInt32(filas["trn_Type"]); items.amountCharged = Convert.ToInt32(filas["trn_AmountCharged"]); items.cash = Convert.ToInt32(filas["trn_Cash"]); items.credit = Convert.ToInt32(filas["trn_Credit"]); items.check = Convert.ToInt32(filas["trn_Check"]); items.checkNumber = Convert.ToInt32(filas["trn_CheckNumber"]); items.change = Convert.ToInt32(filas["trn_Change"]); items.patientFirstName = Convert.ToString(filas["trn_PatientFirstName"]); items.closed = Convert.ToBoolean(filas["trn_Closed"]); items.registerId = Convert.ToString(filas["trn_RegisterID"]); list.Add(items); } return(list); }
private string getTransactionComment(transaction trn) { string transactionComment = ""; string amount = ""; switch (trn.type) { case (int)TRANSACTIONTYPE.INITIAL: amount = moneyFormatService.AddFloat(trn.cash.ToString()); transactionComment = "Initial Cash In for total amount: $" + amount; break; case (int)TRANSACTIONTYPE.IN: amount = moneyFormatService.AddFloat(getTotalAmount(trn).ToString()); if (trn.copayment) { transactionComment = "Payment for total amount: $"; } else if (trn.selfPay) { transactionComment = "SelPay for total amount: $"; } else if (trn.deductible) { transactionComment = "Deductible for total amount: $"; } else if (trn.other) { transactionComment = trn.otherComments + " for total amount: $"; } else if (trn.labs) { transactionComment = "Labs for total amount: $"; } transactionComment += amount; break; case (int)TRANSACTIONTYPE.REFOUND: amount = moneyFormatService.AddFloat(trn.amountCharged.ToString()); transactionComment = "Refound for total amount: $" + amount; break; case (int)TRANSACTIONTYPE.OUT: amount = moneyFormatService.AddFloat(getTotalAmount(trn).ToString()); transactionComment = "Cash out for total amount: $" + amount; break; } return(transactionComment); }
public void setTransactionRefund(transaction trn) { List <columnsValues> valuesArray = new List <columnsValues>(); valuesArray.Add(createItem.ofTypeColumnsValues("trn_User_ID", trn.userId)); //valuesArray.Add(createItem.ofTypeColumnsValues("trn_DateRegistered", date.getCurrentDate())); valuesArray.Add(createItem.ofTypeColumnsValues("trn_Comment", trn.comment)); valuesArray.Add(createItem.ofTypeColumnsValues("trn_Type", trn.type)); valuesArray.Add(createItem.ofTypeColumnsValues("trn_AmountCharged", trn.amountCharged)); valuesArray.Add(createItem.ofTypeColumnsValues("trn_CheckNumber", 0)); //checar esto bien valuesArray.Add(createItem.ofTypeColumnsValues("trn_Copayment", trn.copayment)); valuesArray.Add(createItem.ofTypeColumnsValues("trn_SelfPay", trn.selfPay)); valuesArray.Add(createItem.ofTypeColumnsValues("trn_Deductible", trn.deductible)); valuesArray.Add(createItem.ofTypeColumnsValues("trn_Labs", trn.labs)); valuesArray.Add(createItem.ofTypeColumnsValues("trn_Other", trn.other)); valuesArray.Add(createItem.ofTypeColumnsValues("trn_Closed", trn.closed)); valuesArray.Add(createItem.ofTypeColumnsValues("trn_RegisterID", "1")); //cambiar esto createQuery.toInsert("transactions", valuesArray); }
private void btn_close_Click(object sender, RoutedEventArgs e) { var trn = new transaction(); trn.patientFirstName = txtbox_patientFirstName.Text; trn.amountCharged = (float)Convert.ToDouble(txtbox_amountCharge.Text.Remove(0,1)); trn.cash = (float)Convert.ToDouble(txtbox_cash.Text.Remove(0, 1)); trn.credit = (float)Convert.ToDouble(txtbox_credit.Text.Remove(0, 1)); trn.check = (float)Convert.ToDouble(txtbox_check.Text.Remove(0, 1)); trn.checkNumber = Convert.ToInt32(txtbox_numberChecks.Text); trn.copayment = (bool)checkbox_copayment.IsChecked; trn.selfPay = (bool)checkbox_selfPay.IsChecked; trn.deductible = (bool)checkbox_deductible.IsChecked; trn.labs = (bool)checkbox_labs.IsChecked; trn.other = (bool)checkbox_other.IsChecked; trn.otherComments = txtbox_other.Text; trn.comment = txtbox_comment.Text; trn.change = (float)Convert.ToDouble(label_change.Text.Remove(0, 1)); transaction.updateTransaction(trn); setLog("Cancel"); }
public List <transaction> getAllTransactionsByRegisterID(string registerID, string fromDate, string toDate) { var terms = new List <valuesWhere>(); var list = new List <transaction>(); terms.Add(createItem.ofTypeValuesWhere(false, "trn_ID", registerID, (int)OPERATORBOOLEAN.AND, (int)OPERATOR.EQUALITY)); terms.Add(createItem.ofTypeValuesWhere(true, "trn_DateRegistered", date.convertToFormatDate(fromDate), (int)OPERATORBOOLEAN.AND, (int)OPERATOR.GREATER_THAN_OR_EQUAL)); terms.Add(createItem.ofTypeValuesWhere(true, "trn_DateRegistered", date.convertToFormatDateFinal(toDate), (int)OPERATORBOOLEAN.AND, (int)OPERATOR.LESS_THAN_OR_EQUAL)); terms.Add(createItem.ofTypeValuesWhere(true, "trn_Comment", "Initial Cash", (int)OPERATORBOOLEAN.NONE, (int)OPERATOR.INEGUALITY)); var data = createQuery.toSelectAll("transactions", terms); for (int i = 0; i < data.Rows.Count; i++) { DataRow filas = data.Rows[i]; var items = new transaction(); items.trn_id = Convert.ToInt32(filas["trn_ID"]); items.amountCharged = Convert.ToInt32(filas["trn_AmountCharged"]); items.cash = Convert.ToInt32(filas["trn_Cash"]); items.credit = Convert.ToInt32(filas["trn_Credit"]); items.check = Convert.ToInt32(filas["trn_Check"]); items.change = Convert.ToInt32(filas["trn_Change"]); items.patientFirstName = filas["trn_PatientFirstName"].ToString(); items.selfPay = (bool)filas["trn_SelfPay"]; items.copayment = (bool)filas["trn_Copayment"]; items.comment = filas["trn_Comment"].ToString(); items.deductible = (bool)filas["trn_Deductible"]; items.labs = (bool)filas["trn_Labs"]; items.other = (bool)filas["trn_Other"]; items.checkNumber = Convert.ToInt32(filas["trn_CheckNumber"]); list.Add(items); } return(list); }
public List <transaction> getCurrentTransactions(int currentUserID) { DataTable data = new DataTable(); var list = new List <transaction>(); var columns = new List <string>(); columns.Add("trn_ID"); columns.Add("trn_User_ID"); columns.Add("trn_DateRegistered"); columns.Add("trn_Comment"); columns.Add("trn_Type"); columns.Add("trn_AmountCharged"); columns.Add("trn_Cash"); columns.Add("trn_Credit"); columns.Add("trn_Check"); columns.Add("trn_CheckNumber"); columns.Add("trn_Change"); columns.Add("trn_PatientFirstName"); columns.Add("trn_Copayment"); columns.Add("trn_SelfPay"); columns.Add("trn_Deductible"); columns.Add("trn_Labs"); columns.Add("trn_Other"); columns.Add("trn_OtherComments"); columns.Add("trn_Closed"); columns.Add("trn_RegisterID"); columns.Add("trn_ModifiedBy_ID"); columns.Add("trn_ModificationDate"); var listTerms = new List <valuesWhere>(); listTerms.Add(createItem.ofTypeValuesWhere(false, "trn_User_ID", currentUserID.ToString(), (int)OPERATORBOOLEAN.AND, (int)OPERATOR.EQUALITY)); listTerms.Add(createItem.ofTypeValuesWhere(true, "trn_DateRegistered", date.getInitialDate(), (int)OPERATORBOOLEAN.AND, (int)OPERATOR.GREATER_THAN_OR_EQUAL)); listTerms.Add(createItem.ofTypeValuesWhere(true, "trn_DateRegistered", date.getEndDate(), (int)OPERATORBOOLEAN.NONE, (int)OPERATOR.LESS_THAN_OR_EQUAL)); //listTerms.Add(createItem.ofTypeValuesWhere(true, "trn_Comment", "Initial Cash", (int)OPERATORBOOLEAN.NINGUNO, (int)OPERATOR.INEGUALITY)); data = createQuery.toSelect(columns, "transactions", listTerms); for (int i = 0; i < data.Rows.Count; i++) { DataRow filas = data.Rows[i]; var items = new transaction(); items.trn_id = Convert.ToInt32(filas["trn_ID"]); items.userId = Convert.ToInt32(filas["trn_User_ID"]); items.dateRegistered = Convert.ToString(filas["trn_DateRegistered"]); items.comment = Convert.ToString(filas["trn_Comment"]); items.type = Convert.ToInt32(filas["trn_Type"]); items.amountCharged = Convert.ToInt32(filas["trn_AmountCharged"]); items.cash = Convert.ToInt32(filas["trn_Cash"]); items.credit = Convert.ToInt32(filas["trn_Credit"]); items.check = Convert.ToInt32(filas["trn_Check"]); items.checkNumber = Convert.ToInt32(filas["trn_CheckNumber"]); items.change = Convert.ToInt32(filas["trn_Change"]); items.patientFirstName = Convert.ToString(filas["trn_PatientFirstName"]); items.copayment = Convert.ToBoolean(filas["trn_Copayment"]); items.selfPay = Convert.ToBoolean(filas["trn_SelfPay"]); items.deductible = Convert.ToBoolean(filas["trn_Deductible"]); items.labs = Convert.ToBoolean(filas["trn_Labs"]); items.other = Convert.ToBoolean(filas["trn_Other"]); items.otherComments = Convert.ToString(filas["trn_OtherComments"]); items.closed = Convert.ToBoolean(filas["trn_Closed"]); items.registerId = Convert.ToString(filas["trn_RegisterID"]); items.modifiedById = Convert.ToInt32(filas["trn_ModifiedBy_ID"]); items.modificationDate = Convert.ToString(filas["trn_ModificationDate"]); list.Add(items); } return(list); }
private float getTotalAmount(transaction trn) { return(trn.cash + trn.credit + trn.check - trn.change); }