Exemplo n.º 1
0
        public Sys_ResourceModel Put(Sys_ResourceModel model)
        {
            var Resource = new Sys_ResourceEntity
            {
                ID = model.ID,
                Code = model.Code,
                //ResourceType = model.ResourceType,
                ResourceName = model.ResourceName,
                ModuleName = model.ModuleName,
                //Description = model.Description
               
            };
            var service = new Sys_ResourceServices();
            if (model.ID != Guid.Empty)
            {
                Resource.ID = model.ID;
                service.Edit<Sys_ResourceEntity>(Resource);
            }
            else
            {
                service.Add<Sys_ResourceEntity>(Resource);
            }

            return model;
        }
Exemplo n.º 2
0
 // GET api/<controller>/5
 public Sys_ResourceModel Get(Guid id)
 {
     var service = new Sys_ResourceServices();
     var result = service.GetById<Sys_ResourceEntity>(id, ref status);
     var AttWorkDay = new Sys_ResourceModel
     {
         ID = result.ID,
         Code = result.Code,
         //ResourceType = result.ResourceType,
         ResourceName = result.ResourceName,
         ModuleName = result.ModuleName,
         //Description = result.Description
     };
     return AttWorkDay;
 }