Пример #1
0
        public ActionResult EseManager(EseManagerModels model)
        {
            //권한 체크===================================================
            if (!chk.chkPermission("EseManager", "PER_SELECT"))
            {
                return(RedirectToAction("Index", "Home", new { msg = chk.alertStr }));
            }
            //===========================================================

            string resultMsg = null;

            //삭제일 경우
            if (model.act_type == "del")
            {
                //권한 체크===================================================
                if (!chk.chkPermission("EseManager", "PER_DELETE"))
                {
                    return(RedirectToAction("EseManager", new { msg = chk.alertStr }));
                }
                //===========================================================

                resultMsg      = act.DelEseManager(model.act_key);            //삭제
                model.act_type = "list";
                model.act_key  = 0;
                return(RedirectToAction("EseManager", new { msg = resultMsg }));
            }

            model = act.GetEseManagerList(model);


            return(View(model));
        }
Пример #2
0
        public EseUser GetEseManagerView(EseManagerModels getModel)
        {
            string errorStr = "";

            EseUser model = new EseUser();

            string listQuery = " SELECT SEQNO, EMAIL, PASSWD, USERNAME, TELNO, GROUP_ID, CREATETIME, DEPARTMENT, POSITION, MEMO, STATUS  FROM ese_user WHERE SEQNO = " + getModel.act_key;

            DataTable listDt = getQueryResult(listQuery, out errorStr);


            if (listDt != null && listDt.Rows.Count != 0)
            {
                model.SEQNO = int.Parse(listDt.Rows[0]["SEQNO"].ToString().Trim());
                model.EMAIL = listDt.Rows[0]["EMAIL"].ToString().Trim();
                //model.PASSWD = listDt.Rows[0]["PASSWD"].ToString().Trim();
                model.USERNAME   = listDt.Rows[0]["USERNAME"].ToString().Trim();
                model.TELNO      = listDt.Rows[0]["TELNO"].ToString().Trim();
                model.GROUP_ID   = int.Parse(listDt.Rows[0]["GROUP_ID"].ToString().Trim());
                model.CREATETIME = listDt.Rows[0]["CREATETIME"].ToString().Trim();
                model.DEPARTMENT = listDt.Rows[0]["DEPARTMENT"].ToString().Trim();
                model.POSITION   = listDt.Rows[0]["POSITION"].ToString().Trim();
                model.MEMO       = listDt.Rows[0]["MEMO"].ToString().Trim();
                model.STATUS     = int.Parse(listDt.Rows[0]["STATUS"].ToString().Trim());
            }

            return(model);
        }
Пример #3
0
        public string SetEseManager(EseManagerModels model)
        {
            HttpContext context  = HttpContext.Current;
            string      ESE_CODE = context.Session["ESE_CODE"].ToString();
            string      EST_CODE = context.Session["EST_CODE"].ToString();

            string errorStr    = "";
            string result      = "";
            string exeQueryStr = "";

            if (model.act_type != null && model.act_type == "ins")
            {
                exeQueryStr  = " INSERT INTO ese_user ( EST_CODE, ESE_CODE, EMAIL, PASSWD, USERNAME, TELNO, GROUP_ID, DEPARTMENT, POSITION, MEMO, STATUS )VALUES(  ";
                exeQueryStr += " '" + EST_CODE + "'";
                exeQueryStr += " , '" + ESE_CODE + "'";
                exeQueryStr += " , '" + model.Item.EMAIL + "'";
                exeQueryStr += " , '" + dbAct.AESEncrypt_256("etomarsPw", model.Item.PASSWD) + "'";
                exeQueryStr += " , '" + model.Item.USERNAME + "'";
                exeQueryStr += " , '" + model.Item.TELNO + "'";
                exeQueryStr += " , " + model.Item.GROUP_ID;
                exeQueryStr += " , '" + model.Item.DEPARTMENT + "'";
                exeQueryStr += " , '" + model.Item.POSITION + "'";
                exeQueryStr += " , '" + model.Item.MEMO + "'";
                exeQueryStr += " , " + model.Item.STATUS;
                exeQueryStr += " ) ";
            }
            else if (model.act_type != null && model.act_type == "updt")
            {
                exeQueryStr = " UPDATE ese_user SET ";
                //exeQueryStr += " ,PASSWD = '" + model.Item.PASSWD + "'";
                exeQueryStr += " USERNAME = '******'";
                exeQueryStr += " ,TELNO = '" + model.Item.TELNO + "'";
                exeQueryStr += " ,GROUP_ID = " + model.Item.GROUP_ID;
                exeQueryStr += " ,DEPARTMENT = '" + model.Item.DEPARTMENT + "'";
                exeQueryStr += " ,POSITION = '" + model.Item.POSITION + "'";
                exeQueryStr += " ,MEMO = '" + model.Item.MEMO + "'";
                exeQueryStr += " ,STATUS = " + model.Item.STATUS;
                exeQueryStr += " WHERE SEQNO = " + model.Item.SEQNO;
            }
            else
            {
                result = "잘못된 접근입니다.";
                return(result);
            }

            if (exeQuery(exeQueryStr, out errorStr))
            {
                result = "성공.";
            }
            else
            {
                result = "실패.";
            }

            return(result);
        }
