Esempio n. 1
0
        public IEnumerable <insert_Step_One> Back_Two_To_One(RetName item)
        {
            //string strSQL = "SELECT POSITION,FULLNAME_TH FROM STEP_ONE";
            List <insert_Step_One> results = new List <insert_Step_One>();

            try
            {
                using (Hr_RegisterDataContext bx = new Hr_RegisterDataContext())
                {
                    var str = (from xx in bx.STEP_ONEs
                               where xx.USERNO == item.USERNO
                               select xx).FirstOrDefault();

                    insert_Step_One res = new insert_Step_One();

                    res._USERNO         = str.USERNO;
                    res._POSITION       = str.POSITION;
                    res._FULLNAME_TH    = str.FULLNAME_TH;
                    res._NICKNAME_TH    = str.NICKNAME_TH;
                    res._FULLNAME_EN    = str.FULLNAME_EN;
                    res._NICKNAME_EN    = str.NICKNAME_EN;
                    res._PEOPLEID       = str.PEOPLEID;
                    res._ZONE           = str.ZONE;
                    res._PROVINCE_BIRTH = str.PROVINCE_BIRTH;
                    res._BIRTHDATE      = DateTime.Parse(str.BIRTHDATE.ToString());
                    res._AGE            = str.AGE;
                    res._WEIGHT         = str.WEIGHT;
                    res._HEIGHT         = str.HEIGHT;
                    res._ADDR_ROW1      = str.ADDR_ROW1;
                    res._ADDR_ROW2      = str.ADDR_ROW2;
                    res._ADDR_ROW3      = str.ADDR_ROW3;
                    res._ADDR_HOME1     = str.ADDR_HOME1;
                    res._ADDR_HOME2     = str.ADDR_HOME2;
                    res._ADDR_HOME3     = str.ADDR_HOME3;
                    res._ADDR_TEL       = str.ADDR_TEL;
                    res._ADDR_MOBILE    = str.ADDR_MOBILE;
                    res._ADDR_EMAIL     = str.ADDR_EMAIL;
                    res._ADDR_PHOTO     = str.ADDR_PHOTO;
                    //res._WORKDATE = DateTime.Now.AddYears(543);
                    res._FLAG = 0;
                    results.Add(res);
                }
            }
            catch (Exception ex)
            {
                insert_Step_One res = new insert_Step_One();
                res._USERNO = ex.Message;
                //results.Add(res);
            }

            return(results.ToArray());
        }
Esempio n. 2
0
        public IEnumerable <RetName> Regis_Step_Two(insert_Step_Two item)
        {
            List <RetName> results = new List <RetName>();

            try
            {
                using (Hr_RegisterDataContext bx = new Hr_RegisterDataContext())
                {
                    var str = (from xx in bx.STEP_TWOs
                               where xx.USERNO == item.USERNO
                               select xx).FirstOrDefault();

                    string USERNO;
                    int    Status;
                    if (str == null)
                    {
                        USERNO = InsertData_Two(item);
                        Status = 1;
                    }
                    else
                    {
                        USERNO = UpdateData_Two(item);
                        USERNO = InsertData_Two(item);
                        Status = 2;
                    }

                    RetName res = new RetName();
                    res.status = "S";
                    if (Status == 1)
                    {
                        res.message = "Insert success";
                    }
                    else if (Status == 2)
                    {
                        res.message = "Update success";
                    }
                    res.USERNO = USERNO;
                    results.Add(res);
                }
            }
            catch (Exception ex)
            {
                RetName res = new RetName();
                res.status  = "F";
                res.message = ex.Message;
                results.Add(res);
            }

            return(results.ToArray());
        }
Esempio n. 3
0
        public IEnumerable <RetName> Update_Summary(ViewSummary item)
        {
            List <RetName> results = new List <RetName>();

            try
            {
                string USERNO;
                //int Status;
                //if (item._USERNO == null)
                //{
                InsertData_One(item.Step_One);
                InsertData_Two(item.Step_Two);
                //InsertData_Three(item.Step_Three);
                //InsertData_Four(item.Step_Four);
                //InsertData_One(item.Step_One);
                //InsertData_One(item.Step_One);
                //InsertData_One(item.Step_One);
                //    Status = 1;
                //}
                //else
                //{
                //    USERNO = UpdateData_One(item);
                //    Status = 2;
                //}

                RetName res = new RetName();
                res.status = "S";
                //if (Status == 1)
                //{
                res.message = "Insert success";
                //}
                //else if (Status == 2)
                //{
                //    res.message = "Update success";
                //}
                //res.USERNO = USERNO;
                results.Add(res);
            }
            catch (Exception ex)
            {
                RetName res = new RetName();
                res.status  = "F";
                res.message = ex.Message;
                results.Add(res);
            }

            return(results.ToArray());
        }
