Exemple #1
0
        public PhotoSearchServiceResult GetFhotoFromKaskad(GetPhotoFromKaskadParams jobParams)
        {
            //throw new FaultException<string>("Доступ запрещен!", new FaultReason("Доступ запрещен!!"));
            PhotoSearchServiceResult result = new PhotoSearchServiceResult();

            if (!this.isUserAuthorized)
            {
                if (!validateUser(jobParams.MashineName))
                {
                    result.Type = PhotoSearchServiceResultType.Error;
                    result.Data = "Доступ запрещен";
                    return(result);
                }
            }
            result.Type = PhotoSearchServiceResultType.OK;

            string message = "Get photo from Kaskad.";

            message += " Family: " + jobParams.Family + ".";
            message += " Name: " + jobParams.Name + ".";
            if (jobParams.Birthday != new DateTime())
            {
                message += " Birthday: " + jobParams.Birthday.ToShortDateString() + ".";
            }
            message += " Operation date from " + jobParams.OperationDateStart.ToString("dd.MM.yyyy HH:mm");
            message += " to " + jobParams.OperationDateEnd.ToString("dd.MM.yyyy HH:mm") + ".";

            this.writeLogLine(message);
            Console.WriteLine(message);
            WindowsLog.LogGetFhotoFromKaskad(this.mashineName, this.userName, jobParams);

            return(result);
        }
Exemple #2
0
        public static void LogGetFhotoFromKaskad(string mashineName, string userName, GetPhotoFromKaskadParams jobParams)
        {
            string message = "Событие: получение фото из базы данных Каскад." + Environment.NewLine;

            addMainInfoToLogString(mashineName, userName, ref message);
            message += "Фамилия: " + jobParams.Family + "." + Environment.NewLine;
            message += "Имя Отчество: " + jobParams.Name + "." + Environment.NewLine;
            if (jobParams.Birthday != new DateTime())
            {
                message += "Дата рождения: " + jobParams.Birthday.ToShortDateString() + "." + Environment.NewLine;
            }
            message += "Дата операции с " + jobParams.OperationDateStart.ToString("dd.MM.yyyy HH:mm");
            message += " по " + jobParams.OperationDateEnd.ToString("dd.MM.yyyy HH:mm") + "." + Environment.NewLine;
            Write(message, 14, EventLogEntryType.Information);
        }