コード例 #1
0
        private static ModelViews.TrackingLog.Extend Create(ModelViews.TrackingLog.Extend view)
        {
            var data = new DAL.trackingLog();

            try
            {
                using (var ctx = new TraditionEntities())
                {
                    if (view.Id == 0)
                    {
                        data.clientId      = view.ClientId;
                        data.authUserId    = view.AuthUserId;
                        data.recordId      = view.RecordId;
                        data.recordTable   = view.RecordTable;
                        data.memo          = view.Memo;
                        data.trackingState = view.TrackingState;

                        data.created   = DateTime.Now;
                        data.ipAddress = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];

                        ctx.AddTotrackingLogs(data);
                        ctx.SaveChanges();
                    }
                }
            }
            catch (Exception ex)
            {
                data = new DAL.trackingLog();
            }
            return(Mappers.TrackingLog.Basic(data));
        }
コード例 #2
0
        private static ModelViews.ExceptionLog.Extend Create(ModelViews.ExceptionLog.Extend view)
        {
            var data = new DAL.exceptionLog();

            try
            {
                using (var ctx = new TraditionEntities())
                {
                    if (view.Id == 0)
                    {

                        data.exceptionStack = view.ExceptionStack;
                        data.errorState = view.ErrorState;
                        data.customInfo = view.CustomInfo;
                        data.created = DateTime.Now;
                        data.exceptionMessage = view.ExceptionMessage;
                        data.exceptionSource = view.ExceptionSource;
                        data.exceptionTargetsite = view.ExceptionTargetsite;
                        data.exceptionData = view.ExceptionData;
                        ctx.exceptionLogs.AddObject(data);
                        ctx.SaveChanges();

                    }
                }
            }
            catch (Exception ex)
            {
                //data = new DAL.exceptionLog();
                //ExceptionLog.CreateExceptionLog(ex, ExceptionLog.ErrorState.Significant, "ExceptionLogController.Create");
            }

            return Mappers.ExceptionLog.Basic(data);
        }
コード例 #3
0
        private static ModelViews.ExceptionLog.Extend Create(ModelViews.ExceptionLog.Extend view)
        {
            var data = new DAL.exceptionLog();

            try
            {
                using (var ctx = new TraditionEntities())
                {
                    if (view.Id == 0)
                    {
                        data.exceptionStack      = view.ExceptionStack;
                        data.errorState          = view.ErrorState;
                        data.customInfo          = view.CustomInfo;
                        data.created             = DateTime.Now;
                        data.exceptionMessage    = view.ExceptionMessage;
                        data.exceptionSource     = view.ExceptionSource;
                        data.exceptionTargetsite = view.ExceptionTargetsite;
                        data.exceptionData       = view.ExceptionData;
                        ctx.exceptionLogs.AddObject(data);
                        ctx.SaveChanges();
                    }
                }
            }
            catch (Exception ex)
            {
                //data = new DAL.exceptionLog();
                //ExceptionLog.CreateExceptionLog(ex, ExceptionLog.ErrorState.Significant, "ExceptionLogController.Create");
            }

            return(Mappers.ExceptionLog.Basic(data));
        }
コード例 #4
0
        private static ModelViews.TrackingLog.Extend Create(ModelViews.TrackingLog.Extend view)
        {
            var data = new DAL.trackingLog();
            try
            {
                using (var ctx = new TraditionEntities())
                {
                    if (view.Id == 0)
                    {

                        data.clientId = view.ClientId;
                        data.authUserId = view.AuthUserId;
                        data.recordId = view.RecordId;
                        data.recordTable = view.RecordTable;
                        data.memo = view.Memo;
                        data.trackingState = view.TrackingState;

                        data.created = DateTime.Now;
                        data.ipAddress = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];

                        ctx.AddTotrackingLogs(data);
                        ctx.SaveChanges();

                    }
                }
            }
            catch (Exception ex)
            {
                data = new DAL.trackingLog();
            }
            return Mappers.TrackingLog.Basic(data);
        }