public string GetDeleteMessage() { var message = new XElement(XMLLogLiterals.LOG_MESSAGE); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageReportDeleted", new List <string> { OldValue.Name })); return(message.ToString()); }
public string GetDeleteMessage() { var message = new XElement(XMLLogLiterals.LOG_MESSAGE); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageCardDeleted", new List <string> { string.IsNullOrWhiteSpace(OldValue.Code) ? string.Format("{0} {1}", OldValue.Serial, OldValue.Dk) : OldValue.Code })); return(message.ToString()); }
public string GetDeleteMessage() { var message = new XElement(XMLLogLiterals.LOG_MESSAGE); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageClassificatorDeleted", new List <string> { OldValue.Description })); return(message.ToString()); }
public string GetCreateMessage() { var message = new XElement(XMLLogLiterals.LOG_MESSAGE); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageClassificatorCreated", new List <string> { OldValue.Description })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageComment", new List <string> { string.IsNullOrEmpty(OldValue.Comments) ? " " : OldValue.Comments })); return(message.ToString()); }
public string GetMovingMessage() { var message = new XElement(XMLLogLiterals.LOG_MESSAGE); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageHolidayChanged", new List <string> { OldValue.Name })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageMovingChanged", new List <string> { OldValue.MovingHoliday.ToString(), NewValue.MovingHoliday.ToString() })); return(message.ToString()); }
public string GetEditMessage() { var message = new XElement(XMLLogLiterals.LOG_MESSAGE); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageRoleChanged", new List <string> { OldValue.Name })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageNameChanged", new List <string> { OldValue.Name, NewValue.Name })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageDescriptionChanged", new List <string> { OldValue.Description, NewValue.Description })); foreach (var roleBuilding in NewValue.RoleBuildings) { if (roleBuilding.IsDeleted == false) { message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageBuilding", new List <string> { roleBuilding.BuildingName })); } } foreach (var menu in Enum.GetValues(typeof(Menu))) { var isAllowed_old = OldValue.Menues[(int)menu] != 0 ? "true" : "false"; var isAllowed_new = NewValue.Menues[(int)menu] != 0 ? "true" : "false"; message.Add(XMLLogMessageHelper.TemplateToXml(Enum.GetName(typeof(Menu), menu), null)); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageAllowedIsChanged", new List <string> { isAllowed_old, isAllowed_new })); } foreach (var perm in Enum.GetValues(typeof(Permission))) { var isAllowed_old = OldValue.Permissions[(int)perm] != 0 ? "true" : "false"; var isAllowed_new = NewValue.Permissions[(int)perm] != 0 ? "true" : "false"; message.Add(XMLLogMessageHelper.TemplateToXml(Enum.GetName(typeof(Menu), perm), null)); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageAllowedIsChanged", new List <string> { isAllowed_old, isAllowed_new })); } return(message.ToString()); }
public void DeleteCompany(int id, string host) { using (IUnitOfWork work = UnitOfWork.Begin()) { Company company = _companyRepository.FindById(id); company.IsDeleted = true; work.Commit(); var message = new XElement(XMLLogLiterals.LOG_MESSAGE); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageCompanyDeleted", new List <string> { company.Name })); _logservice.CreateLog(CurrentUser.Get().Id, "web", flag, host, CurrentUser.Get().CompanyId, message.ToString()); } }
public string GetEditMessage() { var message = new XElement(XMLLogLiterals.LOG_MESSAGE); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageUserChanged", new List <string> { OldValue.LoginName })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageLoginChanged", new List <string> { OldValue.LoginName, NewValue.LoginName })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageFirstNameChanged", new List <string> { OldValue.FirstName, NewValue.FirstName })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageLastNameChanged", new List <string> { OldValue.LastName, NewValue.LastName })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageCompanyNameChanged", new List <string> { OldValue.CompanyName, NewValue.CompanyName })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageUserIdChanged", new List <string> { string.IsNullOrEmpty(OldValue.PersonalId) ? "" : OldValue.PersonalId, string.IsNullOrEmpty(NewValue.PersonalId) ? "" : NewValue.PersonalId })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageEmailChanged", new List <string> { string.IsNullOrEmpty(OldValue.Email) ? "" : OldValue.Email, string.IsNullOrEmpty(NewValue.Email) ? "" : NewValue.Email })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessagePersonalCodeChanged", new List <string> { OldValue.PersonalCode, NewValue.PersonalCode })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageExternalPersonalCodeChanged", new List <string> { OldValue.ExternalPersonalCode, NewValue.ExternalPersonalCode })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageBirthdayChanged", new List <string> { OldValue.Birthday, NewValue.Birthday })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessagePIN1Changed", new List <string> { OldValue.PIN1, NewValue.PIN1 })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessagePIN2Changed", new List <string> { OldValue.PIN2, NewValue.PIN2 })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageRegisteredDateChanged", new List <string> { OldValue.RegistredStartDate, NewValue.RegistredStartDate })); return(message.ToString()); }
public string GetCreateMessage() { var message = new XElement(XMLLogLiterals.LOG_MESSAGE); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageDepartmentCreated", new List <string> { OldValue.Name })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageNumberField", new List <string> { OldValue.Number })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageCompanyName", new List <string> { OldValue.CompanyName })); return(message.ToString()); }
public string GetCreateMessage() { var message = new XElement(XMLLogLiterals.LOG_MESSAGE); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageTitleCreated", new List <string> { OldValue.Name })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageDescription", new List <string> { string.IsNullOrEmpty(OldValue.Description) ? "empty" : OldValue.Description })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageCompanyName", new List <string> { OldValue.CompanyName })); return(message.ToString()); }
public string GetEditMessage() { var message = new XElement(XMLLogLiterals.LOG_MESSAGE); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageReportChanged", new List <string> { OldValue.Name })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageReportChanged", new List <string> { OldValue.Name, NewValue.Name })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageReportModifiedLast", new List <string> { OldValue.ModifiedLast.ToString(), NewValue.ModifiedLast.ToString() })); // message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageEventEndChanged", new List<string> { OldValue.Ended.ToString(), NewValue.Ended.ToString() })); return(message.ToString()); }
public void EditClassificatorValue(int id, string value, string host) { using (IUnitOfWork work = UnitOfWork.Begin()) { ClassificatorValue cv = _classificatorValueRepository.FindById(id); var message = new XElement(XMLLogLiterals.LOG_MESSAGE); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageClassificatorValueChanged", new List <string> { cv.Value, value })); cv.Value = value; work.Commit(); _logService.CreateLog(CurrentUser.Get().Id, "web", flag, host, CurrentUser.Get().CompanyId, message.ToString()); } }
public string GetEditMessage() { var message = new XElement(XMLLogLiterals.LOG_MESSAGE); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageCardChanged", new List <string> { string.IsNullOrWhiteSpace(OldValue.Code) ? string.Format("{0} {1}", OldValue.Serial, OldValue.Dk) : OldValue.Code })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageUserNameChanged", new List <string> { string.IsNullOrEmpty(OldValue.UserName) ? "" : OldValue.UserName, string.IsNullOrEmpty(NewValue.UserName) ? "" : NewValue.UserName })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageCompanyNameChanged", new List <string> { string.IsNullOrEmpty(OldValue.CompanyName) ? "" : OldValue.CompanyName, string.IsNullOrEmpty(NewValue.CompanyName) ? "" : NewValue.CompanyName })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageCardTypeNameChanged", new List <string> { string.IsNullOrEmpty(OldValue.TypeName) ? "" : OldValue.TypeName, string.IsNullOrEmpty(NewValue.TypeName) ? "" : NewValue.TypeName })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageSerialChanged", new List <string> { string.IsNullOrEmpty(OldValue.Serial) ? "" : OldValue.Serial, string.IsNullOrEmpty(NewValue.Serial) ? "" : NewValue.Serial })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageCardCodeChanged", new List <string> { string.IsNullOrEmpty(OldValue.Code) ? "" : OldValue.Code, string.IsNullOrEmpty(NewValue.Code) ? "" : NewValue.Code })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageDkChanged", new List <string> { string.IsNullOrEmpty(OldValue.Dk) ? "" : OldValue.Dk, string.IsNullOrEmpty(NewValue.Dk) ? "" : NewValue.Dk })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageFreeChanged", new List <string> { OldValue.Free.ToString(), NewValue.Free.ToString() })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageActiveChanged", new List <string> { OldValue.Active.ToString(), NewValue.Active.ToString() })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageValidFromChanged", new List <string> { OldValue.ValidFrom, NewValue.ValidFrom })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageValidToChanged", new List <string> { OldValue.ValidTo, NewValue.ValidTo })); return(message.ToString()); }
public string GetEditMessage() { var message = new XElement(XMLLogLiterals.LOG_MESSAGE); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageClassificatorChanged", new List <string> { OldValue.Description })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageDescriptionChanged", new List <string> { string.IsNullOrWhiteSpace(OldValue.Description) ? " " : OldValue.Description, string.IsNullOrWhiteSpace(NewValue.Description) ? " " : NewValue.Description })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageCommentChange", new List <string> { string.IsNullOrWhiteSpace(OldValue.Comments) ? " " : OldValue.Comments, string.IsNullOrWhiteSpace(NewValue.Comments) ? " " : NewValue.Comments })); return(message.ToString()); }
public int CreateUserBuilding(int userId, int buildingId, int?buildingObjectId, string host) { int result = 0; var user = _userRepository.FindById(userId); using (IUnitOfWork work = UnitOfWork.Begin()) { UserBuilding ub = null; ub = _userBuildingRepository.FindAll().Where( x => x.UserId == userId && x.BuildingId == buildingId && x.BuildingObjectId == buildingObjectId).FirstOrDefault(); var message = new XElement(XMLLogLiterals.LOG_MESSAGE); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageUserBuildingsChanged", new List <string> { user.LoginName })); if (ub == null) { ub = DomainObjectFactory.CreateUserBuilding(); ub.UserId = userId; ub.BuildingObjectId = buildingObjectId; ub.IsDeleted = false; ub.BuildingId = buildingId; _userBuildingRepository.Add(ub); } else { ub.IsDeleted = false; } work.Commit(); ub = _userBuildingRepository.FindById(ub.Id); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageUserBuildingAdded", new List <string> { ub.Building.Name, ub.BuildingObject == null ? " " : ub.BuildingObject.Description })); result = ub.Id; _logService.CreateLog(CurrentUser.Get().Id, "web", flag, host, CurrentUser.Get().CompanyId, message.ToString()); } return(result); }
public void UpdateUserToTime(int id, DateTime?time) { using (IUnitOfWork work = UnitOfWork.Begin()) { UserTimeZoneProperty userTimeZoneProperty = _userTimeZonePropertyRepository.FindById(id); var oldTime = userTimeZoneProperty.ValidTo; userTimeZoneProperty.ValidTo = time; /* * if (CurrentUser.Get().IsBuildingAdmin || CurrentUser.Get().IsSuperAdmin || (CurrentUser.Get().IsCompanyManager && userTimeZoneProperty.UserTimeZone.IsCompanySpecific)) * { * var tzp = * _timeZonePropertyRepository.FindAll().Where( * x => * x.TimeZoneId == userTimeZoneProperty.UserTimeZone.TimeZoneId && * x.OrderInGroup == userTimeZoneProperty.OrderInGroup).FirstOrDefault(); * * if (tzp != null && !tzp.TimeZone.IsDefault) * { * tzp.ValidFrom = userTimeZoneProperty.ValidFrom; * tzp.ValidTo = userTimeZoneProperty.ValidTo; * tzp.IsMonday = userTimeZoneProperty.IsMonday; * tzp.IsTuesday = userTimeZoneProperty.IsTuesday; * tzp.IsWednesday = userTimeZoneProperty.IsWednesday; * tzp.IsThursday = userTimeZoneProperty.IsThursday; * tzp.IsFriday = userTimeZoneProperty.IsFriday; * tzp.IsSaturday = userTimeZoneProperty.IsSaturday; * tzp.IsSunday = userTimeZoneProperty.IsSunday; * } * } */ work.Commit(); var message = new XElement(XMLLogLiterals.LOG_MESSAGE); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageUserTimeZonePropertyChanged", new List <string> { userTimeZoneProperty.UserTimeZone.Name, userTimeZoneProperty.UserTimeZone.User.LoginName })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMesageValidToChanged", new List <string> { oldTime == null ? "" : oldTime.Value.ToString("HH:mm"), userTimeZoneProperty.ValidTo == null ? "" : userTimeZoneProperty.ValidTo.Value.ToString("HH:mm") })); _logService.CreateLog(CurrentUser.Get().Id, "web", flag, CurrentUser.Get().HostName, CurrentUser.Get().CompanyId, message.ToString()); _controllerUpdateService.CreateControllerUpdate(CurrentUser.Get().Id, userTimeZoneProperty.UserTimeZoneId, UpdateParameter.UserTimeZoneUpdate, ControllerStatus.Created, userTimeZoneProperty.UserTimeZone.Name); } }
public string ChangeWorkDataMessage() { try { var message = new XElement(XMLLogLiterals.LOG_MESSAGE); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageVisitorChanged", new List <string> { OldValue.FirstName })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageFirstNameChanged", new List <string> { OldValue.FirstName, NewValue.FirstName })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageLastNameChanged", new List <string> { OldValue.LastName, NewValue.LastName })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageCompanyChanged", new List <string> { Convert.ToString(OldValue.CompanyId), Convert.ToString(NewValue.CompanyId) })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessagePhoneChanged", new List <string> { OldValue.PhoneNumber, NewValue.PhoneNumber })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageEmailChanged", new List <string> { OldValue.Email, NewValue.Email })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageCarNrChanged", new List <string> { OldValue.CarNr, NewValue.CarNr })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageFromdateChanged", new List <string> { OldValue.StartDateTime.ToString(), NewValue.StartDateTime.ToString() })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageTodateChanged", new List <string> { OldValue.StopDateTime.ToString(), NewValue.StopDateTime.ToString() })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageUserIdChanged", new List <string> { Convert.ToString(OldValue.UserId), Convert.ToString(NewValue.UserId) })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageReturndateChanged", new List <string> { OldValue.ReturnDate.ToString(), NewValue.ReturnDate.ToString() })); return(message.ToString()); } catch (Exception ex1) { return(ex1.Message); } }
public string UpdateImageDataMessage() { try { var message = new XElement(XMLLogLiterals.LOG_MESSAGE); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageVisitorChanged", new List <string> { OldValue.FirstName + " " + OldValue.LastName })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageImageChange", new List <string> { OldValue.Image, NewValue.Image })); return(message.ToString()); } catch { return(null); } }
public void UpdateTimeZone(int id, string name) { using (IUnitOfWork work = UnitOfWork.Begin()) { TimeZone timeZone = _timeZoneRepository.FindById(id); var old_name = timeZone.Name; var message = new XElement(XMLLogLiterals.LOG_MESSAGE); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageTimeZoneNameChanged", new List <string> { old_name, name })); timeZone.Name = name; _logService.CreateLog(CurrentUser.Get().Id, "web", CurrentUser.Get().HostName, CurrentUser.Get().CompanyId, message.ToString()); work.Commit(); } }
public void DeleteUserDepartment(int Id) { using (IUnitOfWork work = UnitOfWork.Begin()) { UserDepartment userDepartment = _userDepartmentRepository.FindById(Id); userDepartment.IsDeleted = true; var message = new XElement(XMLLogLiterals.LOG_MESSAGE); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageUserRemovedFromDepartment", new List <string> { userDepartment.User.LoginName, userDepartment.Department.Name })); work.Commit(); _logService.CreateLog(CurrentUser.Get().Id, "web", flag, CurrentUser.Get().HostName, CurrentUser.Get().CompanyId, message.ToString()); } }
public string GetEditMessage() { var message = new XElement(XMLLogLiterals.LOG_MESSAGE); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageHolidayChanged", new List <string> { OldValue.Name })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageNameChanged", new List <string> { OldValue.Name, NewValue.Name })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageEventStartChanged", new List <string> { OldValue.EventStart, NewValue.EventStart })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageEventEndChanged", new List <string> { OldValue.EventEnd, NewValue.EventEnd })); return(message.ToString()); }
public string GetCreateMessage() { var message = new XElement(XMLLogLiterals.LOG_MESSAGE); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageUserCreated", new List <string> { OldValue.LoginName })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageFirstName", new List <string> { OldValue.FirstName })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageLastName", new List <string> { OldValue.LastName })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageCompanyName", new List <string> { OldValue.CompanyName })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageUserId", new List <string> { OldValue.PersonalId })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageEmail", new List <string> { OldValue.Email })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessagePersonalCode", new List <string> { OldValue.PersonalCode })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageExternalPersonalCode", new List <string> { OldValue.ExternalPersonalCode })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageBirthday", new List <string> { OldValue.Birthday })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessagePIN1", new List <string> { OldValue.PIN1 })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessagePIN2", new List <string> { OldValue.PIN2 })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageRegisteredDate", new List <string> { OldValue.RegistredStartDate })); return(message.ToString()); }
public string GetCreateMessage() { var message = new XElement(XMLLogLiterals.LOG_MESSAGE); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageHolidayCreated", new List <string> { OldValue.Name })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageStartDate", new List <string> { OldValue.EventStart })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageEndDate", new List <string> { OldValue.EventEnd })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageMoving", new List <string> { OldValue.MovingHoliday.ToString() })); return(message.ToString()); }
public void MoveToDepartment(int userId, int oldDepartmentId, int departmentId) { using (IUnitOfWork work = UnitOfWork.Begin()) { UserDepartment oldUserDepartment = _userDepartmentRepository.FindAll().Where( ud => ud.UserId == userId && ud.DepartmentId == oldDepartmentId && !ud.IsDeleted). SingleOrDefault(); UserDepartment newUserDepartment = _userDepartmentRepository.FindAll().Where( ud => ud.UserId == userId && ud.DepartmentId == departmentId && !ud.IsDeleted). SingleOrDefault(); if (oldUserDepartment != null) { if (newUserDepartment != null) { oldUserDepartment.IsDeleted = true; } else { oldUserDepartment.DepartmentId = departmentId; } work.Commit(); var user = _userRepository.FindById(userId); var dep1 = _departmentRepository.FindById(oldDepartmentId); var dep2 = _departmentRepository.FindById(departmentId); var message = new XElement(XMLLogLiterals.LOG_MESSAGE); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageDepartmentForUserChangedFromTo", new List <string> { user.LoginName, dep1.Name, dep2.Name })); _logService.CreateLog(CurrentUser.Get().Id, "web", flag, CurrentUser.Get().HostName, CurrentUser.Get().CompanyId, message.ToString()); } } }
public void DeleteUserTimeZone(int id) { using (IUnitOfWork work = UnitOfWork.Begin()) { UserTimeZone userTimeZone = _userTimeZoneRepository.FindById(id); userTimeZone.IsDeleted = true; work.Commit(); var message = new XElement(XMLLogLiterals.LOG_MESSAGE); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageUserTimeZoneDeleted", new List <string> { userTimeZone.Name })); _logService.CreateLog(CurrentUser.Get().Id, "web", flag, CurrentUser.Get().HostName, CurrentUser.Get().CompanyId, message.ToString()); _controllerUpdateService.CreateControllerUpdate(CurrentUser.Get().Id, id, UpdateParameter.UserTimeZoneUpdate, ControllerStatus.Deleted, userTimeZone.Name); } }
public ActionResult LogOff() { if (HttpContext.User.Identity.IsAuthenticated) { var userId = ((FoxSecIdentity)System.Web.HttpContext.Current.User.Identity).Id; var userName = ((FoxSecIdentity)System.Web.HttpContext.Current.User.Identity).LoginName; var companyId = CurrentUser.Get().CompanyId; var host = Request.UserHostAddress; var xml_message = new XElement(XMLLogLiterals.LOG_MESSAGE); var logoff_params = new List <string>(); logoff_params.Add(userName); var xml_user_logoff = XMLLogMessageHelper.TemplateToXml("LogMessageUserLogOff", logoff_params); xml_message.Add(xml_user_logoff); string flag = ""; _logService.CreateLog(userId, "web", flag, host, companyId, xml_message.ToString()); //illi 25.12.1012 Logger4SendingEMail.LogSender.Info(string.Format("User \"{0}\" has left", userName)); //illi 25.12.1012 Logger4SendingEMail.InitLogger(); _formsService.SignOut(); } return(RedirectToAction("Index", "Home")); }
public string GetCreateMessage() { var message = new XElement(XMLLogLiterals.LOG_MESSAGE); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageUserDepartmentAssigned", new List <string> { OldValue.DepartmentName, OldValue.UserName })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageValidFrom", new List <string> { OldValue.ValidFrom })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageValidTo", new List <string> { OldValue.ValidTo })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageUDCurrentDepartment", new List <string> { OldValue.CurrentDep.ToString() })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageUDDepartmentManager", new List <string> { OldValue.IsDepartmentManager.ToString() })); return(message.ToString()); }
public string GetCreateMessage() { try { var message = new XElement(XMLLogLiterals.LOG_MESSAGE); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageFirstName", new List <string> { OldValue.FirstName.ToString() })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageLastName", new List <string> { OldValue.LastName.ToString() })); // message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageCompanyName", new List<string> { OldValue.Company.ToString() })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageEmail", new List <string> { OldValue.Email.ToString() })); return(message.ToString()); } catch (Exception ex1) { return(ex1.Message); } }
public string GetEditMessage() { var message = new XElement(XMLLogLiterals.LOG_MESSAGE); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageLogFilterChanged", new List <string> { OldValue.Name })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageNameChanged", new List <string> { OldValue.Name, NewValue.Name })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageFromDateChanged", new List <string> { OldValue.FromDate, NewValue.FromDate })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageToDateChanged", new List <string> { OldValue.ToDate, NewValue.ToDate })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageBuildingChanged", new List <string> { OldValue.Building, NewValue.Building })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageNodeChanged", new List <string> { OldValue.Node, NewValue.Node })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageCompanyNameChanged", new List <string> { OldValue.Company, NewValue.Company })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageUserValueChanged", new List <string> { OldValue.UserName, NewValue.UserName })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageActivityChanged", new List <string> { OldValue.Activity, NewValue.Activity })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageShowDefaultLogChanged", new List <string> { OldValue.IsShowDefaultLog.HasValue?OldValue.IsShowDefaultLog.Value.ToString() : "false", NewValue.IsShowDefaultLog.HasValue ? NewValue.IsShowDefaultLog.Value.ToString() : "false" })); return(message.ToString()); }
public string GetEditMessage() { var message = new XElement(XMLLogLiterals.LOG_MESSAGE); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageCardTypeChanged", new List <string> { OldValue.Name })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageNameChanged", new List <string> { OldValue.Name, NewValue.Name })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageDescriptionChanged", new List <string> { string.IsNullOrEmpty(OldValue.Description) ? "empty" : OldValue.Description, string.IsNullOrEmpty(NewValue.Description) ? "empty" : NewValue.Description })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageCardCodeChanged", new List <string> { OldValue.IsCardCode.ToString(), NewValue.IsCardCode.ToString() })); message.Add(XMLLogMessageHelper.TemplateToXml("LogMessageSerialChanged", new List <string> { OldValue.IsSerDK.ToString(), NewValue.IsSerDK.ToString() })); return(message.ToString()); }