Ejemplo n.º 1
0
        public bool HasRight(BaseQrDoc doc)
        {
            Role role = new Role();
            try
            {
                role = Entities.Roles.FirstOrDefault(rol => rol.DocType.id == doc.docType && rol.statusId == doc.ActionId);
                if (role == null)
                    return false;

                var right = Entities.Rights.FirstOrDefault(righ => righ.Role.id == role.id && righ.userId == doc.ActionUser.id);
                if (right == null)
                    return false;
                else
                {
                    return true;
                }

            }
            catch (Exception)
            {

                throw;
            }

            return false;
        }
Ejemplo n.º 2
0
        public bool HasChance(BaseQrDoc doc)
        {
            Role role = new Role();
            try
            {
                role = Entities.Roles.FirstOrDefault(rol => rol.DocType.id == doc.docType && rol.statusId == doc.ActionId);
                if (role != null)
                    return true;
            }
            catch (Exception exc)
            {

            }
            return false;
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Roles EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToRoles(Role role)
 {
     base.AddObject("Roles", role);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Create a new Role object.
 /// </summary>
 /// <param name="id">Initial value of the id property.</param>
 /// <param name="statusId">Initial value of the statusId property.</param>
 /// <param name="docTypeId">Initial value of the docTypeId property.</param>
 /// <param name="name">Initial value of the name property.</param>
 public static Role CreateRole(global::System.Int32 id, global::System.Int32 statusId, global::System.Int32 docTypeId, global::System.String name)
 {
     Role role = new Role();
     role.id = id;
     role.statusId = statusId;
     role.docTypeId = docTypeId;
     role.name = name;
     return role;
 }