예제 #1
0
        public static void AddHistory(double num, imHistEventCommentType imHistEventCommentType, DateTime? startTime = null)
        {
            IMDocUtility docUtil = new IMDocUtility();

            docUtil.AddHistory(num, imHistEventCommentType);

            if(imHistEventCommentType == IMModel.imHistEventCommentType.imHistoryExport)
            {
                startTime = startTime ?? DateTime.Now;

                var engNum = docUtil.GetAttribute(num, imProfileAttributeIDType.imProfileCustom2);
                var wsFile = GetDoc(num);

                KWSLogDownloadFile kWSLogDownloadFile = new KWSLogDownloadFile
                {
                    FileName = wsFile.Name,
                    Size = wsFile.Size,
                    TimeInSec = startTime.Value.ToTimeElapsedInSec()
                };

                KWSLog kWSLog = new KWSLog
                {
                    EngNum = engNum.Item2,
                    KWSLogType = KWSLogType.DownloadFile,
                    FileNum = num,
                    Info = KSerDSer.JSerialize<KWSLogDownloadFile>(kWSLogDownloadFile),
                };

                KRepKWSLog.KWSLog(kWSLog);
            }
        }
예제 #2
0
        public static void KWSLog(KWSLog kWSLog)
        {
            Task task = new Task(() =>
            {
                IMWrapWSLog.KWSLog(kWSLog);
            });

            task.Start(TaskScheduler.FromCurrentSynchronizationContext());
        }
예제 #3
0
        public static void KWSLog(KWSLog kWSLog)
        {
            kWSLog.InsertWhen = KConfig.GetKDateTimeUTC;
            kWSLog.InsertWho = KConfig.GetCurrentUser;

            using (KDBContext db = new KDBContext())
            {
                db.KWSLog.Add(kWSLog);
                db.SaveChanges();
            }
        }
예제 #4
0
        public static void SendMail_RequestUpdateCMS(KMailInfo kMailInfo)
        {
            var kMailModel = KMail.SendMail(kMailInfo);

            KWSLogRequestUpdateCMS kWSLogUpdateCMS = new KWSLogRequestUpdateCMS
            {
                KMailModel = kMailModel,
                Comment = kMailInfo.Reason
            };

            KWSLog kWSLog = new KWSLog
            {
                EngNum = kMailInfo.EngNum,
                KWSLogType = KWSLogType.RequestUpdateCMS,
                Info = KSerDSer.JSerialize<KWSLogRequestUpdateCMS>(kWSLogUpdateCMS),

            };

            IMWrapWSLog.KWSLog(kWSLog);

            //Task task = new Task(() =>
            //{
            //    var kMailModel = KMail.SendMail(kMailInfo);

            //    KWSLogRequestUpdateCMS kWSLogUpdateCMS = new KWSLogRequestUpdateCMS
            //    {
            //        KMailModel = kMailModel,
            //        Comment = kMailInfo.Reason
            //    };

            //    KWSLog kWSLog = new KWSLog
            //    {
            //        EngNum = kMailInfo.EngNum,
            //        KWSLogType = KWSLogType.RequestUpdateCMS,
            //        Info = KSerDSer.JSerialize<KWSLogRequestUpdateCMS>(kWSLogUpdateCMS),

            //    };

            //    IMWrapWSLog.KWSLog(kWSLog);
            //},TaskCreationOptions.AttachedToParent
            //);

            //task.Start(TaskScheduler.FromCurrentSynchronizationContext());
        }
