예제 #1
0
        public ActionResult Details(int id)
        {
            Company cpy = companyService.IncludeFindByCompanyID(id);

            CompanyReg cpr = new CompanyReg()
            {
                Address = cpy.Address,
                BussinessCode = cpy.BussinessCode,
                CityCode = cpy.CityCode,
                CompanyImg = cpy.CompanyImg.ImgUrls,
                Logo = cpy.CompanyLogoImg.FocusImgUrl,
                Description = cpy.Description,
                Fax = cpy.Fax,
                FundCode = cpy.FundCode,
                LinkMan = cpy.LinkMan,
                LinManImg = cpy.LinkManImg.ImgUrls,
                Mobile = cpy.Mobile,
                MSN = cpy.MSN,
                Name = cpy.Name,
                Phone = cpy.Phone,
                Position = cpy.Lat + "|" + cpy.Lng,
                QQ = cpy.QQ,
                ScaleCode = cpy.ScaleCode,
                Sex = cpy.Sex

            };
            return View(cpr);
        }
예제 #2
0
        public Company Update(CompanyReg model)
        {
            var MemberID = Convert.ToInt32(CookieHelper.UID);

            Company company = IncludeFind(MemberID);
            DB_Service.Attach<Company>(company);
            company.LastIP = HttpHelper.IP;
            company.Address = model.Address;
            company.LastTime = DateTime.Now;
            company.BussinessCode = model.BussinessCode;
            company.CityCode = model.CityCode;
            company.Description = model.Description;

            company.Fax = model.Fax;
            company.FundCode = model.FundCode;
            company.Lat = Convert.ToSingle(model.Position.Split('|')[0]);
            company.Lng = Convert.ToSingle(model.Position.Split('|')[1]);
            company.LinkMan = model.LinkMan;

            company.MemberID = MemberID;
            company.Mobile = model.Mobile;
            company.MSN = model.MSN;
            company.Name = model.Name;
            company.Phone = model.Phone;
            company.QQ = model.QQ;
            company.ScaleCode = model.ScaleCode;
            company.Sex = model.Sex;

            company.Status = (int)CompanyStatus.CompanyApply;
            if (company.CompanyImg == null)
            {
                CompanyImg cimg = new CompanyImg()
                {
                    FocusImgUrl = model.CompanyImg.Split(',')[0],
                    ImgUrls = model.CompanyImg,
                    MemberID = MemberID,
                    CompanyID = company.CompanyID
                };
                company.CompanyImg = cimg;
            }
            else
            {
                company.CompanyImg.FocusImgUrl = model.CompanyImg.Split(',')[0];
                company.CompanyImg.ImgUrls = model.CompanyImg;
            }

            if (company.LinkManImg == null)
            {
                LinkManImg limg = new LinkManImg()
                {
                    FocusImgUrl = model.LinManImg.Split(',')[0],
                    ImgUrls = model.LinManImg,
                    MemberID = MemberID,
                    CompanyID = company.CompanyID
                };
                company.LinkManImg = limg;
            }
            else
            {
                company.CompanyImg.FocusImgUrl = model.CompanyImg.Split(',')[0];
                company.CompanyImg.ImgUrls = model.CompanyImg;
            }

            if (company.CompanyLogoImg == null)
            {

                CompanyLogoImg logoimg = new CompanyLogoImg()
                {
                    FocusImgUrl = model.Logo,
                    ImgUrls = model.Logo,
                    CompanyID = company.CompanyID,
                    MemberID = MemberID
                };

                company.CompanyLogoImg = logoimg;
            }
            else
            {
                company.CompanyLogoImg.FocusImgUrl = model.Logo;
                company.CompanyLogoImg.ImgUrls = model.Logo;
            }

            DB_Service.Commit();

            return company;
        }
예제 #3
0
        public ActionResult RegBiz(RegBizModel model)
        {
            if (ModelState.IsValid)
            {
                #region 注册用户并登录
                try
                {
                    RegisterModel rm = new RegisterModel()
                    {
                        Email = model.Email,
                        NickName = model.NickName,
                        Password = model.Password
                    };

                    Member mb = memberService.Create(rm);

                    memberService.SetLoginCookie(mb);

                    ProfileModel pm = new ProfileModel()
                    {
                        CityCode = model.CityCode,
                        Borthday = DateTime.Now,
                        NickName = mb.NickName,
                        RealName = model.LinkMan,
                        Sex = model.Sex
                    };

                    memberService.SaveMemberBaseInfo(mb.MemberID, pm);

                    ContactModel cm = new ContactModel()
                    {
                        Address = model.Address,
                        Email = model.Email,
                        Mobile = model.Mobile,
                        Phone = model.Phone,
                        Position = model.Position
                    };

                    memberService.SaveMemberContact(mb.MemberID, cm);

                    CompanyReg cr = new CompanyReg()
                    {
                        Address = model.Address,
                        BussinessCode = model.BussinessCode,
                        CityCode = model.CityCode,
                        Description = model.Description,
                        FundCode = model.FundCode,
                        LinkMan = model.LinkMan,
                        Mobile = model.Mobile,
                        Name = model.Name,
                        Phone = model.Phone,
                        Position = model.Position,
                        ScaleCode = model.ScaleCode,
                        Sex = model.Sex
                    };

                    companyService.SaveBasInfo(mb.MemberID, cr);

                    member_MoneySerivce.AddMoney(mb.MemberID, 4, "0006");

                    //memberService.SetLoginCookie(mb);
                    return Redirect(Url.Action("regauth"));

                }
                catch (Exception ex)
                {
                    throw ex;
                }
                #endregion
            }
            else
            {
                return View(model);
            }
        }
