public void Add(SwitchTypeInvestmentRecommendation switchTypeInvestment) { try { //string clientName = DataBase.DBService.ExecuteCommandScalar(string.Format(GET_CLIENT_NAME_QUERY, lumsumInvestmentRecomendation.Pid)); DataBase.DBService.ExecuteCommand(string.Format(INSERT_QUERY, switchTypeInvestment.Pid, switchTypeInvestment.FromSchemeId, switchTypeInvestment.ToSchemeId, switchTypeInvestment.Amount, switchTypeInvestment.CreatedOn.ToString("yyyy-MM-dd hh:mm:ss"), switchTypeInvestment.CreatedBy, switchTypeInvestment.UpdatedOn.ToString("yyyy-MM-dd hh:mm:ss"), switchTypeInvestment.UpdatedBy)); Activity.ActivitiesService.Add(ActivityType.CreateInvestmentRecommendation, EntryStatus.Success, Source.Server, switchTypeInvestment.UpdatedByUserName, switchTypeInvestment.ToSchemeName, switchTypeInvestment.MachineName); } catch (Exception ex) { StackTrace st = new StackTrace(); StackFrame sf = st.GetFrame(0); MethodBase currentMethodName = sf.GetMethod(); LogDebug(currentMethodName.Name, ex); throw ex; } }
private SwitchTypeInvestmentRecommendation convertToSTPInvestmentRecomendationObject(DataRow dr) { SwitchTypeInvestmentRecommendation switchTypeInvestmentRecommendation = new SwitchTypeInvestmentRecommendation(); switchTypeInvestmentRecommendation.Pid = dr.Field <int>("PId"); switchTypeInvestmentRecommendation.FromSchemeId = dr.Field <int>("FromSchemeId"); switchTypeInvestmentRecommendation.FromSchemeName = dr.Field <string>("FromScheme"); switchTypeInvestmentRecommendation.ToSchemeId = dr.Field <int>("ToSchemeId"); switchTypeInvestmentRecommendation.ToSchemeName = getSchemeName(switchTypeInvestmentRecommendation.ToSchemeId); switchTypeInvestmentRecommendation.Amount = double.Parse(dr["Amount"].ToString()); return(switchTypeInvestmentRecommendation); }
public Result Delete(SwitchTypeInvestmentRecommendation lumsumInvestmentRecomendation) { var result = new Result(); try { SwitchInvestmentRecommendationService switchInvestmentRecomendationService = new SwitchInvestmentRecommendationService(); switchInvestmentRecomendationService.Delete(lumsumInvestmentRecomendation); result.IsSuccess = true; } catch (Exception exception) { result.IsSuccess = false; result.ExceptionInfo = exception; } return(result); }
public void Delete(SwitchTypeInvestmentRecommendation switchTypeInvestment) { try { string clientName = DataBase.DBService.ExecuteCommandScalar(string.Format(GET_CLIENT_NAME_QUERY, switchTypeInvestment.Pid)); DataBase.DBService.ExecuteCommand(string.Format(DELETE_QUERY, switchTypeInvestment.Pid, switchTypeInvestment.ToSchemeId, switchTypeInvestment.Amount)); Activity.ActivitiesService.Add(ActivityType.DeleteInvestmentRecommendation, EntryStatus.Success, Source.Server, switchTypeInvestment.UpdatedByUserName, switchTypeInvestment.ToSchemeName, switchTypeInvestment.MachineName); } catch (Exception ex) { StackTrace st = new StackTrace(); StackFrame sf = st.GetFrame(0); MethodBase currentMethodName = sf.GetMethod(); LogDebug(currentMethodName.Name, ex); throw ex; } }
public IList <SwitchTypeInvestmentRecommendation> GetAll(int plannerId) { IList <SwitchTypeInvestmentRecommendation> lumsumInvestmentRecomendations = new List <SwitchTypeInvestmentRecommendation>(); try { Logger.LogInfo("Get: STP investment process start"); DataTable dtAppConfig = DataBase.DBService.ExecuteCommand(string.Format(SELECT_ALL, plannerId)); foreach (DataRow dr in dtAppConfig.Rows) { SwitchTypeInvestmentRecommendation switchType = convertToSTPInvestmentRecomendationObject(dr); lumsumInvestmentRecomendations.Add(switchType); } Logger.LogInfo("Get: STP investment process completed."); } catch (Exception ex) { StackTrace st = new StackTrace(); StackFrame sf = st.GetFrame(0); MethodBase currentMethodName = sf.GetMethod(); LogDebug(currentMethodName.Name, ex); } return(lumsumInvestmentRecomendations); }