Пример #4
0
        public ActionResult EseManagerView(EseManagerModels model)
        {
            if (model.act_type == "ins")
            {
                //권한 체크===================================================
                if (!chk.chkPermission("EseManager", "PER_INSERT"))
                {
                    return(RedirectToAction("EseMangerView", new { msg = chk.alertStr }));
                }
                //===========================================================

                if (model.Item.PASSWD != model.Item.PASSWD_CHK)
                {
                    ViewBag.TempMsg = "비밀번호가 일치 하지 않습니다.";
                    return(View(model));
                }
            }

            if (model.act_type == "updt")
            {
                //권한 체크===================================================
                if (!chk.chkPermission("EseManager", "PER_UPDATE"))
                {
                    return(RedirectToAction("EseMangerView", new { msg = chk.alertStr }));
                }
                //===========================================================
            }


            string chkDupl = act.ChkUpdtEseManager(model);

            if (chkDupl != "")
            {
                return(RedirectToAction("EseManagerView", new { msg = chkDupl }));
            }


            //라디오버튼 쓰기
            model.Item.STATUS = 1;
            if (model.RadioBoxPop == false)
            {
                model.Item.STATUS = 0;
            }

            model.Item.GROUP_ID = model.GroupId;


            //SELECT BOX ARRAY 데이터 설정
            model.GroupIdArray = comF.GroupIdSelectBox();


            string PublicPopupMsg = act.SetEseManager(model);

            return(RedirectToAction("EseManagerView", new { seqNo = model.act_key, Msg = PublicPopupMsg }));
        }
Пример #5
0
        //WEB_ESE 계정관리 => 계정 관리
        public EseManagerModels GetEseManagerList(EseManagerModels model)
        {
            HttpContext context  = HttpContext.Current;
            string      ESE_CODE = context.Session["ESE_CODE"].ToString();

            string errorStr = "";

            string listQuery = "";

            listQuery  = " SELECT SEQNO, EMAIL, PASSWD, USERNAME, TELNO, eu.GROUP_ID,IFNULL(eg.GROUP_NAME, 'MASTER') as GROUP_NAME,CREATETIME,DEPARTMENT,POSITION,MEMO,STATUS ";
            listQuery += " FROM ese_user eu left outer join ese_group eg on eu.GROUP_ID = eg.GROUP_ID WHERE eu.ESE_CODE = '" + ESE_CODE + "' ORDER BY SEQNO";

            DataTable listDt = getQueryResult(listQuery, out errorStr);


            if (listDt != null && listDt.Rows.Count != 0)
            {
                for (int i = 0; i < listDt.Rows.Count; i++)
                {
                    EseUser temp = new EseUser();
                    temp.SEQNO       = int.Parse(listDt.Rows[i]["SEQNO"].ToString().Trim());
                    temp.EMAIL       = listDt.Rows[i]["EMAIL"].ToString().Trim();
                    temp.PASSWD      = listDt.Rows[i]["PASSWD"].ToString().Trim();
                    temp.USERNAME    = listDt.Rows[i]["USERNAME"].ToString().Trim();
                    temp.TELNO       = listDt.Rows[i]["TELNO"].ToString().Trim();
                    temp.GROUP_ID    = int.Parse(listDt.Rows[i]["GROUP_ID"].ToString().Trim());
                    temp.GROUP_NAME  = listDt.Rows[i]["GROUP_NAME"].ToString().Trim();
                    temp.CREATETIME  = listDt.Rows[i]["CREATETIME"].ToString().Trim();
                    temp.DEPARTMENT  = listDt.Rows[i]["DEPARTMENT"].ToString().Trim();
                    temp.POSITION    = listDt.Rows[i]["POSITION"].ToString().Trim();
                    temp.MEMO        = listDt.Rows[i]["MEMO"].ToString().Trim();
                    temp.STATUS      = int.Parse(listDt.Rows[i]["STATUS"].ToString().Trim());
                    temp.STATUS_TEXT = "미사용";
                    if (temp.STATUS == 0)
                    {
                        temp.STATUS_TEXT = "사용";
                    }

                    model.Items.Add(temp);
                    model.chkCnt = i;
                }
            }

            //계정 등급이 하나도 등록 되어 있지 않은 경우를 체크를 위해 계정 등급의 카운트를 가져옴
            listQuery = " SELECT count(*) as cnt FROM ese_group WHERE ESE_CODE = '" + ESE_CODE + "' ";

            model.chkGRADE = getQueryCnt(listQuery, out errorStr);


            return(model);
        }
