示例#1
0
        public IList <ARN> Get()
        {
            try
            {
                Logger.LogInfo("Get: ARN process start");
                IList <ARN> lstARN = new List <ARN>();

                DataTable dtAppConfig = DataBase.DBService.ExecuteCommand(string.Format(SELECT_ALL));
                foreach (DataRow dr in dtAppConfig.Rows)
                {
                    ARN ARN = convertToARNObject(dr);
                    lstARN.Add(ARN);
                }
                Logger.LogInfo("Get: ARN process completed.");
                return(lstARN);
            }
            catch (Exception ex)
            {
                StackTrace st = new StackTrace();
                StackFrame sf = st.GetFrame(0);
                MethodBase currentMethodName = sf.GetMethod();
                LogDebug(currentMethodName.Name, ex);
                return(null);
            }
        }
示例#2
0
        private ARN convertToARNObject(DataRow dr)
        {
            ARN arn = new ARN();

            arn.Id                = dr.Field <int>("ID");
            arn.ArnNumber         = dr.Field <string>("ARNNumber");
            arn.Name              = dr.Field <string>("Name");
            arn.UpdatedBy         = dr.Field <int>("UpdatedBy");
            arn.UpdatedOn         = dr.Field <DateTime>("UpdatedOn");
            arn.UpdatedByUserName = dr.Field <string>("UpdatedByUserName");
            arn.CreatedBy         = dr.Field <int>("CreatedBy");
            arn.CreatedOn         = dr.Field <DateTime>("CreatedOn");
            arn.UpdatedByUserName = dr.Field <string>("UpdatedByUserName");
            return(arn);
        }
        public Result Delete(ARN ARN)
        {
            var result = new Result();

            try
            {
                ARNService ARNService = new ARNService();
                ARNService.Delete(ARN);
                result.IsSuccess = true;
            }
            catch (Exception exception)
            {
                result.IsSuccess     = false;
                result.ExceptionInfo = exception;
            }
            return(result);
        }
示例#4
0
 public void Delete(ARN ARN)
 {
     try
     {
         DataBase.DBService.ExecuteCommand(string.Format(DELETE_BY_ID, ARN.Id));
         Activity.ActivitiesService.Add(ActivityType.DeleteARN, EntryStatus.Success,
                                        Source.Server, ARN.UpdatedByUserName, ARN.Name, ARN.MachineName);
     }
     catch (Exception ex)
     {
         StackTrace st = new StackTrace();
         StackFrame sf = st.GetFrame(0);
         MethodBase currentMethodName = sf.GetMethod();
         LogDebug(currentMethodName.Name, ex);
         throw ex;
     }
 }
示例#5
0
        public void Update(ARN ARN)
        {
            try
            {
                string clientName = DataBase.DBService.ExecuteCommandScalar(string.Format(GET_CLIENT_NAME_QUERY, 0));

                DataBase.DBService.ExecuteCommand(string.Format(UPDATE_QUERY,
                                                                ARN.ArnNumber,
                                                                ARN.Name,
                                                                ARN.UpdatedOn.ToString("yyyy-MM-dd hh:mm:ss"), ARN.UpdatedBy,
                                                                ARN.Id));

                Activity.ActivitiesService.Add(ActivityType.UpdateARN, EntryStatus.Success,
                                               Source.Server, ARN.UpdatedByUserName, ARN.Name, ARN.MachineName);
            }
            catch (Exception ex)
            {
                StackTrace st = new StackTrace();
                StackFrame sf = st.GetFrame(0);
                MethodBase currentMethodName = sf.GetMethod();
                LogDebug(currentMethodName.Name, ex);
                throw ex;
            }
        }