Esempio n. 1
0
 private Service CreateService(SqlDataReader reader)
 {
     return(new Service {
         Id = Convert.ToInt64(reader["id"]),
         Caption = Convert.ToString(reader["caption"]),
         Organization = OrgService.GetOrganizationById(Convert.ToInt64(reader["org_id"]))
     });
 }
Esempio n. 2
0
        public long Create(string caption, Int64 organizationId, long parentId)
        {
            Debug.Assert(!string.IsNullOrEmpty(caption));

            var service = new Service {
                Caption      = caption,
                Organization = OrgService.GetOrganizationById(organizationId),
                Parent       = GetServiceById(parentId)
            };

            var work_of_unit = UnitOfWorkProvider.GetUnitOfWork();

            work_of_unit.BeginTransaction();
            Repository.Create(service);
            work_of_unit.Commit();

            _is_cache_valid = false;

            return(0);
        }