Esempio n. 4
0
        public IEnumerable <RetName> Regis_Step_One(insert_Step_One item)
        {
            List <RetName> results = new List <RetName>();

            try
            {
                string USERNO;
                int    Status;
                if (item._USERNO == null)
                {
                    USERNO = InsertData_One(item);
                    Status = 1;
                }
                else
                {
                    USERNO = UpdateData_One(item);
                    USERNO = InsertData_One(item);
                    Status = 2;
                }

                RetName res = new RetName();
                res.status = "S";
                if (Status == 1)
                {
                    res.message = "Insert success";
                }
                else if (Status == 2)
                {
                    res.message = "Update success";
                }
                res.USERNO = USERNO;
                results.Add(res);
            }
            catch (Exception ex)
            {
                RetName res = new RetName();
                res.status  = "F";
                res.message = ex.Message;
                results.Add(res);
            }

            return(results.ToArray());
        }
Esempio n. 5
0
        public IEnumerable <insert_Step_Two> Back_Three_To_Two(RetName item)
        {
            //string strSQL = "SELECT POSITION,FULLNAME_TH FROM STEP_ONE";
            List <insert_Step_Two> results = new List <insert_Step_Two>();

            try
            {
                using (Hr_RegisterDataContext bx = new Hr_RegisterDataContext())
                {
                    var str = (from xx in bx.STEP_TWOs
                               where xx.USERNO == item.USERNO
                               select xx).FirstOrDefault();

                    insert_Step_Two res = new insert_Step_Two();

                    res.USERNO                 = str.USERNO;
                    res.MARITAL                = str.MARITAL;
                    res.CHILDEN                = str.CHILDEN;
                    res.SPOUSE_NAME            = str.SPOUSE_NAME;
                    res.SPOUSE_AGE             = str.SPOUSE_AGE;
                    res.SPOUSE_OCCUPATION      = str.SPOUSE_OCCUPATION;
                    res.SPOUSE_OFFICE          = str.SPOUSE_OFFICE;
                    res.SPOUSE_PHONE           = str.SPOUSE_PHONE;
                    res.EMERGENCY              = str.EMERGENCY;
                    res.EMERGENCY_ROW1         = str.EMERGENCY_ROW1;
                    res.EMERGENCY_ROW2         = str.EMERGENCY_ROW2;
                    res.EMERGENCY_RELATIONSHIP = str.EMERGENCY_RELATIONSHIP;
                    res.EMERGENCY_PHONE        = str.EMERGENCY_PHONE;
                    //res._WORKDATE = DateTime.Now.AddYears(543);
                    results.Add(res);
                }
            }
            catch (Exception ex)
            {
                insert_Step_One res = new insert_Step_One();
                res._USERNO = ex.Message;
                //results.Add(res);
            }

            return(results.ToArray());
        }
