Esempio n. 1
0
        public JsonResult GetJobList()
        {
            var list = JobListDBOperate.GetPublishList();
            var res  = list.Where(a => a.IsParent == 0).ToList();

            foreach (var item in res)
            {
                var child = list.Where(a => a.IsParent == item.Id).ToList();
                if (child != null && child.Count() > 0)
                {
                    item.List = child;
                }
                else
                {
                    item.List = new List <JobList>();
                }
            }
            return(Json(res));
        }
Esempio n. 2
0
        public JsonResult AddProject(ProjectRegister account)
        {
            ResultInfo info        = new ResultInfo();
            int        companyId   = CommonMethod.GetInt(ConfigSetting.eeeYoooId);
            string     companyName = ConfigSetting.eeeYoooName;

            account.PassWord = CommonMethod.PasswordMD5(account.PassWord);
            if (AccountDBOperate.GetAccountByMobile(account.Telephone, account.Role))
            {
                info.Message = "手机号已注册";
                return(Json(info));
            }
            if (AccountDBOperate.GetAccountByEmail(account.Email, account.Role))
            {
                info.Message = "邮箱已注册";
                return(Json(info));
            }
            var list = new List <PersonSetting>()
            {
            };
            var roles   = account.RoleId.Split(',');
            var joblist = JobListDBOperate.GetPublishList();

            foreach (var item in roles)
            {
                var job = joblist.FirstOrDefault(a => a.Id == Convert.ToInt32(item));
                if (job == null)
                {
                    continue;
                }
                var personSetting = new PersonSetting()
                {
                    CreateBy = account.Name, DepartId = Convert.ToInt32(item), DepartName = job.Name, Discount = 100, Month = account.Month, Price = job.Price, TotalPrice = job.Price * account.Month
                };
                list.Add(personSetting);
            }


            info.IsSuccess = AccountDBOperate.AddAccount(new Dto.CustomerCompany()
            {
                CompanyId     = companyId,
                CompanyName   = companyName,
                Address       = account.CompanyAddress,
                City          = account.City,
                Infos         = account.CompanyInfo,
                Name          = account.CompanyName,
                Status        = CustomerCompanyStatusEnum.NotStart.ToString(),
                CreateBy      = account.Name,
                TeamDesc      = account.TeamDesc,
                CompanyStatus = account.CompanyStatus,
                PartInfo      = account.PartInfo
            }, new CustomerMember()
            {
                CompanyId   = companyId,
                CompanyName = companyName,
                Email       = account.Email,
                Mobile      = account.Telephone,
                Name        = account.Name,
                CreateBy    = account.Name,
                Address     = account.MemberAddress
            }, new Account()
            {
                AccountName = account.Name,
                Mobile      = account.Telephone,
                Password    = account.PassWord,
                Email       = account.Email,
                Role        = account.Role,
                CreateBy    = account.Name,
            }, new ProjectManage()
            {
                CompanyId      = companyId,
                FullName       = account.ProjectName,
                Name           = account.ProjectName,
                CusCompanyName = account.CompanyName,
                CusMemberName  = account.Name,
                //LastPayDate = account.EndTime,
                Infos     = account.Info,
                IsDeleted = 0,
                Money     = 0,
                PayWay    = ProjectPayWayEnum.UnKnown.ToString(),
                //RelStartTime = account.StartTime,
                //StartTime = account.StartTime,
                EndTime = account.EndTime,
                Source  = SourceEnum.PC.ToString(),
                //RelEndTime = account.EndTime,
                Status         = CustomerCompanyStatusEnum.NotStart.ToString(),
                OpereateType   = account.OpereateType,
                DevLanguate    = account.DevLanguate,
                DevType        = account.DevType,
                NowStatus      = account.NowStatus,
                MarketProspect = account.MarketProspect,
                Month          = account.Month
            }, new HardWare()
            {
                CreateBy = account.Name,
                Infos    = account.HardWare
            }, list);
            //AccountDBOperate.LoginByMobileOrEmail(account.Telephone);
            return(Json(info));
        }