Пример #1
0
        //到職缺細項頁面
        // 傳入 職缺PK,執行 [查看職缺細項] 功能
        // 回傳 整筆資料或部分資料(list的JobModel型態)
        public ActionResult toJobDetailView(int JobID)
        {
            SJM.SearchJob sjm     = new SJM.SearchJob();
            JM.JobModel   jmModel = new JM.JobModel();
            jmModel = sjm.jobDetail(JobID);

            return(View("JobDetailView", jmModel));
        }
Пример #2
0
        //到職缺細項頁面
        // 傳入 職缺PK,執行 [查看職缺細項] 功能
        // 回傳 整筆資料或部分資料(list的JobModel型態)

        //for test 12/16

        //public ActionResult toJobDetailView(string jobID)
        public ActionResult toJobDetailView(int jobID)
        {
            SJM.SearchJob sjm     = new SJM.SearchJob();
            JM.JobModel   jmModel = new JM.JobModel();
            string        userID  = "";

            if (Session["suserID"] != null)
            {
                userID = Session["suserID"].ToString();
            }
            jmModel = sjm.jobDetail(jobID, userID);
            //jmModel = sjm.jobDetail(1);

            // 搜尋職缺欄位內容種類
            ViewBag.DWorkType   = sjm.getWorkType();
            ViewBag.DCityName   = sjm.getCityName();
            ViewBag.DCjob_Name1 = sjm.getCjob_Name1();

            return(View("JobDetailView", jmModel));
        }
Пример #3
0
        // 搜尋職缺細項
        public JM.JobModel jobDetail(int jobID, string userID)
        {
            // SQL指令 撈出職缺細項

            #region [做DB連線 以及 執行DB處理]

            // 建立DB連線
            Tools.DBConnection bsc = new Tools.DBConnection();
            #endregion
            // 取出職缺細項

            #region [ 取出職缺細項 ]

            DataTable dt = bsc.ReadDB(
                string.Format(
                    @"SELECT *
                                  FROM [Job] AS J , [Company] AS C , [JobType] AS JT 
                                  WHERE 1=1
                                  AND J.JOB_ID = {0}
                                  AND J.COMP_ID = C.COMP_ID
                                  AND J.CJOB_ID = JT.CJOB_ID"
                    , jobID)
                );

            JM.JobModel jmModel = new JM.JobModel();
            // 將DataTable的資料轉換為model 將職缺細項列出

            jmModel.Job_ID      = Convert.ToInt16(dt.Rows[0][0]);
            jmModel.Occu_Desc   = dt.Rows[0][1].ToString();
            jmModel.Wk_Type     = dt.Rows[0][2].ToString();
            jmModel.Cjob_ID     = Convert.ToInt16(dt.Rows[0][3]);
            jmModel.Cjob_Name1  = dt.Rows[0][18].ToString();
            jmModel.AvailReqNum = Convert.ToInt16(dt.Rows[0][4]);
            jmModel.Stop_Date   = dt.Rows[0][5].ToString();
            jmModel.Job_Detail  = dt.Rows[0][6].ToString();
            jmModel.CityName    = dt.Rows[0][7].ToString();
            jmModel.Experience  = dt.Rows[0][8].ToString();
            jmModel.WkTime      = dt.Rows[0][9].ToString();
            jmModel.SalaryCd    = dt.Rows[0][10].ToString();
            jmModel.EdGrDesc    = dt.Rows[0][11].ToString();
            jmModel.Url_Query   = dt.Rows[0][12].ToString();
            jmModel.Comp_ID     = Convert.ToInt16(dt.Rows[0][13]);
            jmModel.CompName    = dt.Rows[0][16].ToString();
            jmModel.TranDate    = dt.Rows[0][14].ToString();

            if (userID != "")
            {
                DataTable dt1 = bsc.ReadDB(
                    string.Format(
                        @"SELECT JOB_ID
                                  FROM [MyFavorite] 
                                  WHERE 1=1
                                  AND USER_ID = '{0}'
                                  AND JOB_ID = {1}"
                        , userID, jobID)
                    );
                if (dt1.Rows.Count > 0)
                {
                    jmModel.Is_Favorite = 1;
                }
                else
                {
                    jmModel.Is_Favorite = 0;
                }
            }


            #endregion

            return(jmModel);
        }