Exemplo n.º 1
0
        public void DAAsignarProcedure(String x_procedure, InstanceEntity x_accion)
        {
            try
            {
                DASqlCommand             = (SqlCommand)DASqlDatabase.GetStoredProcCommand(x_procedure);
                DASqlCommand.CommandType = System.Data.CommandType.StoredProcedure;

                switch (x_accion)
                {
                case InstanceEntity.New:
                    DAAgregarParametro("@Accion", "I", SqlDbType.NChar, 1, ParameterDirection.Input);
                    break;

                case InstanceEntity.Modify:
                    DAAgregarParametro("@Accion", "U", SqlDbType.NChar, 1, ParameterDirection.Input);
                    break;

                case InstanceEntity.Delete:
                    DAAgregarParametro("@Accion", "D", SqlDbType.NChar, 1, ParameterDirection.Input);
                    break;

                default:
                    break;
                }
                DASqlCommand.CommandTimeout = m_timeout;
            }
            catch (Exception ex)
            { throw ex; }
        }
Exemplo n.º 2
0
 protected void RefreshInstanceEntity()
 {
     if (Instance != InstanceEntity.New && Instance != InstanceEntity.Delete)
     {
         Instance = InstanceEntity.Modify;
     }
 }
Exemplo n.º 3
0
        protected virtual void OnPropertyChanged([CallerMemberName] String propertyName = "")
        {
            if (m_instance != InstanceEntity.Added && m_instance != InstanceEntity.Deleted)
            {
                m_instance = InstanceEntity.Modified;
            }

            PropertyChanged?.Invoke(null, new PropertyChangedEventArgs(propertyName));
        }
Exemplo n.º 4
0
        public bool InsertInstance(InstanceModel im)
        {
            //Mappers
            InstanceEntity ie = new InstanceEntity();

            ie.Id          = im.Id;
            ie.Name        = im.Name;
            ie.Type        = im.Type;
            ie.Location    = im.Location;
            ie.Media       = im.Media;
            ie.Description = im.Description;

            return(_instanceRepo.Insert(ie));
        }
Exemplo n.º 5
0
        public InstanceModel GetOneInstance(int id)
        {
            InstanceEntity instanceEntity = _instanceRepo.GetOne(id);

            InstanceModel im = new InstanceModel();

            im.Id          = instanceEntity.Id;
            im.Name        = instanceEntity.Name;
            im.Type        = instanceEntity.Type;
            im.Media       = instanceEntity.Media;
            im.Description = instanceEntity.Description;
            im.Location    = instanceEntity.Location;



            return(im);
        }
Exemplo n.º 6
0
        public object Clone()
        {
            InstanceEntity nuevo = (InstanceEntity)this.MemberwiseClone();

            return(nuevo);
        }