public override String GetQuery(CONStructureAssociation data, Boolean byId) { String dml = base.GetQuery(data, byId); if (byId) { //add more parameters to method for query by id } else { //Determine if the boolean values are taken included as part of the consultation //dml += " AND a.Active = :Active \n" ; //add more parameters to method for query by any field if (data.MainStructure != null && data.MainStructure.Id != 0) { dml += " AND a.MainStructure.Id = :MainStructure \n"; } if (data.ChildStructure != null && data.ChildStructure.Id != 0) { dml += " AND a.ChildStructure.Id = :ChildStructure \n"; } dml += " order by a.Id asc "; } return(dml); }
public override CONStructureAssociation Execute(CONStructureAssociation data, Actions action, Options option, string token) { try { if (action == Actions.Add || action == Actions.Modify || action == Actions.Remove || (action == Actions.Find && (option == Options.Me || option == Options.Exist))) { if ((action == Actions.Add || action == Actions.Modify) && option == Options.All) { BenginTransaction(); } data = base.Execute(data, action, option, token); if (action == Actions.Find && option == Options.Me) { } if ((action == Actions.Add || action == Actions.Modify) && option == Options.All) { AddDetails(data); } //if (option == Options.All) // Work.Commit(); return(data); } else if (action == Actions.Find && (option == Options.All || option == Options.Light)) { if (option == Options.All) { data.Entities = FindAll(data, Options.All); } else if (option == Options.Light) { data.Entities = FindAll(data, Options.Light); } return(data); } else { throw new NotImplementedException(GetLocalizedMessage(Language.DLACTIONNOTIMPLEMENT, action.ToString(), option.ToString())); } } catch (FaultException <BusinessException> f) { Rollback(); throw f; } catch (Exception e) { Rollback(); throw new BusinessException(e).GetFaultException(); } finally { Commit(); } }
public override void SetQueryParameters(IQuery query, CONStructureAssociation data, Boolean byId) { base.SetQueryParameters(query, data, byId); if (byId) { //add more parameters to method for query by id } else { //Determine if the boolean values are taken included as part of the consultation //query.SetBoolean("Active", data.Active); //add more parameters to method for query by any field if (data.MainStructure != null && data.MainStructure.Id != 0) { query.SetInt32("MainStructure", data.MainStructure.Id); } if (data.ChildStructure != null && data.ChildStructure.Id != 0) { query.SetInt32("ChildStructure", data.ChildStructure.Id); } } }
public override List <CONStructureAssociation> FindAll(CONStructureAssociation data, Options option) { return(base.FindAll(data, option)); }
public override CONStructureAssociation FindById(CONStructureAssociation data) { return(base.FindById(data)); }
public override void AddMoreDetailFindById(CONStructureAssociation data) { }
public override void SaveOrUpdateDetails(CONStructureAssociation data) { base.SaveOrUpdateDetails(data); }
public override void RemoveRules(CONStructureAssociation data) { base.RemoveRules(data); }
public override void ModifyRules(CONStructureAssociation data) { base.ModifyRules(data); data.LastUpdate = DateTime.Now; }
public override void CommonRules(CONStructureAssociation data) { base.CommonRules(data); }
public void AddDetails(CONStructureAssociation data) { }
public override void FindByIdRules(CONStructureAssociation data) { base.FindByIdRules(data); }