public int UpdateWebCompanyByCompanyCenter(WebCompany webCompany) { WebCaseService webCaseService = new WebCaseService(); using (AIYunNetContext context = new AIYunNetContext()) { WebCompany originalCompany = context.WebCompany.Find(webCompany.CompanyID); if (originalCompany != null && webCompany != null) { originalCompany.CompanyName = webCompany.CompanyName; originalCompany.CompanyNet = webCompany.CompanyNet; originalCompany.BelongArea = webCompany.BelongArea; originalCompany.CaseCount = webCaseService.GetCaseCountByCompanyId(webCompany.CompanyID); originalCompany.CompanyAddress = webCompany.CompanyAddress; originalCompany.CompanyInfo = webCompany.CompanyInfo; //originalCompany.CompanyMail = webCompany.CompanyMail; originalCompany.CompanyMoble = webCompany.CompanyMoble; originalCompany.CompanyPeople = webCompany.CompanyPeople; originalCompany.CompanyPhone = webCompany.CompanyPhone; originalCompany.EditOn = DateTime.Now; //originalCompany.ForwardNetAddress = webCompany.ForwardNetAddress; //originalCompany.InBuildingCount = webCompany.InBuildingCount; //originalCompany.IsApproved = webCompany.IsApproved; //originalCompany.IsAuthentication = webCompany.IsAuthentication; //originalCompany.IsBond = webCompany.IsBond; //originalCompany.IsFamousEnterprise = webCompany.IsFamousEnterprise; //originalCompany.IsPreferentialActivity = webCompany.IsPreferentialActivity; //originalCompany.IsTop = webCompany.IsTop; //originalCompany.ShowOrder = webCompany.ShowOrder; originalCompany.GoodAtStyle = webCompany.GoodAtStyle; originalCompany.GoodAtStyleID = webCompany.GoodAtStyleID; originalCompany.GoodAtTypeID = webCompany.GoodAtTypeID; originalCompany.GoodAtType = webCompany.GoodAtType; originalCompany.PriceID = webCompany.PriceID; originalCompany.PriceName = webCompany.PriceName; originalCompany.CompanyImage = webCompany.CompanyImage; originalCompany.thumbnailImage = webCompany.thumbnailImage; originalCompany.CompanySize = webCompany.CompanySize; originalCompany.ProvinceID = webCompany.ProvinceID; originalCompany.ProvinceName = webCompany.ProvinceName; originalCompany.CityID = webCompany.CityID; originalCompany.CityName = webCompany.CityName; originalCompany.AreasID = webCompany.AreasID; originalCompany.AreasName = webCompany.AreasName; context.SaveChanges(); return(1); } else { return(0); } } }
/// <summary> /// 根据companyID修改案例个数 /// </summary> public void updateCaseCountbyCompanyID(int companyID) { WebCaseService webCaseService = new WebCaseService(); using (AIYunNetContext context = new AIYunNetContext()) { WebCompany originalWebCompany = context.WebCompany.Find(companyID); if (originalWebCompany != null) { originalWebCompany.CaseCount = webCaseService.GetCaseCountByCompanyId(companyID); context.SaveChanges(); } } }