/// <summary>
        /// Description : Extra information
        /// Written By : Danbi Seo
        /// Date Written : 2016.06.24
        ///
        /// </summary>
        /// <returns></returns>
        public PartialViewResult AddInfo(EmpInfoEnt ent)
        {
            ViewBag.ent = ent;
            switch (ent.pTabDvs)
            {
            case "tot":
                ViewBag.dtInd  = data.GetIndRsltList(ent);
                ViewBag.dtEve  = data.GetEvltList(ent);
                ViewBag.dtExam = data.GetExamList(ent);
                break;

            case "exam":
                ViewBag.dt = data.GetExamList(ent);
                break;

            case "eve":
                ViewBag.dt = data.GetEvltList(ent);
                break;

            case "cnsl":
                ViewBag.dt = data.GetCnslList(ent);
                break;

            case "prs":
                ViewBag.dt = data.GetPrsList(ent);
                break;

            default:
                break;
            }
            return(PartialView());
        }
        /// <summary>
        /// Description : Delete History of employee
        /// Written By : Danbi Seo
        /// Date Written : 2016.03.22
        ///
        /// </summary>
        /// <param name="ent"></param>
        /// <returns></returns>
        public ActionResult Delete(EmpInfoEnt ent)
        {
            ComnData cd   = new ComnData();
            RsltEnt  rslt = cd.Update(ent, "D", "EmpInfo.DelEmp");

            return(Json(rslt));
        }
        /// <summary>
        /// Description : Partial view
        /// Written By : Danbi Seo
        /// Date Written : 2016.01.58
        ///
        /// </summary>
        /// <param name="ent"></param>
        /// <returns></returns>
        public ActionResult Detail_Content(EmpInfoEnt ent)
        {
            ViewBag.ent = ent;
            ViewBag.dr  = data.EmpDetail(ent);

            return(PartialView());
        }
        /// <summary>
        /// Description : History of employee information
        /// Written By : Danbi Seo
        /// Date Written : 2016.01.23
        ///
        /// </summary>
        /// <param name="ent"></param>
        /// <returns></returns>
        public ActionResult HstList(EmpInfoEnt ent)
        {
            ViewBag.ent = ent;
            ViewBag.dt  = data.GetHstList(ent);

            return(PartialView());
        }
        /// <summary>
        /// Description : Details of employees
        /// Written By : Danbi Seo
        /// Date Written : 2016.01.20
        ///
        /// </summary>
        /// <param name="ent"></param>
        /// <returns></returns>
        public ActionResult Detail(EmpInfoEnt ent)
        {
            ViewBag.ent     = ent;
            ViewBag.empList = data.GetEmpList(ent);
            ViewBag.drVct   = data.GetVctInfo(ent);

            return(View());
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Description : Max seq of compliment history
 /// Written By : Danbi Seo
 /// Date Written : 2016.06.25
 ///
 /// </summary>
 /// <param name="ent"></param>
 /// <returns></returns>
 public int GetMaxPrsSeq(EmpInfoEnt ent)
 {
     try
     {
         return(Convert.ToInt32(mapper.QueryForObject("EmpInfo.SelMaxPrsSeq", ent)));
     }
     catch
     {
         return(1);
     }
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Description : List of exam history
 /// Written By : Danbi Seo
 /// Date Written : 2016.06.24
 ///
 /// </summary>
 /// <param name="ent"></param>
 /// <returns></returns>
 public DataTable GetExamList(EmpInfoEnt ent)
 {
     try{
         dt = Config.QueryForTable("EmpInfo.SelExamList", ent);
         return(dt);
     }catch {
         return(dt);
     }finally{
         dt.Dispose();
     }
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Description : Counting employee list (for paging)
 /// Written By : Danbi Seo
 /// Date Written : 2016.01.20
 ///
 /// </summary>
 /// <returns></returns>
 public int GetListCnt(EmpInfoEnt ent)
 {
     try
     {
         return(Convert.ToInt32(mapper.QueryForObject("EmpInfo.SelListCnt", ent)));
     }
     catch
     {
         return(0);
     }
 }
        /// <summary>
        /// Description : Insert ot update employee information
        /// Written By : Danbi Seo
        /// Date Written : 2016.01.20
        ///
        /// </summary>
        /// <param name="ent"></param>
        /// <returns></returns>
        public ActionResult UpdateBiz(EmpInfoEnt ent)
        {
            ent.userIP = Request.UserHostAddress;
            ent.pStdDt = ent.pStdDt.Replace(",", "");

            ComnData cd      = new ComnData();
            RsltEnt  rslt    = new RsltEnt();
            string   strMode = ent.hdnMode;

            #region attach file
            HttpPostedFileBase flePto = Request.Files["flePto"];

            // Uploadig photo
            if (flePto != null)
            {
                string strSavePath = Config.GetFileDir("CM_EMP_MST.PTO_NM", Server.MapPath("/")), strFullPath;
                if (flePto.FileName.Length > 0)
                {
                    strFullPath = Config.GetUniqueFileName(strSavePath, flePto.FileName);
                    flePto.SaveAs(strFullPath);

                    ent.pPtoNm = strFullPath.Substring(strFullPath.LastIndexOf("\\") + 1);
                }
            }
            #endregion

            #region
            if (ent.hdnMode == "I")
            {
                rslt = cd.Update(ent, strMode, "EmpInfo.InsEmp");
                if (rslt.bRslt)
                {   //CM_EMP_HST procedure
                    rslt.bRslt = data.GetEmpHstBiz(ent);
                }
            }
            else if (ent.hdnMode == "U")
            {
                rslt = cd.Update(ent, strMode, "EmpInfo.UpdEmp");
            }
            else if (ent.hdnMode == "H") // adding history
            {
                if (ent.pPtoNm == "")    // original image INSERT
                {
                    ent.pPtoNm = ent.hdnPto;
                }
                rslt = cd.Update(ent, strMode, "EmpInfo.InsEmp");
            }
            #endregion
            return(Json(rslt, "text/json"));
        }
Ejemplo n.º 10
0
 /// <summary>
 /// Description : Update employee information
 /// Written By : Danbi Seo
 /// Date Written : 2016.01.20
 ///
 /// </summary>
 /// <returns></returns>
 public DataTable UpdateBiz(EmpInfoEnt ent)
 {
     try
     {
         dt = Config.QueryForTable("EmpInfo.UpdateBiz", ent);
         return(dt);
     }
     catch
     {
         return(dt);
     }
     finally
     {
         dt.Dispose();
     }
 }
Ejemplo n.º 11
0
        /// <summary>
        /// Description : List of employees
        /// Written By : Danbi Seo
        /// Date Written : 2016.01.20
        ///
        /// </summary>
        /// <param name="ent"></param>
        /// <returns></returns>
        public ActionResult List(EmpInfoEnt ent)
        {
            #region params for paging
            if (ent.page == 0)
            {
                ent.page = 1;
            }                                    //current page
            ent.page_sz = 17;                    //size of page
            ent.tot     = data.GetListCnt(ent);
            #endregion

            ViewBag.ent = ent;
            ViewBag.dt  = data.GetList(ent);

            return(PartialView());
        }
Ejemplo n.º 12
0
 /// <summary>
 /// Description : Details of exam history
 /// Written By : Danbi Seo
 /// Date Written : 2016.06.24
 ///
 /// </summary>
 /// <param name="ent"></param>
 /// <returns></returns>
 public DataRow GetExamInfo(EmpInfoEnt ent)
 {
     try{
         dt = Config.QueryForTable("EmpInfo.SelExamList", ent);
         if (dt.Rows.Count > 0)
         {
             return(dt.Rows[0]);
         }
         else
         {
             return(null);
         }
     }catch {
         return(null);
     }finally{
         dt.Dispose();
     }
 }
Ejemplo n.º 13
0
        public JsonResult AddInfoDetail(EmpInfoEnt ent)
        {
            DataRow dr = null;

            switch (ent.pTabDvs)
            {
            case "exam":
                dr = data.GetExamInfo(ent);
                break;

            case "eve":
                dr = data.GetEvltInfo(ent);
                break;

            case "cnsl":
                dr = data.GetCnslInfo(ent);
                break;

            case "prs":
                dr = data.GetPrsInfo(ent);
                break;

            default:
                break;
            }
            if (dr != null)
            {
                List <Dictionary <string, object> > rows = new List <Dictionary <string, object> >();
                Dictionary <string, object>         row;

                row = new Dictionary <string, object>();
                foreach (DataColumn col in dr.Table.Columns)
                {
                    row.Add(col.ColumnName, dr[col]);
                }
                rows.Add(row);

                return(Json(rows));
            }
            else
            {
                return(Json("none"));
            }
        }
Ejemplo n.º 14
0
        // <summary>
        /// Description : When inserting initial data to employees master table, re-execute a history procedure
        /// Written By : Danbi Seo
        /// Date Written : 2016.09.13
        ///
        /// </summary>
        /// <param name="ent"></param>
        /// <returns></returns>
        public bool GetEmpHstBiz(EmpInfoEnt ent)
        {
            try
            {
                //calculate difference between current month and standard month.
                int tYear     = DateTime.Now.Year;
                int tMonth    = DateTime.Now.Month;
                int pStdYear  = Convert.ToInt32(ent.pStdDt.Substring(0, 4));
                int pStdMonth = Convert.ToInt32(ent.pStdDt.Substring(4, 2));
                int pRange;

                //If standard month is later than current month, execute procedure for just standard month.
                if (Convert.ToInt32(DateTime.Now.ToString("yyyyMM")) < Convert.ToInt32(ent.pStdDt.Substring(0, 6)))
                {
                    pRange = 1;
                }
                else     //If standard month is ealier than current month, execute procedure for previous month.
                {
                    if (tYear != pStdYear)
                    {
                        int year = (tYear - pStdYear) - 1;
                        pRange = (year * 12) + (12 - pStdMonth + 1) + tMonth;
                    }
                    else
                    {
                        pRange = (tMonth - pStdMonth) + 1;
                    }
                }

                DateTime pStdDt = Convert.ToDateTime(ent.pStdDt.Substring(0, 4) + "-" + ent.pStdDt.Substring(4, 2) + "-01");
                for (int i = 0; i < pRange; i++)
                {
                    ent.pStdDt = i == 0 ? ent.pStdDt : pStdDt.AddMonths(i).ToString("yyyyMMdd");
                    mapper.QueryForObject("EmpInfo.PrcPpCmEmpHst", ent);
                }
                return(true);
            }
            catch
            {
                return(false);
            }
        }
Ejemplo n.º 15
0
 /// <summary>
 /// Description : Details of employees
 /// Written By : Danbi Seo
 /// Date Written : 2016.01.23
 ///
 /// </summary>
 /// <returns></returns>
 public DataRow EmpDetail(EmpInfoEnt ent)
 {
     try
     {
         dt = Config.QueryForTable("EmpInfo.EmpDetail", ent);
         if (dt.Rows.Count > 0)
         {
             return(dt.Rows[0]);
         }
         else
         {
             return(null);
         }
     }
     catch
     {
         return(null);
     }
     finally
     {
         dt.Dispose();
     }
 }
Ejemplo n.º 16
0
        /// <summary>
        /// Description : Extra information (exam info, consulting info) Input_biz
        /// Written By : Danbi Seo
        /// Date Written : 2016.06.25
        ///
        /// </summary>
        /// <param name="ent"></param>
        /// <returns></returns>
        public JsonResult AddInfoInputBiz(EmpInfoEnt ent)
        {
            ent.userIP = Request.UserHostAddress;
            ComnData cd = new ComnData();

            string strMapUrl = string.Empty;

            switch (ent.pTabDvs)
            {
            case "exam":
                ent.txtExamDt = ent.txtExamDt.Replace("-", "");
                switch (ent.hdnAddInfoMode)
                {
                case "I":
                    ent.txtExamSeq = data.GetMaxExamSeq(ent);
                    strMapUrl      = "EmpInfo.InsExam";
                    break;

                case "U":
                    strMapUrl = "EmpInfo.UpdExam";
                    break;

                case "D":
                    strMapUrl = "EmpInfo.DelExam";
                    break;

                default:
                    break;
                }
                break;

            case "cnsl":
                ent.txtCnslDt = ent.txtCnslDt.Replace("-", "");
                switch (ent.hdnAddInfoMode)
                {
                case "I":
                    ent.txtCnslSeq = data.GetMaxCnslSeq(ent);
                    strMapUrl      = "EmpInfo.InsCnsl";
                    break;

                case "U":
                    strMapUrl = "EmpInfo.UpdCnsl";
                    break;

                case "D":
                    strMapUrl = "EmpInfo.DelCnsl";
                    break;

                default:
                    break;
                }
                break;

            case "prs":
                ent.txtPrsDt = ent.txtPrsDt.Replace("-", "");
                switch (ent.hdnAddInfoMode)
                {
                case "I":
                    ent.txtPrsSeq = data.GetMaxPrsSeq(ent);
                    strMapUrl     = "EmpInfo.InsPrs";
                    break;

                case "U":
                    strMapUrl = "EmpInfo.UpdPrs";
                    break;

                case "D":
                    strMapUrl = "EmpInfo.DelPrs";
                    break;

                default:
                    break;
                }
                break;
            }
            RsltEnt rslt = cd.Update(ent, ent.hdnAddInfoMode, strMapUrl);

            return(Json(rslt));
        }
Ejemplo n.º 17
0
 /// <summary>
 /// Description : Information of employees
 /// Written By : Danbi Seo
 /// Date Written : 2016.01.20
 ///
 /// </summary>
 /// <param name="ent"></param>
 /// <returns></returns>
 public ActionResult Index(EmpInfoEnt ent)
 {
     ent.pWrkStatCd = string.IsNullOrEmpty(ent.pWrkStatCd) ? "01" : ent.pWrkStatCd;
     ViewBag.ent    = ent;
     return(View());
 }