日期:2014-05-16  浏览次数:20424 次

我知道肯定有更聪明的方法,不可能是这么笨的方法(实例化一个类)

 private StaffBasicInfo createStaffBasicInfo()
    {
        //籍贯编号
        int HometownID = -1;
        //政治面貌编号
        int PoliticalLandscapeID = -1;
        //是否已婚
        bool MaritalStatus = false;
        //民族编号
        int NationID=-1;
        //专业编号
        int SpecialtyID = -1;
        //学历编号
        int EducationalBackgroundID = -1;
        //部门编号
        int DepartmentID = -1;
        //试用是否通过
        bool WhetherThroughTrial = false;
        //岗位编号
        int PostID = -1;
        //职级编号
        int QuartersLevelID = -1;
        //工作地区编号
        int WorkplaceID = -1;
        //用工形式编号
        int EmploymentFormsID = -1;
        
        int.TryParse(Content.Request["selectHometown_EH"], out HometownID);
        int.TryParse(Content.Request["selectPolitical_EH"], out PoliticalLandscapeID);
        int.TryParse(Content.Request["selectNation_EH"], out NationID);
        int.TryParse(Content.Request["selectSpecialty_EH"], out SpecialtyID);
        int.TryParse(Content.Request["selectEducationalBackground_EH"], out EducationalBackgroundID);
        int.TryParse(Content.Request["selectDepartment_EH"], out DepartmentID);
        int.TryParse(Content.Request["selectPost_EH"], out PostID);
        int.TryParse(Content.Request["selectQuartersLevel_EH"], out QuartersLevelID);
        int.TryParse(Content.Request["selectWorkplace_EH"], out WorkplaceID);
        int.TryParse(Content.Request["selectEmploymentForms_EH"], out EmploymentFormsID);

        bool.TryParse(Content.Request["selectMaritalStatus_EH"], out MaritalStatus);
        bool.TryParse(Content.Request["selectWhetherThroughTrial_EH"], out WhetherThroughTrial);

        StaffBasicInfo staffBasic = new StaffBasicInfo
        {
        &nbs