Exemplo n.º 1
0
        public static void RecordSystemLog(SystemLogType type, String name, String content, String remark)
        {
            try
            {
                SystemLog   sl;
                OLSEntities olsEni;

                sl = new SystemLog
                {
                    SL_Name    = name,
                    SL_Type    = (Byte)type,
                    SL_Content = content,
                    SL_Remark  = remark,
                    SL_Status  = (Byte)Status.Available,
                    SL_AddTime = DateTime.Now
                };

                olsEni = new OLSEntities();
                olsEni.Entry(sl).State = EntityState.Added;
                if (0 == olsEni.SaveChanges())
                {
                    throw new Exception(ResponseMessage.SaveChangesError);
                }
            }
            catch (Exception ex)
            {
                RecordInnerLog(ex);
            }
        }
Exemplo n.º 2
0
        public static void RecordSystemLog(SystemLogType type, String name, String content, String remark)
        {
            try
            {

                SystemLog sl;
                OLSEntities olsEni;

                sl = new SystemLog
                {
                    SL_Name = name,
                    SL_Type = (Byte)type,
                    SL_Content = content,
                    SL_Remark = remark,
                    SL_Status = (Byte)Status.Available,
                    SL_AddTime = DateTime.Now
                };

                olsEni = new OLSEntities();
                olsEni.Entry(sl).State = EntityState.Added;
                if (0 == olsEni.SaveChanges())
                {
                    throw new Exception(ResponseMessage.SaveChangesError);
                }
            }
            catch (Exception ex)
            {
                RecordInnerLog(ex);
            }
        }