Пример #1
0
        public ActionResult BaseAirportView(BaseAirportModels model)
        {
            if (model.act_type == "ins")
            {
                //권한 체크===================================================
                if (!chk.chkPermission("BaseAirport", "PER_INSERT"))
                {
                    return(RedirectToAction("BaseAirportView", new { msg = chk.alertStr }));
                }
                //===========================================================
            }

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


            string PublicPopupMsg = act.setBaseAirport(model);

            return(RedirectToAction("BaseAirportView", new { seqNo = model.act_key, Msg = PublicPopupMsg }));
        }
Пример #2
0
        //Base 공항 관리 =================================================================================================
        // GET: Base 공항 관리
        public ActionResult BaseAirport(string msg)
        {
            //권한 체크===================================================
            if (!chk.chkPermission("BaseAirport", "PER_SELECT"))
            {
                return(RedirectToAction("Index", "Home", new { msg = chk.alertStr }));
            }
            //============================================================

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


            BaseAirportModels model = new BaseAirportModels();

            model = act.GetBaseAirportList(model);

            //SELECT BOX ARRAY 데이터 설정
            model.nationArray = comModel.GetCommNationSelectBox();

            return(View(model));
        }
Пример #3
0
        public BaseAirportModels GetBaseAirportList(BaseAirportModels model)
        {
            string errorStr = "";

            string listQuery = " SELECT SEQNO , " + string.Join(",", column_BaseAirport) + " FROM conf_airport WHERE 1=1 ";

            if (!String.IsNullOrEmpty(model.schType))
            {
                listQuery += " AND NATION_CODE = '" + model.schType + "' ";
            }

            listQuery += " 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++)
                {
                    ConfAirpot temp = new ConfAirpot();
                    temp.SEQNO            = int.Parse(listDt.Rows[i]["SEQNO"].ToString().Trim());
                    temp.NATION_CODE      = listDt.Rows[i]["NATION_CODE"].ToString().Trim();
                    temp.AIRPORT_CODE     = listDt.Rows[i]["AIRPORT_CODE"].ToString().Trim();
                    temp.AIRPORT_NAME     = listDt.Rows[i]["AIRPORT_NAME"].ToString().Trim();
                    temp.AIRPORT_LOCATION = listDt.Rows[i]["AIRPORT_LOCATION"].ToString().Trim();
                    model.Items.Add(temp);
                }
            }

            return(model);
        }
Пример #4
0
        public string setBaseAirport(BaseAirportModels model)
        {
            string errorStr    = "";
            string result      = "";
            string exeQueryStr = "";

            if (model.act_type != null && model.act_type == "ins")
            {
                exeQueryStr  = " INSERT INTO conf_airport (" + string.Join(",", column_BaseAirport) + " )VALUES(  ";
                exeQueryStr += " '" + model.Item.NATION_CODE + "'";
                exeQueryStr += ", '" + model.Item.AIRPORT_CODE + "'";
                exeQueryStr += ", '" + model.Item.AIRPORT_NAME + "'";
                exeQueryStr += ", '" + model.Item.AIRPORT_LOCATION + "'";
                exeQueryStr += " ) ";
            }
            else if (model.act_type != null && model.act_type == "updt")
            {
                exeQueryStr  = " UPDATE conf_airport SET ";
                exeQueryStr += " NATION_CODE = '" + model.Item.NATION_CODE + "'";
                exeQueryStr += ", AIRPORT_CODE =  '" + model.Item.AIRPORT_CODE + "'";
                exeQueryStr += ", AIRPORT_NAME =  '" + model.Item.AIRPORT_NAME + "'";
                exeQueryStr += ", AIRPORT_LOCATION =  '" + model.Item.AIRPORT_LOCATION + "'";
                exeQueryStr += " WHERE SEQNO = " + model.Item.SEQNO;
            }
            else
            {
                result = "잘못된 접근입니다.";
                return(result);
            }


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

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


            BaseAirportModels model = new BaseAirportModels();
            int pSeqNo = 0;

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

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

            //단일 데이타 정보 가져오기
            model.Item = act.GetBaseAirportView(pSeqNo);

            //SELECT BOX ARRAY 데이터 설정
            model.nationArray = comModel.GetCommNationSelectBox();

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



            string PublicMsg = "";

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

                TempData["PublicMsg"] = act.delBaseAirport(model.act_key);                 //삭제
                model.act_type        = "list";
                model.act_key         = 0;


                return(RedirectToAction("BaseAirport", new { Msg = PublicMsg }));
            }
            model = act.GetBaseAirportList(model);

            //SELECT BOX ARRAY 데이터 설정
            model.nationArray = comModel.GetCommNationSelectBox();
            return(View(model));
        }