public ActionResult AddOrEditWebCompany(int companyID) { WebCompany company = webCompanyService.GetWebCompanyByID(companyID); if (company == null) { company = new WebCompany(); } //公司人员列表 List <WebPeople> companyPeoples = webPeopleService.GetAllWebPeopleListByCompanyAndPeopleCategory("", companyID); ViewBag.CompanyPeoples = companyPeoples; //公司案例列表 List <WebCase> webCaseList = webCaseService.GetWebCaseListByCompanyID(companyID); ViewBag.WebCases = webCaseList; //公司首页推送 List <WebRecommend> RecommendList = webRRecommendService.GetAllWebRecommendByCompany(12, companyID); ViewBag.RecommendList = RecommendList; //省份 IEnumerable <SelectListItem> provinceList = null; List <t_Province> common = areaService.GetProvinceList(); provinceList = common.Select(com => new SelectListItem { Value = com.provinceID.ToString(), Text = com.province }); ViewBag.provinceList = provinceList; return(View(company)); }
public int UpdateWebCompanyRegist(WebCompany webCompany) { using (AIYunNetContext context = new AIYunNetContext()) { WebCompany originalCompany = context.WebCompany.Find(webCompany.CompanyID); if (originalCompany != null && webCompany != null) { originalCompany.CompanyType = webCompany.CompanyType; originalCompany.RegistAddress = webCompany.RegistAddress; originalCompany.RegistAuthority = webCompany.RegistAuthority; originalCompany.RegistMark = webCompany.RegistMark; originalCompany.RepresentPerson = webCompany.RepresentPerson; originalCompany.CompanyAddOn = webCompany.CompanyAddOn; originalCompany.BusinessScope = webCompany.BusinessScope; originalCompany.RegistMoney = webCompany.RegistMoney; originalCompany.EditOn = DateTime.Now; context.SaveChanges(); return(1); } else { return(0); } } }
public ActionResult CompanyRegist() { WebCompanyUser comuer = webcomuser.GetWebCompanyUserByAccount(userAcount); WebCompany webcom = webcompanyser.GetWebCompanyByUserID(comuer.CompanyUserID); return(View(webcom)); }
public int CompanyRegister(string userAccount, string userPassword) { bool bit = webcomuserser.IsHaveuserAccount(userAccount); if (bit) { //存在 return(0); } else { WebCompanyUser webcompanyuser = new WebCompanyUser { ComUserName = userAccount, Password = FormsAuthentication.HashPasswordForStoringInConfigFile(userPassword, "md5"), CompanyPhone = userAccount }; webcomuserser.AddWebCompanyUser(webcompanyuser); WebCompany webcom = new WebCompany { CompanyMoble = userAccount, WebCompanyUserID = webcomuserser.GetWebCompanyUserByAccount(userAccount).CompanyUserID }; int result = webcomser.AddWebCompany(webcom); return(result); } }
public bool IsHaveuser(int userID) { using (AIYunNetContext context = new AIYunNetContext()) { WebCompany WebCompany = context.WebCompany.FirstOrDefault(us => us.WebCompanyUserID == userID); return(WebCompany != null ? true : false); } }
public ActionResult CompanyTuBaCaseDetail(int companyID, int caseID) { WebCompany company = webCompanyService.GetWebCompanyByID(companyID); List <WebCase> caselist = webCaseService.GetWebCaseListByCompanyIDAndCount(companyID, 2); ViewBag.CaseList = caselist; return(View(company)); }
//从个人中心修改 public int UpdateWebPeopleFromCenter(WebPeople webPeople) { using (AIYunNetContext context = new AIYunNetContext()) { if (webPeople != null) { WebPeople originalPeople = context.WebPeople.Find(webPeople.PeopleID); WebCompany company = context.WebCompany.Find(webPeople.CompanyID); if (originalPeople != null) { //originalPeople.Address = webPeople.Address; //originalPeople.BelongArea = webPeople.BelongArea; //originalPeople.CaseCount = webPeople.CaseCount; if (webPeople.CompanyID == 0) { originalPeople.CompanyID = 0; originalPeople.CompanyName = ""; } else { originalPeople.CompanyID = webPeople.CompanyID; originalPeople.CompanyName = company.CompanyName; } originalPeople.EditOn = DateTime.Now; //originalPeople.GoodAtStyle = webPeople.GoodAtStyle; //originalPeople.IsApproved = webPeople.IsApproved; //originalPeople.IsAuthentication = webPeople.IsAuthentication; //originalPeople.IsBond = webPeople.IsBond; //originalPeople.IsBuildingCount = webPeople.IsBuildingCount; //originalPeople.IsTop = webPeople.IsTop; originalPeople.PeopleCategory = webPeople.PeopleCategory; //originalPeople.PeopleInfo = webPeople.PeopleInfo; //originalPeople.PeopleLevel = webPeople.PeopleLevel; originalPeople.PeopleMail = webPeople.PeopleMail; //originalPeople.PeopleMotto = webPeople.PeopleMotto; originalPeople.PeopleName = webPeople.PeopleName; originalPeople.PeoplePhone = webPeople.PeoplePhone; originalPeople.PeopleImage = webPeople.PeopleImage; //originalPeople.DesignerImage = webPeople.DesignerImage == null ? "" : webPeople.DesignerImage; originalPeople.thumbnailImage = webPeople.thumbnailImage == null ? "" : webPeople.thumbnailImage; originalPeople.ProvinceID = webPeople.ProvinceID; originalPeople.ProvinceName = webPeople.ProvinceName; originalPeople.CityID = webPeople.CityID; originalPeople.CityName = webPeople.CityName; originalPeople.AreasID = webPeople.AreasID; originalPeople.AreasName = webPeople.AreasName; //originalPeople.ShowOrder = webPeople.ShowOrder; //originalPeople.WorkYears = webPeople.WorkYears; //originalPeople.PeoplePosition = webPeople.PeoplePosition; context.SaveChanges(); } } return(1); } }
public int AddWebCompany(WebCompany webCompany) { using (AIYunNetContext context = new AIYunNetContext()) { context.WebCompany.Add(webCompany); context.SaveChanges(); return(1); } }
public ActionResult CompanyTuBaDesignerList(int companyID) { WebCompany company = webCompanyService.GetWebCompanyByID(companyID); //设计师类型 List <WebLookup> peoplepositionlist = webCommonService.GetLookupList("people_position");//设计级别 ViewBag.peoplepositionlist = peoplepositionlist; return(View(company)); }
public ActionResult AddOrEditWebCompanyRegist(WebCompany company) { int result = 0; if (company != null && company.CompanyID > 0) { result = webCompanyService.UpdateWebCompanyRegist(company); } return(Json(new { retCode = result }, JsonRequestBehavior.AllowGet)); }
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> /// Bizs the company to web company. /// </summary> /// <param name="DataCompany">The data company.</param> /// <returns>WebCompany.</returns> public static WebCompany BizCompanyToWebCompany(this BizCompany DataCompany) { WebCompany webCompany = new WebCompany { Id = DataCompany.Id, CompanyName = DataCompany.CompanyName, Active = DataCompany.Active, }; return(webCompany); }
/// <summary> /// Webs the company to biz company. /// </summary> /// <param name="DataCompany">The data company.</param> /// <returns>BizCompany.</returns> public static BizCompany WebCompanyToBizCompany(this WebCompany DataCompany) { BizCompany bizCompany = new BizCompany { Id = DataCompany.Id, CompanyName = DataCompany.CompanyName, Active = DataCompany.Active, }; return(bizCompany); }
public void PageViewAdd(int CompanyID) { using (AIYunNetContext context = new AIYunNetContext()) { WebCompany originalWebCompany = context.WebCompany.Find(CompanyID); if (originalWebCompany != null) { originalWebCompany.PageViewCount = originalWebCompany.PageViewCount + 1; context.SaveChanges(); } } }
public IHttpActionResult Delete(WebCompany webCompany) { string response = crudFuction.BizDeleteCompany(webCompany.WebCompanyToBizCompany()); if (!response.Equals("EXITO")) { return(BadRequest(response)); } else { return(Ok(response)); } }
//公司信息 public ActionResult CompanyDetail() { WebCompanyUser comuer = webcomuser.GetWebCompanyUserByAccount(userAcount); WebCompany webcom = webcompanyser.GetWebCompanyByUserID(comuer.CompanyUserID); //省份 IEnumerable <SelectListItem> provinceList = null; List <t_Province> common = areaService.GetProvinceList(); provinceList = common.Select(com => new SelectListItem { Value = com.provinceID.ToString(), Text = com.province }); ViewBag.provinceList = provinceList; return(View(webcom)); }
/// <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(); } } }
public ActionResult updateCompanyDetail(WebCompany webcompany) { int result = 0; WebCompanyUser comuer = webcomuser.GetWebCompanyUserByAccount(userAcount); result = webcompanyser.UpdateWebCompanyByCompanyCenter(webcompany); WebCompanyUser comuser1 = new WebCompanyUser { CompanyUserID = comuer.CompanyUserID, CompanyName = webcompany.CompanyName }; webcomuser.UpdateWebCompanyUserFromCenter(comuser1); return(Json(new { retCode = result }, JsonRequestBehavior.AllowGet)); }
public ActionResult CompanyTuBaDesignerDetail(int companyID, int peopleID) { WebCompany company = webCompanyService.GetWebCompanyByID(companyID); //设计师类型 List <WebLookup> peoplepositionlist = webCommonService.GetLookupList("people_position");//设计级别 WebPeople people = webPeopleService.GetWebPeopleByID(peopleID); ViewBag.people = people; ViewBag.peoplepositionlist = peoplepositionlist; List <WebCase> caselist = webCaseService.GetWebCaseListByPeopleID(peopleID); ViewBag.caselist = caselist; return(View(company)); }
public ActionResult CompanyTuBa(int companyID) { webCompanyService.PageViewAdd(companyID); WebCompany company = webCompanyService.GetWebCompanyByID(companyID); List <WebCase> caselist = webCaseService.GetWebCaseListByCompanyIDAndCount(companyID, 3); List <WebPeople> peoplelist = webPeopleService.GetWebPeopleListByCompanyIDAndCount(companyID, 6); List <WebRecommend> recommodlist = webRecommend.GetWebRecommendByCompany(12, 8, companyID); //List<WebNews> newsList = webNewsService.IndexGetWebNewsListByCompanyID(companyID, modelID); ViewBag.CaseList = caselist; ViewBag.PeopleList = peoplelist; ViewBag.recommodlist = recommodlist; //ViewBag.NewsList = newsList; return(View(company)); }
public int DeleteWebCompany(int companyID) { using (AIYunNetContext context = new AIYunNetContext()) { WebCompany webCompany = context.WebCompany.Find(companyID); if (webCompany != null) { webCompany.FlagDelete = 1; webCompany.DeleteOn = DateTime.Now; context.SaveChanges(); return(1); } else { return(0); } } }
public ActionResult AddOrEditWebPeople(WebPeople webPeople) { int result = 0; WebCompany company = webCompanyService.GetWebCompanyByID(webPeople.CompanyID); if (company != null) { webPeople.CompanyName = company.CompanyName; } if (webPeople != null && webPeople.PeopleID > 0) { result = webPeopleService.UpdateWebPeople(webPeople); } else { result = webPeopleService.AddWebPeople(webPeople); } return(Json(new { RetCode = result }, JsonRequestBehavior.AllowGet)); }
public int UpdateWebCompanyLicence(WebCompany webCompany) { using (AIYunNetContext context = new AIYunNetContext()) { WebCompany originalCompany = context.WebCompany.Find(webCompany.CompanyID); if (originalCompany != null && webCompany != null) { originalCompany.Honor = webCompany.Honor; originalCompany.Certification = webCompany.Certification; originalCompany.CompanyLicence = webCompany.CompanyLicence; originalCompany.EditOn = DateTime.Now; context.SaveChanges(); return(1); } else { return(0); } } }
/// <summary> /// 获取头像根据账户和类型 /// </summary> public string getPhotoUrlthum(string useraccount, string usertype) { string result = ""; using (AIYunNetContext context = new AIYunNetContext()) { if (usertype == "WebUser") { WebUser user = webuserService.GetWebUserByAccount(useraccount); if (user == null) { result = "2"; } else { WebPeople webpeople = webpeopleService.GetWebPeopleByUserID(user.UserID); if (webpeople != null) { result = webpeople.thumbnailImage; } } } else { WebCompanyUser companyuser = webCompanyUserService.GetWebCompanyUserByAccount(useraccount); if (companyuser == null) { result = "2"; } else { WebCompany webcompany = webCompanyService.GetWebCompanyByUserID(companyuser.CompanyUserID); if (webcompany != null) { result = webcompany.thumbnailImage; } } } } return(result); }
public ActionResult DownLoadDetail(int id = 0) { DownLoad model = DownSer.GetDownLoadDetail(id); List <DownLoad> list = DownSer.GetDownLoadList(model.firstID); ViewBag.list = list; if (model.userid != 0) { if (model.usertype == "WebCompanyUser") { WebCompany webCompany = webComSer.GetWebCompanyByUserID(model.userid); ViewBag.webCompany = webCompany; } else if (model.usertype == "WebUser") { WebPeople webpeople = WebPeoSer.GetWebPeopleByUserID(model.userid); ViewBag.webpeople = webpeople; } } return(View(model)); }
public int IsAuthentication(int id) { using (AIYunNetContext context = new AIYunNetContext()) { if (id != 0) { WebCompanyAuthentication origWebCompanyAuthentication = context.WebCompanyAuthentication.Find(id); WebCompany orwebcompany = context.WebCompany.FirstOrDefault(c => c.WebCompanyUserID == origWebCompanyAuthentication.CompanyUserID); if (origWebCompanyAuthentication != null) { origWebCompanyAuthentication.IsAuthentication = 1; orwebcompany.IsAuthentication = true; origWebCompanyAuthentication.EditOn = DateTime.Now; context.SaveChanges(); } } return(1); } }
public int IsGuarantMoney(int id) { using (AIYunNetContext context = new AIYunNetContext()) { if (id != 0) { WebCompanyGuarantMoney origWebCompanyGuarantMoney = context.WebCompanyGuarantMoney.Find(id); WebCompany orwebcom = context.WebCompany.FirstOrDefault(c => c.WebCompanyUserID == origWebCompanyGuarantMoney.CompanyUserID); if (origWebCompanyGuarantMoney != null) { origWebCompanyGuarantMoney.IsGuarantMoney = 1; orwebcom.IsBond = true; origWebCompanyGuarantMoney.EditOn = DateTime.Now; context.SaveChanges(); } } return(1); } }
public int UpdateWebCompanyUser(WebCompanyUser newWebCompanyUser) { using (AIYunNetContext context = new AIYunNetContext()) { WebCompanyUser originalUser = context.WebCompanyUser.Find(newWebCompanyUser.CompanyUserID); WebCompany oriwebcompany = context.WebCompany.FirstOrDefault(c => c.WebCompanyUserID == newWebCompanyUser.CompanyUserID); if (originalUser != null) { originalUser.CompanyName = newWebCompanyUser.CompanyName; originalUser.CompanyPhone = newWebCompanyUser.CompanyPhone; originalUser.IsLock = newWebCompanyUser.IsLock; originalUser.EditOn = DateTime.Now; if (oriwebcompany != null) { oriwebcompany.CompanyName = newWebCompanyUser.CompanyName; oriwebcompany.CompanyMoble = newWebCompanyUser.CompanyPhone; } context.SaveChanges(); } return(1); } }
public ActionResult DecCaseDetail(int CaseID) { webCaseService.PageViewAdd(CaseID); WebCase casse = webCaseService.GetWebCaseByID(CaseID); List <WebCase> caselist = webCaseService.GetWebCaseListByPeopleIDAndCount(casse.PeopleID, 2); ViewBag.caselist = caselist; if (casse.CompanyID != 0) { WebCompany com = webCompanyService.GetWebCompanyByID(casse.CompanyID); ViewBag.com = com; } else { WebPeople peo = webPeopleService.GetWebPeopleByID(casse.PeopleID); ViewBag.peo = peo; } List <PeopleComments> commentList = commentService.GetCommentListByID(CaseID, "WebCase", 100); ViewBag.commentList = commentList; return(View(casse)); }
public int CompanyUserLoginOn(string userAccount, string userPassword) { string password = FormsAuthentication.HashPasswordForStoringInConfigFile(userPassword, "md5"); bool exist = webcomuserser.ExistUser(userAccount, password); if (exist) { WebCompanyUser User = webcomuserser.GetWebCompanyUserByAccount(userAccount, password); WebCompanyUserService webuserservice = new WebCompanyUserService(); WebCompanyService webcompanyeservice = new WebCompanyService(); //userAccount=UserName if (User.IsLock) { //被锁定 return(100); } else { SessionHelper.SetSession("companyUserName", userAccount); WebCompany WebCompany = new WebCompany(); if (webcompanyeservice.IsHaveuser(User.CompanyUserID)) { WebCompany = webcompanyeservice.GetWebCompanyByUserID(User.CompanyUserID); } SessionHelper.SetSession("companyID", WebCompany.CompanyID); SessionHelper.SetSession("CompanyName", User.CompanyName); SessionHelper.SetSession("companyUserID", User.CompanyUserID); //正常 return(200); } } else { //无用户 return(500); } }