Пример #1
0
        public static ProxyEmployee ConvertToOneProxyEmployee(new_employee emp)
        {
            ProxyEmployee p = new ProxyEmployee();

            p.BirthDate = emp.new_birthdate;
            p.Name      = emp.new_name;
            p.ID        = emp.Id;

            return(p);
        }
Пример #2
0
        public ProxyEmployee GetOneEmployee(Guid id)
        {
            ProxyEmployee covenant = null;
            //using (Xrm.XrmServiceContext context = new Xrm.XrmServiceContext("Xrm"))
            //{
            var c = this.context.new_employeeSet.Where(i => i.Id == id).FirstOrDefault();

            if (c != null)
            {
                covenant = ObjectConverter.ConvertToOneProxyEmployee(c);
            }
            //}
            return(covenant);
        }
Пример #3
0
        public static List <ProxyEmployee> ConvertToProxyEmployee(List <new_employee> emps, OrgContext context)
        {
            List <ProxyEmployee> list = new List <ProxyEmployee>();

            foreach (var emp in emps)
            {
                ProxyEmployee p = new ProxyEmployee();
                p.BirthDate = emp.new_birthdate;
                p.Name      = emp.new_name;
                p.ID        = emp.Id;
                list.Add(p);
            }
            return(list);
        }