Exemple #1
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);
        }