public void AddAECommissionAmountRecord(AECommissionAmount aeCommissionAmount)
 {
     try
     {
         aeCommissionAmount.Save();
     }
     catch (Exception ex)
     {
         WebCommon.LogExceptionInfo(ex);
         throw new Exception("An error occurred while trying to add the Commission Amount record.");
     }
 }
Exemple #2
0
 /// <summary>TBD</summary>
 /// <param name="aeId">TBD</param>
 /// <param name="companyId">TBD</param>
 /// <returns>TBD</returns>
 public static List<AECommissionAmount> GetAECommissionAmounts(string aeId, int companyId)
 {
     List<AECommissionAmount> aeCommissionAmounts = new List<AECommissionAmount>();
     DataSet historyData;
     using (IO io = new IO(WebCommon.ConnectionString))
     {
         historyData = io.ExecuteDataSetQuery(IO.CreateCommandFromStoredProc("MASTERDATA_GETCOMMISSIONAMOUNTHISTORY",
             Param.CreateParam("AEID", SqlDbType.VarChar, aeId),
             Param.CreateParam("COMPANYID", SqlDbType.Int, companyId)));
     }
     if (historyData.Tables[0].Rows.Count == 0)
     {
         return aeCommissionAmounts;
     }
     AECommissionAmount commissionAmount;
     foreach (DataRow commissionAmountRecord in historyData.Tables[0].Rows)
     {
         commissionAmount = new AECommissionAmount();
         commissionAmount.AECommissionAmountId = (int)commissionAmountRecord["AE_COMMISSION_AMOUNT_ID"];
         commissionAmount.AEId = Convert.ToString(IO.GetDataRowValue(commissionAmountRecord, "ACCOUNT_EXECUTIVE_ID", ""));
         commissionAmount.CommissionYear = (int)commissionAmountRecord["COMMISSION_YEAR"];
         commissionAmount.CommissionAmount = Convert.ToDouble(commissionAmountRecord["COMMISSION_AMOUNT"]);
         commissionAmount.EntryDate = Convert.ToDateTime(IO.GetDataRowValue(commissionAmountRecord, "ENTRY_DATE", DateTime.MinValue));
         commissionAmount.DateLastModified = Convert.ToDateTime(IO.GetDataRowValue(commissionAmountRecord, "DATE_LAST_MODIFIED", DateTime.MinValue));
         commissionAmount.EnteredBy = Convert.ToString(IO.GetDataRowValue(commissionAmountRecord, "ENTERED_BY", ""));
         commissionAmount.CompanyId = (int)commissionAmountRecord["COMPANY_ID"];
         aeCommissionAmounts.Add(commissionAmount);
     }
     return aeCommissionAmounts;
 }