Exemple #1
0
        public EseUser GetEseUserView(EseUserModels getModel)
        {
            string errorStr = "";

            EseUser model = new EseUser();

            string listQuery = " SELECT SEQNO, EST_CODE,ESE_CODE, 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.EST_CODE   = listDt.Rows[0]["EST_CODE"].ToString().Trim();
                model.ESE_CODE   = listDt.Rows[0]["ESE_CODE"].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);
        }
Exemple #2
0
        public string SetEseUser(EseUserModels model)
        {
            string errorStr    = "";
            string result      = "";
            string exeQueryStr = "";

            if (model.act_type != null && model.act_type == "ins")
            {
                exeQueryStr  = " INSERT INTO ese_user ( EMAIL, EST_CODE, ESE_CODE, PASSWD, USERNAME, TELNO, GROUP_ID, DEPARTMENT, POSITION, MEMO, STATUS )VALUES(  ";
                exeQueryStr += " '" + model.Item.EMAIL + "'";
                exeQueryStr += " , '" + model.Item.EST_CODE + "'";
                exeQueryStr += " , '" + model.Item.ESE_CODE + "'";
                exeQueryStr += " , '" + 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 += " EMAIL = '" + model.Item.EMAIL + "'";
                exeQueryStr += " ,EST_CODE = '" + model.Item.EST_CODE + "'";
                exeQueryStr += " ,ESE_CODE = '" + model.Item.ESE_CODE + "'";
                //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);
        }
Exemple #3
0
        public ActionResult EseIframeUserView(EseUserModels model)
        {
            if (model.act_type == "ins")
            {
                //권한 체크===================================================
                if (!chk.chkPermission("EseInfo", "PER_INSERT"))
                {
                    return(RedirectToAction("EseIframeUserView", new { msg = chk.alertStr }));
                }
                //===========================================================
            }

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


            //if (!ModelState.IsValid)
            //return View(model);

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

            model.Item.GROUP_ID = model.GroupId;

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

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


            string PublicPopupMsg = act.SetEseUser(model);

            return(RedirectToAction("EseIframeUser", new { seqNo = model.act_key, Msg = PublicPopupMsg }));
        }
Exemple #4
0
        // GET: Est EST STATION Est 정보 관리 -> 계정 관리 상세
        public ActionResult EseIframeUserView(string seqNo, string Msg)
        {
            //권한 체크===================================================
            if (!chk.chkPermission("EseInfo", "PER_SELECT"))
            {
                return(RedirectToAction("Index", "Home", new { msg = chk.alertStr }));
            }
            //===========================================================

            EseUserModels model  = new EseUserModels();
            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.GetEseUserView(model);
            model.RadioBoxPop = false;
            if (model.Item.STATUS == 1)
            {
                model.RadioBoxPop = true;
            }

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

            return(View(model));
        }
Exemple #5
0
        public ActionResult EseIframeUser(EseUserModels model, string eseCode)
        {
            //권한 체크===================================================
            if (!chk.chkPermission("EseInfo", "PER_SELECT"))
            {
                return(RedirectToAction("Index", "Home", new { msg = chk.alertStr }));
            }
            //===========================================================


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

                TempData["PublicMsg"] = act.DelEseUser(model.act_key);                 //삭제
                model.act_type        = "list";
                model.act_key         = 0;
                return(RedirectToAction("EseIframeUser", model));
            }

            model = act.GetEseUserList(model, eseCode);

            if (TempData["PublicMsg"] != null)
            {
                ViewBag.PublicMsg = TempData["PublicMsg"].ToString();
            }

            model.viewEseCode = eseCode;

            return(View(model));
        }
Exemple #6
0
        //ESE SENDER ESE 정보 관리 -> 계정 관리
        public EseUserModels GetEseUserList(EseUserModels model, string eseCode)
        {
            string errorStr = "";


            string    listQuery = "  SELECT SEQNO, EMAIL,PASSWD,USERNAME,TELNO,eu.GROUP_ID,eg.GROUP_NAME,CREATETIME,DEPARTMENT,POSITION,MEMO,STATUS FROM ese_user eu left outer join ese_group eg on eu.GROUP_ID = eg.GROUP_ID 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.EST_CODE = listDt.Rows[i]["EST_CODE"].ToString().Trim();
                    //temp.ESE_CODE = listDt.Rows[i]["ESE_CODE"].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());


                    model.Items.Add(temp);
                }
            }

            return(model);
        }
Exemple #7
0
        //계정 관리 ========================================================================================================
        public ActionResult EseIframeUser(string msg, string eseCode)
        {
            //권한 체크===================================================
            if (!chk.chkPermission("EseInfo", "PER_SELECT"))
            {
                return(RedirectToAction("Index", "Home", new { msg = chk.alertStr }));
            }
            //===========================================================

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

            EseUserModels model = new EseUserModels();

            model.viewEseCode = eseCode;

            model = act.GetEseUserList(model, eseCode);


            return(View(model));
        }