예제 #5
0
        public static void SendMail_CreateWS(KMailInfo kMailInfo, CreateWSModel createWSModel)
        {
            var kMailModel = KMail.SendMail(kMailInfo);

            KWSLogCreateWS kWSLogCreateWS = new KWSLogCreateWS
            {
                KMailModel = kMailModel,
                CreateWSModel = createWSModel,
            };

            KWSLog kWSLog = new KWSLog
            {
                EngNum = createWSModel.EngNum,
                KWSLogType = createWSModel.IsAuto.GetValueOrDefault(true) ? KWSLogType.CreateWSAuto : KWSLogType.CreateWSManual,
                Info = KSerDSer.JSerialize<KWSLogCreateWS>(kWSLogCreateWS),
            };

            IMWrapWSLog.KWSLog(kWSLog);

            //Task task = new Task(() =>
            //{
            //    var kMailModel = KMail.SendMail(kMailInfo);

            //    KWSLogCreateWS kWSLogCreateWS = new KWSLogCreateWS
            //    {
            //        KMailModel = kMailModel,
            //        CreateWSModel = createWSModel,
            //    };

            //    KWSLog kWSLog = new KWSLog
            //    {
            //        EngNum = createWSModel.EngNum,
            //        KWSLogType = createWSModel.IsAuto.GetValueOrDefault(true) ? KWSLogType.CreateWSAuto : KWSLogType.CreateWSManual,
            //        Info = KSerDSer.JSerialize<KWSLogCreateWS>(kWSLogCreateWS),
            //    };

            //    IMWrapWSLog.KWSLog(kWSLog);
            //});

            //task.Start(TaskScheduler.FromCurrentSynchronizationContext());
        }
예제 #6
0
        public static void KWSLogAddDeleteUser(string num, string groupName, string userId, KWSLogType kWSLogType)
        {
            KWSLogAddDeleteUser kWSLogAddDeleteUser = new KWSLogAddDeleteUser
            {
                GroupName = groupName,
                UserId = userId
            };

            KWSLog kWSLog = new KWSLog
            {
                EngNum = num,
                KWSLogType = kWSLogType,
                Info = KSerDSer.JSerialize<KWSLogAddDeleteUser>(kWSLogAddDeleteUser),

            };

            KWSLog(kWSLog);
        }
예제 #7
0
파일: KCreate.cs 프로젝트: mengithub/XP-2
        private static CreateWSModel CreateWS_Private(CreateWSModel createWSModel)
        {
            CreateWS create = new CreateWS();
            try
            {
                //if (KWSUtility.IsEngFunctionAudit(createWSModel))
                //{
                createWSModel.IsAuto = createWSModel.IsAuto.GetValueOrDefault(true);
                create.Create(createWSModel);
                //}
            }
            catch (Exception ex)
            {
                KElmahUtility.LogException(ex);

                createWSModel.Success = false;
                createWSModel.FailureMsg = createWSModel.FailureMsg + " " + ex.Message;

                KWSLogCreateWS kWSLogCreateWS = new KWSLogCreateWS
                {
                    KMailModel = null,
                    CreateWSModel = createWSModel,
                };

                KWSLog kWSLog = new KWSLog
                {
                    EngNum = createWSModel.EngNum,
                    KWSLogType = KWSLogType.CreateWSFail,
                    Info = KSerDSer.JSerialize<KWSLogCreateWS>(kWSLogCreateWS),
                };

                KRepKWSLog.KWSLog(kWSLog);
            }

            if (createWSModel.Success)
                UpdateWS(createWSModel.EngNum, createWSModel.KPMGOnly);

            return createWSModel;
        }
예제 #8
0
파일: Create.cs 프로젝트: mengithub/XP-2
        private void CreateDocLog(string docNameWithLocalPath, string ws, string fldr, long startTime, long step1TimeInSec, int num)
        {
            KWSLogUploadFile kWSLogUploadFile = new KWSLogUploadFile
            {
                FileName = Path.GetFileName(docNameWithLocalPath),
                Folder = fldr,
                Size = new FileInfo(docNameWithLocalPath).Length,
                Step1TimeInSec = step1TimeInSec,
                TimeInSec = startTime
            };

            KWSLog kWSLog = new KWSLog
            {
                EngNum = ws,
                KWSLogType = KWSLogType.UploadFile,
                FileNum = num,
                Info = KSerDSer.JSerialize<KWSLogUploadFile>(kWSLogUploadFile),
            };

            IMWrapUtility.KWSLog(kWSLog);
        }