Exemplo n.º 1
0
        public Sys_LockObjectItemModel Post(Sys_LockObjectItemModel model)
        {
            ActionService service          = new ActionService(UserLogin);
            var           lockItemServices = new Sys_LockObjectItemServices();
            string        message          = string.Empty;

            if (model.ObjectName.IndexOf(',') > 1)
            {
                string[] objName = model.ObjectName.Split(',');
                if (objName.Length > 0)
                {
                    foreach (var item in objName)
                    {
                        Sys_LockObjectItemEntity entity = new Sys_LockObjectItemEntity();
                        entity            = model.CopyData <Sys_LockObjectItemEntity>();
                        entity.ObjectName = item;
                        // model = service.UpdateOrCreate<Sys_LockObjectItemEntity, Sys_LockObjectItemModel>(model);
                        model.ActionStatus = lockItemServices.Add(entity);
                    }
                }

                return(model);
            }
            return(service.UpdateOrCreate <Sys_LockObjectItemEntity, Sys_LockObjectItemModel>(model));
        }
 public Sys_LockObjectItemModel Put(Sys_LockObjectItemModel model)
 {
     var Sys_LockObjectItem = model.CopyData<Sys_LockObjectItemEntity>();
     
     var service = new Sys_LockObjectItemServices();
     if (model.ID != Guid.Empty)
     {
         Sys_LockObjectItem.ID = model.ID;
         service.Edit<Sys_LockObjectItemEntity>(Sys_LockObjectItem);
     }
     else
     {
         service.Add<Sys_LockObjectItemEntity>(Sys_LockObjectItem);
     }
     return model;
 }
Exemplo n.º 3
0
        public Sys_LockObjectItemModel Put(Sys_LockObjectItemModel model)
        {
            var Sys_LockObjectItem = model.CopyData <Sys_LockObjectItemEntity>();

            var service = new Sys_LockObjectItemServices();

            if (model.ID != Guid.Empty)
            {
                Sys_LockObjectItem.ID = model.ID;
                service.Edit <Sys_LockObjectItemEntity>(Sys_LockObjectItem);
            }
            else
            {
                service.Add <Sys_LockObjectItemEntity>(Sys_LockObjectItem);
            }
            return(model);
        }
Exemplo n.º 4
0
 public Sys_LockObjectItemModel Post(Sys_LockObjectItemModel model)
 {
     ActionService service = new ActionService(UserLogin);
     var lockItemServices = new Sys_LockObjectItemServices();
     string message = string.Empty;
     if(model.ObjectName.IndexOf(',') > 1)
     {
        string[] objName = model.ObjectName.Split(',');
        if (objName.Length > 0)
        {
            foreach (var item in objName)
            {
                Sys_LockObjectItemEntity entity = new Sys_LockObjectItemEntity();
                entity = model.CopyData<Sys_LockObjectItemEntity>();
                entity.ObjectName = item;
               // model = service.UpdateOrCreate<Sys_LockObjectItemEntity, Sys_LockObjectItemModel>(model);
               model.ActionStatus =  lockItemServices.Add(entity);
            }
        
        }
       
        return model;
     }
     return service.UpdateOrCreate<Sys_LockObjectItemEntity, Sys_LockObjectItemModel>(model);
 }