/// <summary> /// Creates a new instance of the Sol_OrderCardLog class and populates it with data from the specified SqlDataReader. /// </summary> protected virtual Sol_OrderCardLog MakeSol_OrderCardLog(SqlDataReader dataReader) { Sol_OrderCardLog sol_OrderCardLog = new Sol_OrderCardLog(); sol_OrderCardLog.LogID = SqlClientUtility.GetInt32(dataReader, "LogID", 0); sol_OrderCardLog.CardNumber = SqlClientUtility.GetString(dataReader, "CardNumber", String.Empty); sol_OrderCardLog.OrderID = SqlClientUtility.GetInt32(dataReader, "OrderID", 0); sol_OrderCardLog.DateAdded = SqlClientUtility.GetDateTime(dataReader, "DateAdded", new DateTime(0)); sol_OrderCardLog.DatePaid = SqlClientUtility.GetDateTime(dataReader, "DatePaid", new DateTime(0)); return(sol_OrderCardLog); }
/// <summary> /// Saves a record to the Sol_OrderCardLog table. /// </summary> public virtual void Insert(Sol_OrderCardLog sol_OrderCardLog) { ValidationUtility.ValidateArgument("sol_OrderCardLog", sol_OrderCardLog); SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@CardNumber", sol_OrderCardLog.CardNumber), new SqlParameter("@OrderID", sol_OrderCardLog.OrderID), new SqlParameter("@DateAdded", sol_OrderCardLog.DateAdded), new SqlParameter("@DatePaid", sol_OrderCardLog.DatePaid) }; sol_OrderCardLog.LogID = (int)SqlClientUtility.ExecuteScalar(connectionStringName, CommandType.StoredProcedure, "Sol_OrderCardLog_Insert", parameters); }
/// <summary> /// Selects all records from the Sol_OrderCardLog table. /// </summary> public virtual List <Sol_OrderCardLog> SelectAll() { using (SqlDataReader dataReader = SqlClientUtility.ExecuteReader(connectionStringName, CommandType.StoredProcedure, "Sol_OrderCardLog_SelectAll")) { List <Sol_OrderCardLog> sol_OrderCardLogList = new List <Sol_OrderCardLog>(); while (dataReader.Read()) { Sol_OrderCardLog sol_OrderCardLog = MakeSol_OrderCardLog(dataReader); sol_OrderCardLogList.Add(sol_OrderCardLog); } return(sol_OrderCardLogList); } }
private bool UpdateOrderCardLink(int orderId) { if (String.IsNullOrEmpty(strCardNumber)) { return(true); } if (sol_OrderCardLink_Sp == null) { sol_OrderCardLink_Sp = new Sol_OrderCardLink_Sp(Properties.Settings.Default.WsirDbConnectionString); } if (sol_OrderCardLog_Sp == null) { sol_OrderCardLog_Sp = new Sol_OrderCardLog_Sp(Properties.Settings.Default.WsirDbConnectionString); } //7) The paid routine should also: // Delete all paid orders from the sol_OrderCardLink table // Update all paid orders in the sol_OrderCardLog table with paiddate sol_OrderCardLink_Sp.DeleteByCardNumber(strCardNumber); sol_OrderCardLog = sol_OrderCardLog_Sp.Select(strCardNumber, orderId); if (sol_OrderCardLog == null) { return(false); } sol_OrderCardLog.DatePaid = Main.rc.FechaActual; sol_OrderCardLog_Sp.Update(sol_OrderCardLog); return(true); }