Ejemplo n.º 1
0
        public void Add(EPF EPF)
        {
            try
            {
                string clientName = DataBase.DBService.ExecuteCommandScalar(string.Format(SELECT_ID, EPF.Id));

                DataBase.DBService.BeginTransaction();
                DataBase.DBService.ExecuteCommandString(string.Format(INSERT_EPF,
                                                                      EPF.Pid, EPF.InvesterName, EPF.AccountNo,
                                                                      EPF.Particular,
                                                                      EPF.Amount,
                                                                      EPF.GoalId,
                                                                      EPF.InvestmentReturnRate,
                                                                      EPF.CreatedOn.ToString("yyyy-MM-dd hh:mm:ss"), EPF.CreatedBy,
                                                                      EPF.UpdatedOn.ToString("yyyy-MM-dd hh:mm:ss"), EPF.UpdatedBy), true);

                Activity.ActivitiesService.Add(ActivityType.CreateEPF, EntryStatus.Success,
                                               Source.Server, EPF.UpdatedByUserName, EPF.AccountNo, EPF.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;
            }
        }
Ejemplo n.º 2
0
        public IList <EPF> GetAll(int plannerId)
        {
            try
            {
                Logger.LogInfo("Get: EPF process start");
                IList <EPF> lstEPFOption = new List <EPF>();

                DataTable dtAppConfig = DataBase.DBService.ExecuteCommand(string.Format(SELECT_ALL, plannerId));
                foreach (DataRow dr in dtAppConfig.Rows)
                {
                    EPF mf = convertToEPF(dr);
                    lstEPFOption.Add(mf);
                }
                Logger.LogInfo("Get: EPF fund process completed.");
                return(lstEPFOption);
            }
            catch (Exception ex)
            {
                StackTrace st = new StackTrace();
                StackFrame sf = st.GetFrame(0);
                MethodBase currentMethodName = sf.GetMethod();
                LogDebug(currentMethodName.Name, ex);
                return(null);
            }
        }
        public Result Delete(EPF EPF)
        {
            var result = new Result();

            try
            {
                EPFService EPFService = new EPFService();
                EPFService.Delete(EPF);
                result.IsSuccess = true;
            }
            catch (Exception exception)
            {
                result.IsSuccess     = false;
                result.ExceptionInfo = exception;
            }
            return(result);
        }
Ejemplo n.º 4
0
        private EPF convertToEPF(DataRow dr)
        {
            EPF EPF = new EPF();

            EPF.Id                   = dr.Field <int>("ID");
            EPF.Pid                  = dr.Field <int>("PID");
            EPF.InvesterName         = dr.Field <string>("InvesterName");
            EPF.AccountNo            = dr.Field <string>("AccountNo");
            EPF.Particular           = dr.Field <string>("Particular");
            EPF.Amount               = Double.Parse(dr["Amount"].ToString());
            EPF.InvestmentReturnRate = float.Parse(dr["INVESTMENTRETURNRATE"].ToString());
            EPF.GoalId               = dr.Field <int>("GoalId");
            EPF.UpdatedBy            = dr.Field <int>("UpdatedBy");
            EPF.UpdatedOn            = dr.Field <DateTime>("UpdatedOn");
            EPF.UpdatedByUserName    = dr.Field <string>("UpdatedByUserName");
            EPF.UpdatedBy            = dr.Field <int>("UpdatedBy");
            EPF.UpdatedOn            = dr.Field <DateTime>("UpdatedOn");
            EPF.UpdatedByUserName    = dr.Field <string>("UpdatedByUserName");
            return(EPF);
        }
Ejemplo n.º 5
0
        public EPF Get(int id)
        {
            try
            {
                Logger.LogInfo("Get: EPF by id process start");
                EPF EPF = new EPF();

                DataTable dtAppConfig = DataBase.DBService.ExecuteCommand(string.Format(SELECT_ID, id));
                foreach (DataRow dr in dtAppConfig.Rows)
                {
                    EPF = convertToEPF(dr);
                }
                Logger.LogInfo("Get: EPF by id process completed");
                return(EPF);
            }
            catch (Exception ex)
            {
                StackTrace st = new StackTrace();
                StackFrame sf = st.GetFrame(0);
                MethodBase currentMethodName = sf.GetMethod();
                LogDebug(currentMethodName.Name, ex);
                return(null);
            }
        }
Ejemplo n.º 6
0
        public void Delete(EPF EPF)
        {
            try
            {
                string clientName = DataBase.DBService.ExecuteCommandScalar(string.Format(SELECT_ID, EPF.Id));

                DataBase.DBService.BeginTransaction();
                DataBase.DBService.ExecuteCommandString(string.Format(DELETE_EPF,
                                                                      EPF.Id), true);

                Activity.ActivitiesService.Add(ActivityType.DeleteEPF, EntryStatus.Success,
                                               Source.Server, EPF.UpdatedByUserName, EPF.AccountNo, EPF.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;
            }
        }