Ejemplo n.º 1
0
        public void Update(Role role)
        {
            try
            {
                List <View> list = new List <View>();
                list = role.ViewsPerRole;
                VCrud.DelteRolexView(role);
                CrudFactory.Update(role);

                var valueList = new ValueListSelect
                {
                    IdList      = "Role",
                    Value       = role.IdRole.ToString(),
                    Description = role.Name
                };
                VLCrud.Update(valueList);

                foreach (View RolxV in list)
                {
                    CrudFactory.CreateRolexView(RolxV, role);
                }
            }
            catch (Exception ex)
            {
                ExceptionManager.GetInstance().Process(ex);
            }
        }
Ejemplo n.º 2
0
 public void UpdateFinesSettings(FineType fineType)
 {
     try
     {
         CrudFactory.UpdateFinesSettings(fineType);
         var valueList = new ValueListSelect
         {
             IdList      = "FineType",
             Value       = fineType.IdType.ToString(),
             Description = fineType.TypeName
         };
         VLCrud.Update(valueList);
     }
     catch (Exception ex)
     {
         ExceptionManager.GetInstance().Process(ex);
     }
 }
        public void Update(Location location)
        {
            Location be = null;

            try
            {
                be = CrudFactory.Retrieve <Location>(location);
                if (be != null)
                {
                    if (!String.IsNullOrEmpty(location.Name))
                    {
                        CrudFactory.Update(location);
                        var valueList = new ValueListSelect
                        {
                            IdList      = "Location",
                            Value       = location.IdLocation.ToString(),
                            Description = location.Name
                        };
                        VLCrud.Update(valueList);
                    }
                    else
                    {
                        // Location Name is required.
                        throw new BusinessException(24);
                    }
                }
                else
                {
                    // Location Not Found.
                    throw new BusinessException(23);
                }
            }
            catch (Exception ex)
            {
                ExceptionManager.GetInstance().Process(ex);
            }
        }