예제 #4
0
        public Company SaveBasInfo(int MemberID, CompanyReg model)
        {
            Company company = new Company();
            company.AddIP = HttpHelper.IP;
            company.Address = model.Address;
            company.AddTime = DateTime.Now;
            company.BussinessCode = model.BussinessCode;
            company.CityCode = model.CityCode;
            company.Description = model.Description;

            company.Fax = model.Fax;
            company.FundCode = model.FundCode;
            company.LastIP = HttpHelper.IP;
            company.LastTime = DateTime.Now;
            company.Lat = Convert.ToSingle(model.Position.Split('|')[0]);
            company.Lng = Convert.ToSingle(model.Position.Split('|')[1]);
            company.LinkMan = model.LinkMan;

            company.MemberID = MemberID;
            company.Mobile = model.Mobile;
            company.MSN = model.MSN;
            company.Name = model.Name;
            company.Phone = model.Phone;
            company.QQ = model.QQ;
            company.ScaleCode = model.ScaleCode;
            company.Sex = model.Sex;

            DB_Service.Add<Company>(company);
            DB_Service.Commit();

            return company;
        }
예제 #5
0
        public ActionResult OpenBiz(OpenBizModel model)
        {
            if (ModelState.IsValid)
            {
                #region 企业入驻
                try
                {
                    Member member = memberService.Find(CookieHelper.MemberID);

                    if (member.Status < (int)MemberStatus.EmailActived)
                    {
                        return Content("<script>alert('您的邮箱还未绑定,请先绑定邮箱再进行企业认证!');window.top.location='" + Url.Action("activeemail") + "';</script>");
                    }
                    else
                    {
                        if (member.Status >= (int)MemberStatus.CompanyAuth)
                        {
                            return Content("<script>alert('您的企业已经认证通过了!');window.top.location='" + Url.Action("index", "personal") + "';</script>");
                        }
                        else
                        {
                            var company = companyService.IncludeFind(member.MemberID);

                            if (company == null)
                            {
                                CompanyReg reg = new CompanyReg()
                                {
                                    Address = model.Address,
                                    BussinessCode = model.BussinessCode,
                                    CityCode = model.CityCode,
                                    Description = model.Description,
                                    FundCode = model.FundCode,
                                    LinkMan = model.LinkMan,
                                    Mobile = model.Mobile,
                                    Name = model.Name,
                                    Phone = model.Phone,
                                    Position = model.Position,
                                    ScaleCode = model.ScaleCode,
                                    Sex = model.Sex,
                                    CompanyImg = model.CompanyImg,
                                    LinManImg = model.LinManImg,
                                    Logo = model.Logo
                                };
                                companyService.Create(reg);
                            }
                            else
                            {
                                CompanyReg reg = new CompanyReg()
                                {
                                    Address = model.Address,
                                    BussinessCode = model.BussinessCode,
                                    CityCode = model.CityCode,
                                    Description = model.Description,
                                    FundCode = model.FundCode,
                                    LinkMan = model.LinkMan,
                                    Mobile = model.Mobile,
                                    Name = model.Name,
                                    Phone = model.Phone,
                                    Position = model.Position,
                                    ScaleCode = model.ScaleCode,
                                    Sex = model.Sex,
                                    CompanyImg = model.CompanyImg,
                                    LinManImg = model.LinManImg,
                                    Logo = model.Logo,
                                    Fax = company.Fax,
                                    MSN = company.MSN,
                                    QQ = company.QQ
                                };

                                companyService.Update(reg);
                            }
                        }
                    }

                    //memberService.SetLoginCookie(mb);
                    return Redirect(Url.Action("bizOk"));

                }
                catch (Exception ex)
                {
                    throw ex;
                }

                #endregion
            }
            else
            {
                return View(model);
            }
        }