private List <closeDate> setCloseDateInList(DataTable data) { var list = new List <closeDate>(); for (int i = 0; i < data.Rows.Count; i++) { DataRow filas = data.Rows[i]; var items = new closeDate(); items.clt_closed_ID = Convert.ToInt32(filas["clt_closed_ID"]); items.clt_100_bills = Convert.ToDouble(filas["clt_100_bills"]); items.clt_50_bills = Convert.ToDouble(filas["clt_50_bills"]); items.clt_20_bills = Convert.ToDouble(filas["clt_20_bills"]); items.clt_10_bills = Convert.ToDouble(filas["clt_10_bills"]); items.clt_5_bills = Convert.ToDouble(filas["clt_5_bills"]); items.clt_1_bills = Convert.ToDouble(filas["clt_1_bills"]); items.clt_checks_amount = Convert.ToInt32(filas["clt_checks_amount"]); items.clt_credits_amount = Convert.ToInt32(filas["clt_credits_amount"]); items.clt_total_charged = Convert.ToDouble(filas["clt_total_charged"]); items.clt_total_cash = Convert.ToDouble(filas["clt_total_cash"]); items.clt_total_check = Convert.ToDouble(filas["clt_total_check"]); items.clt_total_credit = Convert.ToDouble(filas["clt_total_credit"]); items.clt_initial_cash = Convert.ToDouble(filas["clt_initial_cash"]); items.clt_balance = Convert.ToDouble(filas["clt_balance"]); items.clt_transaction_count = Convert.ToInt32(filas["clt_transaction_count"]); items.clt_reg_RegisterID = Convert.ToString(filas["clt_reg_RegisterID"]); items.clt_Username = Convert.ToString(filas["clt_Username"]); items.clt_Datetime = Convert.ToString(filas["clt_Datetime"]); list.Add(items); } return(list); }
public void setClosedTransaction(closeDate trn) { int maxid = 0; var list = new List <columnsValues>(); var trns = getCurrentTransactions(userInformation.user.usr_ID); var checkCount = 0; var creditAmount = 0; var totalCharged = 0.00; for (int i = 0; i < trns.Count(); i++) { checkCount += trns[i].checkNumber; if (trns[i].credit > 0) { creditAmount++; } totalCharged += trns[i].cash + trns[i].credit + trns[i].check; } var lis = new List <valuesWhere>(); maxid = createQuery.toMax("clt_closed_ID", "ClosedTransactions", lis); list.Add(createItem.ofTypeColumnsValues("clt_closed_ID", maxid + 1)); list.Add(createItem.ofTypeColumnsValues("clt_100_bills", (float)trn.clt_100_bills)); list.Add(createItem.ofTypeColumnsValues("clt_50_bills", (float)trn.clt_50_bills)); list.Add(createItem.ofTypeColumnsValues("clt_20_bills", (float)trn.clt_20_bills)); list.Add(createItem.ofTypeColumnsValues("clt_10_bills", (float)trn.clt_10_bills)); list.Add(createItem.ofTypeColumnsValues("clt_5_bills", (float)trn.clt_5_bills)); list.Add(createItem.ofTypeColumnsValues("clt_1_bills", (float)trn.clt_1_bills)); list.Add(createItem.ofTypeColumnsValues("clt_checks_amount", checkCount)); list.Add(createItem.ofTypeColumnsValues("clt_total_charged", (float)totalCharged)); list.Add(createItem.ofTypeColumnsValues("clt_credits_amount", creditAmount)); list.Add(createItem.ofTypeColumnsValues("clt_total_cash", (float)trn.clt_total_cash)); list.Add(createItem.ofTypeColumnsValues("clt_total_check", (float)trn.clt_total_check)); list.Add(createItem.ofTypeColumnsValues("clt_total_credit", (float)trn.clt_total_credit)); list.Add(createItem.ofTypeColumnsValues("clt_initial_cash", (float)getInitialCashbyLoginID())); list.Add(createItem.ofTypeColumnsValues("clt_balance", (float)closeDateInformation.closeDate.clt_balance)); list.Add(createItem.ofTypeColumnsValues("clt_transaction_count", (float)closeDateInformation.closeDate.clt_transaction_count)); list.Add(createItem.ofTypeColumnsValues("clt_reg_RegisterID", 1)); // Falta guardar el ID de la caja registradora en la que se encuentra list.Add(createItem.ofTypeColumnsValues("clt_Username", userInformation.user.usr_Username)); list.Add(createItem.ofTypeColumnsValues("clt_Datetime", date.getCurrentDate())); createQuery.toInsert("ClosedTransactions", list); }