Пример #1
0
        // GetModel(int IDModel)
        public DocModel GetDocModel(int IDDocModel)
        {
            Dictionary <string, object> insaddr = new Dictionary <string, object>();

            insaddr.Add("IDModel", IDDocModel);
            DocModel retour = base.GetOneDefault <DocModel>(insaddr);

            return(retour);
        }
Пример #2
0
 public DocModel UpdateModel(DocModel model)
 {
     try
     {
         // la mise à jour directe de model en paramètre crash !!!
         DocModel docModel = this.GetDocModel(model.IDModel);
         docModel.Title      = model.Title;
         docModel.IDAccount  = model.IDAccount;
         docModel.IDCampaign = model.IDCampaign;
         base.SaveBubble(docModel);
         return(docModel);
     }
     catch (Exception ex)
     {
         throw new Exception("UpdateModel " + ex.Message, ex);
     }
 }
Пример #3
0
        public DocModel CreateModel(Account account, Campaign campaign, string Title)
        {
            try
            {
                DocModel nouveau = new DocModel();
                nouveau.Title      = Title;
                nouveau.IDAccount  = account.IDAccount;
                nouveau.IDCampaign = campaign.IDCampaign;
                nouveau["IDModel"] = DBNull.Value;

                // Insert
                base.InsertBubble(nouveau, false, true);

                return(nouveau);
            }
            catch (Exception ex)
            {
                throw new Exception("CreateModel " + ex.Message, ex);
            }
        }