Beispiel #1
0
        public DeluxeJsonResult StartStudentNewSurvey(string stuNo)
        {
            AbstractFormModel <SurveyModel> result = SurveyDal.Instance.StartNewSurvey();

            result.Form.Type = (int)SurveyType.Student;
            HPITMemberInfo currentUser = DeluxeUser.CurrentMember;

            result.CurrentRole = DeluxeUser.CurrentMember;
            if (currentUser.FullName == "项目组组长" || currentUser.FullName == "技术主管" || currentUser.FullName == "项目主管" || currentUser.FullName == "人事主管")
            {
                result.CurrentRole.FullName = "学生";
            }
            //根据学生编号创建新的
            List <EvalStudent> matchList = EvaluteDal.Instance.GetMatchStudent(currentUser.RealName, "");

            if (matchList.Count == 1)
            {
                EvalStudent match = matchList.FirstOrDefault();
                result.Form.ProjectName = match.pName;
                result.Form.StudentNo   = match.StudentNo;
                result.Form.StuName     = match.Name;
                result.Form.Phone       = match.Mobile;
                result.Form.Direction   = match.mName;
                result.Form.Year        = match.bYear;
                result.Form.School      = match.GraduateSchool;
                result.Form.Batch       = match.bName;
                result.Form.PRM         = match.PRM;
                result.Form.PEM         = match.PEM;
            }
            return(new DeluxeJsonResult(result));
        }
Beispiel #2
0
        public DeluxeJsonResult StartUserNewSurvey()
        {
            AbstractFormModel <SurveyModel> result = SurveyDal.Instance.StartNewSurvey();

            result.Form.Type   = (int)SurveyType.User;
            result.CurrentRole = DeluxeUser.CurrentMember;
            return(new DeluxeJsonResult(result));
        }
Beispiel #3
0
        public AbstractFormModel <SurveyModel> QueryByID(int id)
        {
            var survey = context.SurveyModel.Where(r => r.SurveyID == id).FirstOrDefault();
            AbstractFormModel <SurveyModel> model = new AbstractFormModel <SurveyModel>();

            model.Form       = survey;
            model.ExtraDatas = GetExtraDatas();
            return(model);
        }
Beispiel #4
0
        public AbstractFormModel <SurveyModel> StartNewSurvey()
        {
            SurveyContext context = new SurveyContext();
            AbstractFormModel <SurveyModel> model = new AbstractFormModel <SurveyModel>();

            model.Form         = new SurveyModel();
            model.Form.Company = new Company();
            model.ExtraDatas   = GetExtraDatas();
            return(model);
        }
Beispiel #5
0
        public void TestMethod1()
        {
            SurveyModel survey = new SurveyModel();

            survey.StuName          = "调查学生11-29";
            survey.WagesOfFull      = 123;
            survey.WagesOfPeriod    = 321;
            survey.WagesOfReal      = 333;
            survey.SurveyTickNumber = "123456";
            List <Position> posts = new List <Position>();

            posts.Add(new Position()
            {
                PositionID = Guid.NewGuid().ToString(), PositionType = "NET初级工程师", PositionDesc = ".NET工程师", PositionName = "NET工程师"
            });
            posts.Add(new Position()
            {
                PositionID = Guid.NewGuid().ToString(), PositionType = "NET高级工程师", PositionDesc = ".NET工程师2", PositionName = "NET工程师2"
            });
            survey.Position = posts;
            List <ActiveJobs> activeJobs = new List <ActiveJobs>();

            activeJobs.Add(new ActiveJobs()
            {
                PositionID = posts[0].PositionID, EndTime = DateTime.Now, StartTime = DateTime.Now, JobDesc = "NET初级工程师", JobName = "2工程师", JobType = "2NET"
            });
            activeJobs.Add(new ActiveJobs()
            {
                PositionID = posts[1].PositionID, EndTime = DateTime.Now, StartTime = DateTime.Now, JobDesc = "NET高级工程师", JobName = "工程师", JobType = "NET"
            });
            survey.ActiveJobs = activeJobs;
            List <Project> projects = new List <Project>();

            projects.Add(new Project()
            {
                BeginTime = DateTime.Now, EndTime = DateTime.Now, ProjectDesc = "第一个项目", ProjectName = "物流管理系统", ProjectType = "物流", ProjectTypeID = 1
            });
            projects.Add(new Project()
            {
                BeginTime = DateTime.Now, EndTime = DateTime.Now, ProjectDesc = "2第一个项目", ProjectName = "物流管理系统2", ProjectType = "物流2", ProjectTypeID = 1
            });
            survey.Project             = projects;
            survey.CompanyNo           = "114105022468253";
            survey.Company.CompanyDesc = "这是公司描述";
            survey.Company.CompanyType = "计算机互联网";
            survey.Company.CompanyName = "腾讯";
            survey.Company.City        = "深圳";
            survey.Year         = 2019;
            survey.CreateTime   = DateTime.Now;
            survey.Direction    = "Net";
            survey.Batch        = "Net190901";
            survey.ProjectName  = "Net项目部";
            survey.Phone        = "17700611332";
            survey.CorworkPhone = "18813048831";
            survey.Status       = (int)SurveyStatus.draft;
            //survey.Student = new Student() { Batch="NET190901", Address ="中兴", City="郑州", Phone = "17700611332", StuName = "王瑞祥"  , Year = 2019 }
            SurveyDal.Instance.Create(survey);
            AbstractFormModel <SurveyModel> model = new AbstractFormModel <SurveyModel>();

            model.Form = survey;

            string result = JsonConvert.SerializeObject(model);
        }