예제 #1
0
        //------------ 여기부터 실제 ITEM처리하기..

        public void Proc_OBJIns()
        {
            string obj_id = Request.Params["OBJECT_ID"];
            string pcode  = Request.Params["CATE_PCODE"];
            string id     = "";
            object _id    = Session["USERID"];

            if (_id != null)
            {
                id = _id.ToString();
            }


            clsObject obj = new clsObject();

            try
            {
                System.IO.StreamReader reader = new System.IO.StreamReader(HttpContext.Current.Request.InputStream);
                string requestFromPost        = reader.ReadToEnd();
                obj.loadFromJsonStr(requestFromPost);
            }
            catch (Exception _e)
            {
            }

            obj.insert(id, pcode);
            Response.Clear();
            string res = "{ 'RESULT' : 'true' }";

            Response.Write(res);
        }
예제 #2
0
        public void Proc_OBJMod()
        {
            string obj_id = Request.Params["OBJECT_ID"];
            string id     = "";
            object _id    = Session["USERID"];

            if (_id != null)
            {
                id = _id.ToString();
            }


            // 권한 체크..
            // ID를 통해서 대상의 OBJ_ID를 읽어오자..

            System.IO.StreamReader reader = new System.IO.StreamReader(HttpContext.Current.Request.InputStream);
            string requestFromPost        = reader.ReadToEnd();


            clsObject obj = new clsObject();

            bool auth = obj.checkAuth(id, obj_id);

            if (auth == false)
            {
                Response.Clear();
                string r = "{ 'RESULT' : 'false', 'MESSAGE' : 'Access Dined' }";
                Response.Write(r);
                return;
            }


            obj.loadFromJsonStr(requestFromPost);
            string object_id = obj.OBJECT_ID;

            //obj.load(obj_id);
            // load를 따로 할필요가 있을까..?

            // 데이터 로드 하고....
            if (object_id == null || "".Equals(object_id))
            {
                return;
            }

            obj.update(id);

            Response.Clear();
            string res = "{ 'RESULT' : 'true' }";

            Response.Write(res);
        }