Пример #6
0
        public ActionResult EseManagerView(string seqNo, string Msg)
        {
            //권한 체크===================================================
            if (!chk.chkPermission("EseManager", "PER_SELECT"))
            {
                return(RedirectToAction("Index", "Home", new { msg = chk.alertStr }));
            }
            //===========================================================


            EseManagerModels model = new EseManagerModels();

            int pSeqNo = 0;

            if (int.TryParse(seqNo, out pSeqNo))
            {
                model.act_type = "updt";
                model.act_key  = pSeqNo;
            }
            else
            {
                model.act_type      = "ins";
                model.Item.GROUP_ID = 0;
            }



            if (!String.IsNullOrEmpty(Msg))
            {
                ViewBag.PublicPopupMsg = Msg;
            }

            model.Item        = act.GetEseManagerView(model);
            model.RadioBoxPop = false;
            if (model.Item.STATUS == 1)
            {
                model.RadioBoxPop = true;
            }

            //SELECT BOX ARRAY 데이터 설정 comF에 그룹 id 추가해야한다.
            model.GroupIdArray = act.GroupIdSelectBox();

            return(View(model));
        }
Пример #7
0
        public string ChkUpdtEseManager(EseManagerModels model)
        {
            //est, esm도
            string errorStr  = "";
            string result    = "";
            string listQuery = "";
            int    reCnt     = 0;

            listQuery = " SELECT count(*) as cnt FROM ese_user WHERE EMAIL = '" + model.Item.EMAIL + "' ";

            reCnt = getQueryCnt(listQuery, out errorStr);

            if (reCnt > 0)
            {
                result = @comm_global.Language.Resources.ESE_RETURN_DuplicatedInfo + "[" + @comm_global.Language.Resources.ESE_EseManagerView_Email + "]";

                return(result);
            }

            listQuery = " SELECT count(*) as cnt FROM est_user WHERE EMAIL = '" + model.Item.EMAIL + "' ";

            reCnt = getQueryCnt(listQuery, out errorStr);

            if (reCnt > 0)
            {
                result = @comm_global.Language.Resources.ESE_RETURN_DuplicatedInfo + "[" + @comm_global.Language.Resources.ESE_EseManagerView_Email + "]";

                return(result);
            }

            listQuery = " SELECT count(*) as cnt FROM esm_user WHERE EMAIL = '" + model.Item.EMAIL + "' ";

            reCnt = getQueryCnt(listQuery, out errorStr);

            if (reCnt > 0)
            {
                result = @comm_global.Language.Resources.ESE_RETURN_DuplicatedInfo + "[" + @comm_global.Language.Resources.ESE_EseManagerView_Email + "]";

                return(result);
            }


            return(result);
        }
Пример #8
0
        // GET: EseManager 계정관리
        public ActionResult EseManager(string msg)
        {
            //권한 체크===================================================
            if (!chk.chkPermission("EseManager", "PER_SELECT"))
            {
                return(RedirectToAction("Index", "Home", new { msg = chk.alertStr }));
            }
            //===========================================================

            TempData["PublicMsg"] = null;
            if (!string.IsNullOrEmpty(msg))
            {
                TempData["PublicMsg"] = msg;
            }

            EseManagerModels model = new EseManagerModels();

            model = act.GetEseManagerList(model);

            return(View(model));
        }