public ApiOutputModel Insert(ApplicationsModel data) { if (data == null) { return new ApiOutputModel { Result = EnumSpProcessorCallResult.InvalidSuppliedData } } ; if (GetByName(data.Name) != null) { return new ApiOutputModel { Result = EnumSpProcessorCallResult.DataConflict } } ; using (var db = new LiteDatabase(_repositoryPath)) { var lApp = db.GetCollection <ApplicationsModel>(TableName); data.Id = new Guid(); lApp.Insert(data); DoIndexing(lApp); } return(new ApiOutputModel { Result = EnumSpProcessorCallResult.Success, Supplement = data }); }
public ActionResult ApplicationForm() { ApplicationsModel model = HomeBuilder.BuildApplications(Db); ViewBag.Link = 6; return(View(model)); }
public ActionResult EditAppState(ApplicationsModel p1, int id, HttpPostedFileBase Image) { Domain.Entity.Application application = apps.GetById(id); application.State = p1.State; apps.Update(application); apps.Commit(); return(new HttpStatusCodeResult(System.Net.HttpStatusCode.OK)); }
public ActionResult SendApp(ApplicationsModel projectVM) { Domain.Entity.Application p = new Domain.Entity.Application { Date = projectVM.Date, Description = projectVM.Description, IdUser = projectVM.IdUser //hetha zedtha bla test ken fama mochkol raho hna }; apps.Add(p); apps.Commit(); return(new HttpStatusCodeResult(System.Net.HttpStatusCode.OK)); }
public IHttpActionResult GetAppKey(string appName) { try { ApplicationsModel appModel = new ApplicationsModel(); return(Ok(appModel.Applications.FirstOrDefault(x => x.ApplicationName == appName).ApplicationKey)); } catch { return(BadRequest("App name not found")); } }
public static bool CheckApplications(ApplicationsModel applications) { if (applications == null) { return(false); } if (applications.Applications != null && applications.Hash != null) { return(true); } return(false); }
public IActionResult PostApplication([FromBody] ApplicationsModel application) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (!_applicationRepository.CreateApplication(application)) { ModelState.AddModelError("", $"Something went wrong saving the job " + $"{application.Job}"); return(StatusCode(500, ModelState)); } return(Ok(new { applicationCreated = true })); }
public static ApplicationsModel BuildApplications(DASEntities db) { ApplicationsModel model = new ApplicationsModel(); int languageId = (int)HttpContext.Current.Session["lngId"]; GridDescriptor desc = new GridDescriptor(new SortDescriptor() { PropertyName = "DateCreated", Order = SortOrder.Descending }) { Pager = new PagerDescriptor(1, 20, db.Labels.Where(l => l.ViewId == "Clients" && l.ElementId == "lblPageSize" && l.LanguageId == languageId).Select(l => l.Text).FirstOrDefault(), 5) }; IQueryable <DAS.Domain.Model.ApplicationForm> applications = db.ApplicationForms.AsQueryable(); IList <DAS.Domain.Model.ApplicationForm> listA = applications.Slice(desc).ToList(); model.Filters = new ApplicationListFilterModel(); model.Applications = new ApplicationList() { Descriptor = desc, ListOfApplication = new List <DAS.Backoffice.Models.Application.ApplicationForm>() }; DAS.Backoffice.Models.Application.ApplicationForm applicationModel; foreach (var item in listA) { applicationModel = new DAS.Backoffice.Models.Application.ApplicationForm() { ApplicationId = item.ApllicationId, CompanyName = item.CompanyName, Adress = item.Adress, Place = item.Place, Telephone = item.Telephone, Email = item.Email, Applicant = item.Applicant, ISO14001 = (bool)item.ISO14001, ISO22301 = (bool)item.ISO22301, ISO27001 = (bool)item.ISO27001, ISO9001 = (bool)item.ISO9001, OtherIso = (bool)item.OtherIso, Other = item.Other, CompanyWebsite = item.CompanyWebsite, PrimaryContactForAuditPurposes = item.PrimaryContactForAuditPurposes, PrimaryContactTelephone = item.PrimaryContactTelephone, NatureOfBusiness = item.NatureOfBusiness, NumberOfYearsAtThisSite = item.NumberOfYearsAtThisSite, PrincipleServicesOrProducts = item.PrincipleServicesOrProducts, ActivitiesOnClientsSites = item.ActivitiesOnClientsSites, NameOfPresentCertificationBody = item.NameOfPresentCertificationBody, CertificateExpiryDate = item.CertificateExpiryDate, TotalNumberOfEmployees = item.TotalNumberOfEmployees, TotalNumberOfCompanyDirectors = item.TotalNumberOfCompanyDirectors, NumberOfLocations = item.NumberOfLocations, AllSitesMainActivites = item.AllSitesMainActivites, SalesTotalPermanent = item.SalesTotalPermanent, SalesTotalTemporary = item.SalesTotalTemporary, MarketingTotalPermanent = item.MarketingTotalPermanent, ManufacturingTotalTemporary = item.ManufacturingTotalTemporary, MarketingTotalTemporary = item.MarketingTotalTemporary, AdministrationTotalPermanent = item.AdministrationTotalPermanent, AdministrationTotalTemporary = item.AdministrationTotalTemporary, DesignTotalPermanent = item.DesignTotalPermanent, DesignTotalTemporary = item.DesignTotalTemporary, ManufacturingTotalPermanent = item.ManufacturingTotalPermanent, OtherTotalPermanent = item.OtherTotalPermanent, OtherTotalTemporary = item.OtherTotalTemporary, TotalPermanent = item.TotalPermanent, TotalTemporary = item.TotalTemporary, Extension = item.Extension, ManagementRepresentativeName = item.ManagementRepresentativeName, JobTitle = item.JobTitle, NameOfConsultant = item.NameOfConsultant, ConsultantTelephone = item.ConsultantTelephone, ISO14001_2 = (bool)item.ISO14001_2, ISO9001_2 = (bool)item.ISO9001_2, ISO22301_2 = (bool)item.ISO22301_2, ISO27001_2 = (bool)item.ISO27001_2, BSOHSAS18001_2 = (bool)item.BSOHSAS18001_2, StandardTransferred = item.StandardTransferred, DateNextCertificationBodyVisit = item.DateNextCertificationBodyVisit, Other_2 = item.Other_2, OtherIso_2 = (bool)item.OtherIso_2, date_created = (DateTime)item.DateCreated }; model.Applications.ListOfApplication.Add(applicationModel); } return(model); }
//получение всех необработанных заявок private void GetAllApplications() { applications = ApplicationController.GetAllApplications(); List <ApplicationsModel> appModels = new List <ApplicationsModel>(); foreach (var app in applications) { ApplicationsModel appModel = new ApplicationsModel() { ApplicationId = app.ApplicationId, UserName = app.User.FullName, PetName = app.Pet.Name, Service = app.Service.Name, Date = app.Date.ToString().Substring(0, 10), Time = app.Time.Interval, }; appModels.Add(appModel); } GridApplications = appModels; }
public ApiOutputModel Update(Guid id, ApplicationsModel data) { if (data == null) { return new ApiOutputModel { Result = EnumSpProcessorCallResult.InvalidSuppliedData } } ; data.Id = id; // make sure we not lost old data fields var oldData = Get(data.Id); if (oldData == null) { return new ApiOutputModel { Result = EnumSpProcessorCallResult.SourceNotFound } } ; data.Name = data.Name ?? oldData.Name; data.ConnectionString = data.ConnectionString ?? oldData.ConnectionString; using (var db = new LiteDatabase(_repositoryPath)) { var lApp = db.GetCollection <ApplicationsModel>(TableName); lApp.Update(data); } return(new ApiOutputModel { Result = EnumSpProcessorCallResult.Success, Supplement = data }); }
public IActionResult Create(string scheduleType) { try { var claims = _repo.Jwt.GetUserClaims(Request.Headers[HeaderNames.Authorization].ToString()); var application = new ApplicationsModel() { UserId = claims.UserId, Description = scheduleType == "individual" ? ScheduleTypesEnum.Individual.ToString() : scheduleType == "company" ? ScheduleTypesEnum.Company.ToString() : scheduleType == "trust" ? ScheduleTypesEnum.Trust.ToString() : "Undefined Type" }; _repo.Applications.Create(application); _repo.Save(); var applSteps = _repo.ApplicationSteps.CreateApplicationSteps(scheduleType, application.Id); application.Steps = applSteps; _repo.Applications.Update(application); _repo.Save(); var dto = _mapper.Map <ApplicationsDto>(application); return(Ok(dto)); } catch (Exception e) { return(StatusCode(500, e.Message)); } }
public ApiOutputModel Put([FromBody] ApplicationsModel value) { return(_ap.Update(value.Id, value)); }
public ApiOutputModel Post([FromBody] ApplicationsModel value) { return(_ap.Insert(value)); }