public Decimal GetCurrentACLimit(long clientId, int userId, DateTime date) { ArgumentChecker.ThrowIfNull(clientId, "clientId"); ArgumentChecker.ThrowIfNull(userId, "userId"); DataEntry.Clients mClient = new DataEntry.Clients(); System.Collections.ArrayList arrPar = new System.Collections.ArrayList(); Int16 isNow = 0; if (DateTime.Compare(date, DateTime.Today) != 0) { isNow = -1; } int yrmth = Convert.ToInt32(date.Year.ToString() + date.Month.ToString().PadLeft(2, '0')); //int yrmth = Convert.ToInt32(DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString().PadLeft(2, '0')); arrPar.Add(0); arrPar.Add(clientId); arrPar.Add(yrmth); arrPar.Add(date); arrPar.Add(userId); arrPar.Add(isNow); System.Data.DataSet theDS = mClient.CACrLimitFromDrMgt(arrPar); if (theDS != null) { DataRow DR = theDS.Tables[0].Rows[0]; return(Convert.ToDecimal(DR["limit"])); } else { return(0); } }
public List <Decimal> GetCurrentACLimitExt(long clientId, int userId, DateTime date) { ArgumentChecker.ThrowIfNull(clientId, "clientId"); ArgumentChecker.ThrowIfNull(userId, "userId"); List <Decimal> record = new List <decimal>(); DataEntry.Clients mClient = new DataEntry.Clients(); System.Collections.ArrayList arrPar = new System.Collections.ArrayList(); Int16 isNow = 0; if (DateTime.Compare(date, DateTime.Today) != 0) { isNow = -1; } int yrmth = Convert.ToInt32(date.Year.ToString() + date.Month.ToString().PadLeft(2, '0')); int fType = 5; string dateNow = date.ToString("dd/M/yyyy"); //int yrmth = Convert.ToInt32(DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString().PadLeft(2, '0')); arrPar.Add(0); arrPar.Add(clientId); arrPar.Add(yrmth); //arrPar.Add(date); arrPar.Add(dateNow); arrPar.Add(userId); arrPar.Add(isNow); arrPar.Add(fType); System.Data.DataSet theDS = mClient.CACrLimitFromDrMgt(arrPar); if (theDS != null) { DataRow DR = theDS.Tables[0].Rows[0]; record.Add(Convert.ToDecimal(DR["limit"])); record.Add(Convert.ToDecimal(DR["IntAndChargesDrMgt"])); record.Add(Convert.ToDecimal(DR["IntAndChargesCA"])); record.Add(Convert.ToDecimal(DR["IntAndChargesDrMgtPriorMth"])); record.Add((Convert.ToDecimal(DR["IntAndChargesCAPriorMth"]))); } return(record); }