protected override DataGridViewRow FillRow(IBllEntity entity, DataGridViewRow row)
        {
            BllStatus data = (BllStatus)entity;

            row.Cells[0].Value = data.Name;
            return(row);
        }
 private UiEvent AddStatusToUiEvent(UiEvent Event, BllStatus status)
 {
     Event.EventData.StatusLib.SelectedEntities.Add(new BllSelectedStatus {
         Entity = status
     });
     return(EventHelper.CreateEventAccordingToStatusOrUser(Event, ownerForm.GetCurrentUser()));
 }
        protected override void UpdateRow(IBllEntity entity, int row)
        {
            BllStatus data = (BllStatus)entity;

            Statuses[row] = data;
            FillRow(data, dataGridView1.Rows[row]);
        }
Exemplo n.º 4
0
 public static DalStatus ToDalStatus(this BllStatus bllStatus)
 {
     return(new DalStatus()
     {
         Id = bllStatus.Id,
         Name = bllStatus.Name
     });
 }
 public static void Init(ServerInstance serverInstance)
 {
     if (serverInstance.IsConnected())
     {
         IStatusGetter sg = new StatusGetter(serverInstance.server);
         StatusDELETED = sg.GetStatusDELETED();
         StatusCLOSED  = sg.GetStatusCLOSED();
     }
 }
 public BllStatus UpdateStatus(BllStatus entity)
 {
     using (ServiceDB serviceDB = new ServiceDB())
     {
         IUnitOfWork    uow     = new UnitOfWork(serviceDB);
         IStatusService service = new StatusService(uow);
         return(service.Update(entity));
     }
 }
Exemplo n.º 7
0
        public BllStatus MapToBll(DalStatus entity)
        {
            BllStatus bllEntity = new BllStatus
            {
                Id   = entity.Id,
                Name = entity.Name,
            };

            return(bllEntity);
        }
Exemplo n.º 8
0
        public DalStatus MapToDal(BllStatus entity)
        {
            DalStatus dalEntity = new DalStatus
            {
                Id   = entity.Id,
                Name = entity.Name,
            };

            return(dalEntity);
        }
 public static bool IsStatusForOwner(BllStatus status)
 {
     if (StatusCLOSED != null)
     {
         if ((status.Id == StatusCLOSED.Id) || (status.Id == StatusDELETED.Id))
         {
             return(true);
         }
     }
     return(false);
 }
Exemplo n.º 10
0
 protected override void button1_Click(object sender, EventArgs e)
 {
     if (textBox1.Text == "")
     {
         MessageBox.Show("Введите название", "Оповещение");
     }
     else
     {
         BllStatus Status = (BllStatus)Entity;
         Status.Name = textBox1.Text;
         Entity      = server.UpdateStatus(Status);
         base.button1_Click(sender, e);
     }
 }
        public BllSelectedStatus MapToBll(DalSelectedStatus entity)
        {
            IStatusService EntityService = new StatusService(uow);
            BllStatus      bllEntity     = EntityService.Get(entity.Entity_id);

            BllSelectedStatus bllSelectedEntity = new BllSelectedStatus
            {
                Id     = entity.Id,
                Entity = bllEntity,
                Date   = entity.Date
            };

            return(bllSelectedEntity);
        }
Exemplo n.º 12
0
        public void AddStatusToSelectedEvent(BllStatus status)
        {
            SelectedEvent            = AddStatusToUiEvent(SelectedEvent, status);
            Events[SelectedEventNum] = SelectedEvent;
            IEventCRUD eventCrud = new EventCRUD(client.GetServerInstance().server);

            SelectedEvent.EventData = eventCrud.UpdateStatusAndSendOutEvent(SelectedEvent.EventData, ownerForm.GetCurrentUser());
            var newStatus = SelectedEvent.EventData.StatusLib.SelectedEntities.Last();

            ownerForm.AddStatusToDataGrid(newStatus.Entity.Name, newStatus.Date);
            dataGridManager.SetStatusInRow(dataGridView.Rows[SelectedEventNum], SelectedEvent.EventData);
            SelectedEvent.SetRowStyle(dataGridView.Rows[SelectedEventNum]);
            ownerForm.SelectBlankStatus();
            SerializeEvents();
        }
Exemplo n.º 13
0
 protected override void button1_Click(object sender, EventArgs e)
 {
     if ((textBox1.Text == Globals.Globals.STATUS_CLOSED) || (textBox1.Text == Globals.Globals.STATUS_DELETED))
     {
         MessageBox.Show("Такие статусы уже существуют");
     }
     if (textBox1.Text == "")
     {
         MessageBox.Show("Введите название", "Оповещение");
     }
     else
     {
         Entity = new BllStatus
         {
             Name = textBox1.Text,
         };
         Entity = server.CreateStatus((BllStatus)Entity);
         base.button1_Click(sender, e);
     }
 }
Exemplo n.º 14
0
 public AmendStatusForm(DirectoryForm parent, IBusinessService server, BllStatus entity) : base(parent, server, entity)
 {
     InitializeComponent();
     textBox1.Text = entity.Name;
 }
Exemplo n.º 15
0
 public AddStatusForm(DirectoryForm parent, IBusinessService server, BllStatus status) : base(parent, server, status)
 {
     InitializeComponent();
 }