/// <summary> /// Before Save /// </summary> /// <param name="newRecord">new</param> /// <returns>true if can be saved</returns> protected override bool BeforeSave(bool newRecord) { // if (RESPONSIBLETYPE_Human.equals(getResponsibleType()) && getAD_User_ID() == 0) // return true; if (RESPONSIBLETYPE_Role.Equals(GetResponsibleType()) && GetAD_Role_ID() == 0 && GetAD_Client_ID() > 0) { log.SaveError("Error", Msg.ParseTranslation(GetCtx(), "@RequiredEnter@ @AD_Role_ID@")); return(false); } // User not used if (!RESPONSIBLETYPE_Human.Equals(GetResponsibleType()) && GetAD_User_ID() == 0) { SetAD_User_ID(0); } // Role not used if (!RESPONSIBLETYPE_Role.Equals(GetResponsibleType()) && GetAD_Role_ID() == 0) { SetAD_Role_ID(0); } //Lakhwinder if (RESPONSIBLETYPE_Human.Equals(GetResponsibleType())) { if (GetAD_User_ID() == 0) { return(false); } SetAD_Role_ID(0); } else if (RESPONSIBLETYPE_Role.Equals(GetResponsibleType())) { if (GetAD_Role_ID() == 0) { return(false); } SetAD_User_ID(0); } else if (RESPONSIBLETYPE_Organization.Equals(GetResponsibleType())) { SetAD_Role_ID(0); SetAD_User_ID(0); } //Lakhwinder return(true); }
/// <summary> /// Is Org Responsible /// </summary> /// <returns>true if Org</returns> public bool IsOrganization() { // Commented check for "*" Organization return(RESPONSIBLETYPE_Organization.Equals(GetResponsibleType())); // && GetAD_Org_ID() != 0; }
/// <summary> /// Is Org Responsible /// </summary> /// <returns>true if Org</returns> public bool IsOrganization() { return(RESPONSIBLETYPE_Organization.Equals(GetResponsibleType()) && GetAD_Org_ID() != 0); }
/// <summary> /// Invoker - return true if no user and no role /// </summary> /// <returns>true if invoker</returns> public bool IsInvoker() { return(GetAD_User_ID() == 0 && GetAD_Role_ID() == 0 && !(RESPONSIBLETYPE_Organization.Equals(GetResponsibleType()))); }