Example #1
0
        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);
        }
Example #2
0
 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();
     }
 }
Example #3
0
        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);
                }
            }
        }
Example #4
0
 public override List <CONStructureAssociation> FindAll(CONStructureAssociation data, Options option)
 {
     return(base.FindAll(data, option));
 }
Example #5
0
 public override CONStructureAssociation FindById(CONStructureAssociation data)
 {
     return(base.FindById(data));
 }
Example #6
0
 public override void AddMoreDetailFindById(CONStructureAssociation data)
 {
 }
Example #7
0
 public override void SaveOrUpdateDetails(CONStructureAssociation data)
 {
     base.SaveOrUpdateDetails(data);
 }
Example #8
0
 public override void RemoveRules(CONStructureAssociation data)
 {
     base.RemoveRules(data);
 }
Example #9
0
 public override void ModifyRules(CONStructureAssociation data)
 {
     base.ModifyRules(data);
     data.LastUpdate = DateTime.Now;
 }
Example #10
0
 public override void CommonRules(CONStructureAssociation data)
 {
     base.CommonRules(data);
 }
Example #11
0
 public void AddDetails(CONStructureAssociation data)
 {
 }
Example #12
0
 public override void FindByIdRules(CONStructureAssociation data)
 {
     base.FindByIdRules(data);
 }