Ejemplo n.º 1
0
        public void Initialize(Guid organisationUID, Guid? positionUID = null)
        {
            var isNew = positionUID == null;
            if (isNew)
            {
                Position = new Position()
                {
                    Name = "Новая должность",
                    OrganisationUID = organisationUID
                };
            }
            else
            {
                var operationResult = PositionHelper.GetDetails(positionUID.Value);
                Position = operationResult;
            }
            if (Position.Photo != null && Position.Photo.Data != null)
            {
                photoData = string.Format("data:image/gif;base64,{0}", Convert.ToBase64String(Position.Photo.Data));
                Position.Photo.Data = null;
            }

        }
Ejemplo n.º 2
0
		public static bool Save(Position position, bool isNew)
		{
			var operationResult = ClientManager.RubezhService.SavePosition(position, isNew);
			return Common.ThrowErrorIfExists(operationResult);
		}
Ejemplo n.º 3
0
		public OperationResult<bool> SavePosition(Guid clientUID, Position item, bool isNew)
		{
			if (isNew)
				AddJournalMessage(JournalEventNameType.Редактирование_должности, item.Name, item.UID, clientUID, JournalEventDescriptionType.Добавление_должность, JournalObjectType.Position);
			else
				AddJournalMessage(JournalEventNameType.Редактирование_должности, item.Name, item.UID, clientUID, JournalEventDescriptionType.Редактирование_должность, JournalObjectType.Position);
			using (var databaseService = new RubezhDAL.DataClasses.DbService())
			{
				return databaseService.PositionTranslator.Save(item);
			}
		}