Beispiel #1
0
        public void AddCompanies(GtMetrics metric)
        {
            if (_CompanyRepo.GetAll().Count() > 0)
            {
                return;
            }
            Company initial = new Company
            {
                Id                      = 1,
                BusinessType            = "Agriculture Equipment",
                City                    = "Grapevine",
                CompanyName             = "Kubota Tractor",
                ConfirmedVersionDate    = new DateTime(2019, 9, 21),
                Contacted               = false,
                Country                 = "United States",
                EndEnterpriseSupport    = null,
                GtMetricsId             = 1,
                GtMetrics               = metric,
                Notes                   = string.Empty,
                PreviousVersion         = null,
                RankingScale            = 1,
                SfVersion               = 11.1,
                SitefinityRetirmentDate = null,
                State_Region            = "Texas",
                Street                  = "1000 Kubota Drive",
                Url                     = "kubotausa.com",
                ZipCode                 = "76051"
            };

            _CompanyRepo.Add(initial);
        }
Beispiel #2
0
        public async Task <ActionResult> Add(EM_Company model)
        {
            model.KPIValue   = model.KPIValue.Value * 10000;
            model.ModifyDate = DateTime.Now;
            model.CreateDate = DateTime.Now;
            model.Modifier   = ViewHelp.GetUserName();
            model.Creater    = ViewHelp.GetUserName();
            companyRepo.Add(model);
            var result = companyRepo.SaveChanges();

            if (result > 0)
            {
                return(Json(new { code = 1 }));
            }
            else
            {
                return(Json(new { code = 0, message = "保存失败,请重试" }));
            }
        }
Beispiel #3
0
        public Company Add(Company company)
        {
            var Company = _companyRepo.Add(company);

            return(Company);
        }