Esempio n. 6
0
        public IEnumerable <ViewSummary> Summary(RetName item)
        {
            List <ViewSummary> results = new List <ViewSummary>();
            ViewSummary        summary = new ViewSummary();
            string             USERNO  = item.USERNO;

            //List<insert_Step_One> One = new List<insert_Step_One>();
            try
            {
                using (Hr_RegisterDataContext bx = new Hr_RegisterDataContext())
                {
                    var str_one = (from xx in bx.STEP_ONEs
                                   where xx.USERNO == USERNO
                                   select xx).FirstOrDefault();

                    insert_Step_One res_one = new insert_Step_One();

                    res_one._USERNO         = str_one.USERNO;
                    res_one._POSITION       = str_one.POSITION;
                    res_one._FULLNAME_TH    = str_one.FULLNAME_TH;
                    res_one._NICKNAME_TH    = str_one.NICKNAME_TH;
                    res_one._FULLNAME_EN    = str_one.FULLNAME_EN;
                    res_one._NICKNAME_EN    = str_one.NICKNAME_EN;
                    res_one._PEOPLEID       = str_one.PEOPLEID;
                    res_one._ZONE           = str_one.ZONE;
                    res_one._PROVINCE_BIRTH = str_one.PROVINCE_BIRTH;
                    res_one._BIRTHDATE      = DateTime.Parse(str_one.BIRTHDATE.ToString());
                    res_one._AGE            = str_one.AGE;
                    res_one._WEIGHT         = str_one.WEIGHT;
                    res_one._HEIGHT         = str_one.HEIGHT;
                    res_one._ADDR_ROW1      = str_one.ADDR_ROW1;
                    res_one._ADDR_ROW2      = str_one.ADDR_ROW2;
                    res_one._ADDR_ROW3      = str_one.ADDR_ROW3;
                    res_one._ADDR_HOME1     = str_one.ADDR_HOME1;
                    res_one._ADDR_HOME2     = str_one.ADDR_HOME2;
                    res_one._ADDR_HOME3     = str_one.ADDR_HOME3;
                    res_one._ADDR_TEL       = str_one.ADDR_TEL;
                    res_one._ADDR_MOBILE    = str_one.ADDR_MOBILE;
                    res_one._ADDR_EMAIL     = str_one.ADDR_EMAIL;
                    res_one._ADDR_PHOTO     = str_one.ADDR_PHOTO;

                    summary.Step_One = res_one;

                    //-------------------------------------------------------------------------------------------------

                    var str_two = (from xx in bx.STEP_TWOs
                                   where xx.USERNO == USERNO
                                   select xx).FirstOrDefault();

                    insert_Step_Two res_two = new insert_Step_Two();

                    res_two.USERNO                 = str_two.USERNO;
                    res_two.STARTING_DATE          = DateTime.Parse(str_two.STARTING_DATE.ToString());
                    res_two.MARITAL                = str_two.MARITAL;
                    res_two.CHILDEN                = str_two.CHILDEN;
                    res_two.SPOUSE_NAME            = str_two.SPOUSE_NAME;
                    res_two.SPOUSE_AGE             = str_two.SPOUSE_AGE;
                    res_two.SPOUSE_OCCUPATION      = str_two.SPOUSE_OCCUPATION;
                    res_two.SPOUSE_OFFICE          = str_two.SPOUSE_OFFICE;
                    res_two.SPOUSE_PHONE           = str_two.SPOUSE_PHONE;
                    res_two.EMERGENCY              = str_two.EMERGENCY;
                    res_two.EMERGENCY_ROW1         = str_two.EMERGENCY_ROW1;
                    res_two.EMERGENCY_ROW2         = str_two.EMERGENCY_ROW2;
                    res_two.EMERGENCY_RELATIONSHIP = str_two.EMERGENCY_RELATIONSHIP;
                    res_two.EMERGENCY_PHONE        = str_two.EMERGENCY_PHONE;

                    summary.Step_Two = res_two;

                    //-------------------------------------------------------------------------------------------------

                    var str_three_detail = (from xx in bx.STEP_THREE_DETAILs
                                            where xx.USERNO == USERNO
                                            select xx).FirstOrDefault();

                    Step_Three_DETAIL res_three_detail = new Step_Three_DETAIL();

                    res_three_detail.CURRENTLY_STUDY = str_three_detail.CURRENTLY_STUDY;
                    res_three_detail.STUDY_NAME      = str_three_detail.STUDY_NAME;
                    res_three_detail.STUDY_MAJOR     = str_three_detail.STUDY_MAJOR;
                    res_three_detail.HOBBY_ROW1      = str_three_detail.HOBBY_ROW1;
                    res_three_detail.HOBBY_ROW2      = str_three_detail.HOBBY_ROW2;
                    res_three_detail.HOBBY_ROW3      = str_three_detail.HOBBY_ROW3;
                    res_three_detail.HOBBY_ROW4      = str_three_detail.HOBBY_ROW4;

                    summary.Detail = res_three_detail;

                    //-------------------------------------------------------------------------------------------------

                    var str_three_eduction = (from xx in bx.STEP_THREE_EDUCTIONs
                                              where xx.USERNO == USERNO
                                              select xx);

                    List <Step_Three_EDUCTION> res_three_Eduction = new List <Step_Three_EDUCTION>();

                    foreach (var item_Edu in str_three_eduction)
                    {
                        Step_Three_EDUCTION Eduction = new Step_Three_EDUCTION();

                        Eduction.EDUCATION_LV   = item_Edu.EDUCATION_LV;
                        Eduction.EDUCATION_NAME = item_Edu.EDUCATION_NAME;
                        Eduction.DEGREE         = item_Edu.DEGREE;
                        Eduction.S_YEAR         = item_Edu.S_YEAR;
                        Eduction.E_YEAR         = item_Edu.E_YEAR;
                        Eduction.GPA            = decimal.Parse(item_Edu.GPA.ToString());
                        Eduction.MAJOR          = item_Edu.MAJOR;

                        res_three_Eduction.Add(Eduction);
                    }

                    summary.Eduction = res_three_Eduction;

                    //-------------------------------------------------------------------------------------------------

                    var str_three_employment = (from xx in bx.STEP_THREE_EMPLOYMENTs
                                                where xx.USERNO == USERNO
                                                select xx);

                    List <Step_Three_EMPLOYMENT> res_three_Employment = new List <Step_Three_EMPLOYMENT>();

                    foreach (var item_Emp in str_three_employment)
                    {
                        Step_Three_EMPLOYMENT Employment = new Step_Three_EMPLOYMENT();

                        Employment.COMPANY_NAME = item_Emp.COMPANY_NAME;
                        Employment.S_DATE       = item_Emp.S_DATE;
                        Employment.E_DATE       = item_Emp.E_DATE;
                        Employment.POSITION     = item_Emp.POSITION;
                        Employment.SALARY       = item_Emp.SALARY;
                        Employment.DETAIL       = item_Emp.DETAIL;
                        Employment.LEAVING      = item_Emp.LEAVING;

                        res_three_Employment.Add(Employment);
                    }

                    summary.Employment = res_three_Employment;

                    //-------------------------------------------------------------------------------------------------

                    var str_three_language = (from xx in bx.STEP_THREE_LANGUAGEs
                                              where xx.USERNO == USERNO
                                              select xx);

                    List <Step_Three_LANGUAGE> res_three_Language = new List <Step_Three_LANGUAGE>();

                    foreach (var item_lan in str_three_language)
                    {
                        Step_Three_LANGUAGE Language = new Step_Three_LANGUAGE();

                        Language.LANGUAGE = item_lan.LANGUAGE;
                        Language.SPEAKING = item_lan.SPEAKING;
                        Language.READING  = item_lan.READING;
                        Language.WRITING  = item_lan.WRITING;

                        res_three_Language.Add(Language);
                    }

                    summary.Language = res_three_Language;

                    //-------------------------------------------------------------------------------------------------

                    var str_three_training = (from xx in bx.STEP_THREE_TRAININGs
                                              where xx.USERNO == USERNO
                                              select xx);

                    List <Step_Three_TRAINING> res_three_Training = new List <Step_Three_TRAINING>();

                    foreach (var item_Tra in str_three_training)
                    {
                        Step_Three_TRAINING Training = new Step_Three_TRAINING();

                        Training.DATE        = DateTime.Parse(item_Tra.DATE.ToString());
                        Training.COURSE      = item_Tra.COURSE;
                        Training.INSTITUTION = item_Tra.INSTITUTION;
                        Training.S_DATE      = DateTime.Parse(item_Tra.S_DATE.ToString());
                        Training.E_DATE      = DateTime.Parse(item_Tra.E_DATE.ToString());

                        res_three_Training.Add(Training);
                    }

                    summary.Training = res_three_Training;

                    //-------------------------------------------------------------------------------------------------

                    var str_four = (from xx in bx.STEP_FOURs
                                    where xx.USERNO == USERNO
                                    select xx);

                    List <Step_Four> res_four = new List <Step_Four>();

                    foreach (var item_Four in str_four)
                    {
                        Step_Four Four = new Step_Four();

                        Four.Q_ID        = item_Four.Q_ID;
                        Four.CHOOSE      = item_Four.CHOOSE;
                        Four.DETAIL_ROW1 = item_Four.DETAIL_ROW1;
                        Four.DETAIL_ROW2 = item_Four.DETAIL_ROW2;
                        Four.DETAIL_ROW3 = item_Four.DETAIL_ROW3;

                        res_four.Add(Four);
                    }

                    summary.Step_Four = res_four;

                    //-------------------------------------------------------------------------------------------------

                    results.Add(summary);
                }
            }
            catch (Exception ex)
            {
                insert_Step_One res = new insert_Step_One();
                res._USERNO = ex.Message;
                //results.Add(res);
            }

            return(results.ToArray());
        }