private SukanyaSamrudhi convertToSukanyaSamrudhi(DataRow dr) { SukanyaSamrudhi SukanyaSamrudhi = new SukanyaSamrudhi(); SukanyaSamrudhi.Id = dr.Field <int>("ID"); SukanyaSamrudhi.Pid = dr.Field <int>("PID"); SukanyaSamrudhi.InvesterName = dr.Field <string>("InvesterName"); SukanyaSamrudhi.AccountNo = dr.Field <string>("AccountNo"); SukanyaSamrudhi.Bank = dr.Field <string>("Bank"); SukanyaSamrudhi.OpeningDate = dr.Field <DateTime>("OpeningDate"); SukanyaSamrudhi.CurrentValue = Double.Parse(dr["CurrentValue"].ToString()); SukanyaSamrudhi.MaturityDate = dr.Field <DateTime>("MaturityDate"); SukanyaSamrudhi.GoalId = dr.Field <int>("GoalId"); SukanyaSamrudhi.UpdatedBy = dr.Field <int>("UpdatedBy"); SukanyaSamrudhi.UpdatedOn = dr.Field <DateTime>("UpdatedOn"); SukanyaSamrudhi.UpdatedByUserName = dr.Field <string>("UpdatedByUserName"); SukanyaSamrudhi.UpdatedBy = dr.Field <int>("UpdatedBy"); SukanyaSamrudhi.UpdatedOn = dr.Field <DateTime>("UpdatedOn"); SukanyaSamrudhi.UpdatedByUserName = dr.Field <string>("UpdatedByUserName"); SukanyaSamrudhi.InvestmentReturnRate = float.Parse(dr["InvestmentReturnRate"].ToString()); return(SukanyaSamrudhi); }
public SukanyaSamrudhi Get(int id) { try { Logger.LogInfo("Get: SukanyaSamrudhi by id process start"); SukanyaSamrudhi SukanyaSamrudhi = new SukanyaSamrudhi(); DataTable dtAppConfig = DataBase.DBService.ExecuteCommand(string.Format(SELECT_ID, id)); foreach (DataRow dr in dtAppConfig.Rows) { SukanyaSamrudhi = convertToSukanyaSamrudhi(dr); } Logger.LogInfo("Get: SukanyaSamrudhi by id process completed"); return(SukanyaSamrudhi); } catch (Exception ex) { StackTrace st = new StackTrace(); StackFrame sf = st.GetFrame(0); MethodBase currentMethodName = sf.GetMethod(); LogDebug(currentMethodName.Name, ex); return(null); } }
public void Delete(SukanyaSamrudhi SukanyaSamrudhi) { try { string clientName = DataBase.DBService.ExecuteCommandScalar(string.Format(SELECT_ID, SukanyaSamrudhi.Id)); DataBase.DBService.BeginTransaction(); DataBase.DBService.ExecuteCommandString(string.Format(DELETE_SukanyaSamrudhi, SukanyaSamrudhi.Id), true); Activity.ActivitiesService.Add(ActivityType.DeleteSukanyaSamrudhi, EntryStatus.Success, Source.Server, SukanyaSamrudhi.UpdatedByUserName, SukanyaSamrudhi.AccountNo, SukanyaSamrudhi.MachineName); DataBase.DBService.CommitTransaction(); } catch (Exception ex) { DataBase.DBService.RollbackTransaction(); StackTrace st = new StackTrace(); StackFrame sf = st.GetFrame(0); MethodBase currentMethodName = sf.GetMethod(); LogDebug(currentMethodName.Name, ex); throw ex; } }