コード例 #1
0
ファイル: CompanyController.cs プロジェクト: AlvisHuang/TPIA
        public ActionResult EditCompanyInfo(EditCompanyInfoRequestDTO dto)
        {
            string url = "api/Company/EditCompayInfo";
            enErrorCode result = _apiAdaptor.Post<EditCompanyInfoRequestDTO, enErrorCode>(url, dto);

            return RedirectToAction("BackEndIndex", "Company");
        }
コード例 #2
0
ファイル: CompanyController.cs プロジェクト: AlvisHuang/TPIA
        public enErrorCode EditCompayInfo(EditCompanyInfoRequestDTO dto)
        {
            enErrorCode enCode = enErrorCode.EXCEPTION;
            try
            {
                Company c = _dbContext.Set<Company>().Find(dto.CID);
                c.CompanyName = dto.CompanyName;
                c.Manager = dto.Manager;
                c.Sales = dto.Sales;
                c.AboutUs = dto.AboutUs;
                c.Address = dto.Address;
                c.Phone = dto.Phone;
                c.Tax = dto.Tax;
                c.EMail = dto.EMail;
                c.MainProducts = dto.MainProducts;
                c.SiteURL = dto.SiteURL;
                int result = _dbContext.SaveChanges();

                if (result == 1)
                {
                    enCode = enErrorCode.SUCCESS;
                }
            }
            catch (Exception ex)
            {

                throw;
            }
            return enCode;
        }
コード例 #3
0
ファイル: CompanyController.cs プロジェクト: AlvisHuang/TPIA
        public ActionResult EditCompanyInfo(int CId)
        {
            string url = String.Format("api/Company/GetCompayInfo?CID={0}", CId);
            GetCompayInfoReturnDTO result = _apiAdaptor.Get<GetCompayInfoReturnDTO>(url);

            EditCompanyInfoRequestDTO dto = new EditCompanyInfoRequestDTO()
            {
                CID = result.CID,
                CompanyName = result.CompanyName,
                Manager = result.Manager,
                Sales = result.Sales,
                AboutUs = result.AboutUs,
                Address = result.Address,
                Phone = result.Phone,
                Tax = result.Tax,
                EMail = result.EMail,
                MainProducts = result.MainProducts,
                SiteURL = result.SiteURL
            };
            return View(dto);
        }