Пример #1
0
        public Feedback saveAppUserAddOnConfig(string tenant, AppUserAddOnConfig data)
        {
            Feedback feedback = new Feedback();

            try
            {
                AppNotification notification;
                try
                {
                    using (var transaction = DBServer.BeginTransaction())
                    {
                        if (_userRepo.GetInstance(tenant).saveAppUserAddOnConfig(ref data, transaction))
                        {
                            transaction.Commit();
                            feedback = new Feedback
                            {
                                Code    = 1,
                                Message = "Data saved sucessfully",
                                data    = data
                            };
                        }
                        else
                        {
                            feedback = new Feedback
                            {
                                Code    = 1,
                                Message = "Data saved sucessfully",
                                data    = data
                            };
                        }
                    }
                }
                catch (Exception ex)
                {
                    feedback = new Feedback
                    {
                        Code    = 0,
                        Message = "Got the error while removing data",
                        data    = ex
                    };
                    GitHub.createIssue(ex, new { tenant = tenant, data = data }, _accessor.HttpContext.Request.Headers);
                }
            }
            catch (Exception ex)
            {
                GitHub.createIssue(ex, new { tenant = tenant, data = data }, _accessor.HttpContext.Request.Headers);
            }
            return(feedback);
        }
Пример #2
0
 public bool saveAppUserAddOnConfig(ref AppUserAddOnConfig data, SqlTransaction transaction)
 {
     try
     {
         SqlCommand command;
         if (data.ID == 0)
         {
             command = data.InsertInto();
             data.ID = command.ExecuteNScalar(transaction);
         }
         else
         {
             command = data.UpdateInto();
             command.ExecuteNon(transaction);
         }
         return(true);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #3
0
 public Feedback saveAppUserAddOnConfig(AppUserAddOnConfig data, string tenant = "")
 {
     return(_userProvider.GetInstance(tenant).saveAppUserAddOnConfig(tenant, data));
 }