Example #1
0
        public void updateApplication(int id, Update application)
        {
            try
            {
                if (application.MessageTemplate != null)
                {
                    JObject tmp = JObject.Parse(application.MessageTemplate);
                }
            }
            catch
            {
                throw new Exception("MessageTemplate must be in Json fromat");
            }

            DBHelper._Application dbhelp = new DBHelper._Application();
            Application           existingApplication = dbhelp.GetByid(id);

            existingApplication.Name            = application.Name;
            existingApplication.Description     = application.Description;
            existingApplication.MessageTemplate = application.MessageTemplate;
            existingApplication.Method          = application.Method;
            existingApplication.ServiceURL      = application.ServiceURL;
            existingApplication.AuthType        = application.AuthType;
            existingApplication.AuthID          = application.AuthID;
            existingApplication.AuthPW          = application.AuthPW;
            existingApplication.TokenURL        = application.TokenURL;
            existingApplication.HeaderValues    = application.HeaderValues;
            existingApplication.TargetType      = application.TargetType;

            dbhelp.Update(existingApplication);
        }
Example #2
0
        public void deleteApplication(int id)
        {
            DBHelper._Application dbhelp = new DBHelper._Application();
            Application           existingApplication = dbhelp.GetByid(id);

            dbhelp.Delete(existingApplication);
        }
Example #3
0
        public Detail getApplicationById(int id)
        {
            DBHelper._Application dbhelp      = new DBHelper._Application();
            Application           application = dbhelp.GetByid(id);

            return(new Detail()
            {
                Id = application.Id,
                Name = application.Name,
                Description = application.Description,
                CompanyId = application.CompanyId,
                MessageTemplate = (application.MessageTemplate == null) ? null : JObject.Parse(application.MessageTemplate),
                Method = application.Method,
                ServiceURL = application.ServiceURL,
                AuthType = application.AuthType,
                AuthID = application.AuthID,
                AuthPW = application.AuthPW,
                TokenURL = application.TokenURL,
                HeaderValues = application.HeaderValues,
                TargetType = application.TargetType
            });
        }