Exemplo n.º 1
0
        internal Contractor Edit(Contractor updated)
        {
            Contractor data = GetById(updated.Id);

            data.Name = updated.Name != null ? updated.Name : data.Name;

            return(_crepo.Edit(data));
        }
        internal object Edit(Contractor updated)
        {
            var data = Get(updated.Id);

            updated.Name    = updated.Name != null ? updated.Name : data.Name;
            updated.Address = updated.Address != null ? updated.Address : data.Address;
            updated.Skills  = updated.Skills != null ? updated.Skills : data.Skills;
            return(_repo.Edit(updated));
        }
Exemplo n.º 3
0
        //EDIT/PUT
        internal Contractor Edit(Contractor editContractors)
        {
            Contractor original = GetById(editContractors.contractorId);

            original.Name = editContractors.Name != null ? editContractors.Name : original.Name;


            return(_repo.Edit(original));
        }
Exemplo n.º 4
0
        internal Contractor Edit(Contractor updated)
        {
            Contractor data = GetById(updated.Id);

            data.Name       = updated.Name != null ? updated.Name : data.Name;
            data.Profession = updated.Profession != null ? updated.Profession : data.Profession;

            return(_repo.Edit(data));
        }
Exemplo n.º 5
0
        internal Contractor Edit(Contractor editContractor)
        {
            Contractor original = getByID(editContractor.Id);

            original.Name        = editContractor.Name != null ? editContractor.Name : original.Name;
            original.Description = editContractor.Description != null ? editContractor.Description : original.Description;

            return(_repo.Edit(original));
        }
Exemplo n.º 6
0
        internal Contractor Edit(Contractor updated)
        {
            var original = GetById(updated.Id);

            updated.Age    = updated.Age != null ? updated.Age : original.Age;
            updated.Name   = updated.Name != null && updated.Name.Length > 2 ? updated.Name : original.Name;
            updated.Salary = updated.Salary != null && updated.Salary > 2 ? updated.Salary : original.Salary;
            return(_repo.Edit(updated));
        }
Exemplo n.º 7
0
        internal Contractor Edit(Contractor updated)
        {
            var original = GetById(updated.Id);

            if (original.CreatorId != updated.CreatorId)
            {
                throw new Exception("Invalid Edit Permissions");
            }
            updated.Title = updated.Title != null ? updated.Title : original.Title;
            return(_repo.Edit(updated));
        }
Exemplo n.º 8
0
        internal Contractor Edit(Contractor updated)
        {
            var data = GetById(updated.Id);

            updated.Name    = updated.Name != null ? updated.Name : data.Name;
            updated.Address = updated.Address != null ? updated.Address : data.Address;
            updated.Contact = updated.Contact != null ? updated.Contact : data.Contact;
            updated.Skills  = updated.Skills != null ? updated.Skills : data.Skills;

            return(_repo.Edit(updated));
        }
        internal Contractor Edit(Contractor updated)
        {
            var data = GetById(updated.Id);

            if (data.CreatorId != updated.CreatorId)
            {
                throw new Exception("Invalid Creator you do not have permissions");
            }
            updated.Name         = updated.Name != null ? updated.Name : data.Name;
            updated.Address      = updated.Address != null ? updated.Address : data.Address;
            updated.ContactPhone = updated.ContactPhone > 0 ? updated.ContactPhone : data.ContactPhone;
            return(_repo.Edit(updated));
        }
Exemplo n.º 10
0
        internal Contractor Edit(Contractor updated)
        {
            var data = GetById(updated.Id);

            return(_repo.Edit(updated));
        }