Esempio n. 1
0
        public void MessageBaseObjectDeletedTest()
        {
            var obj = new MesObject
            {
                Name = "Test"
            };

            var messageBase = new MessageBase <MesObject>(obj, EDomainState.Deleted);

            Assert.AreSame(messageBase.Object, obj);
            Assert.AreEqual(messageBase.State, EDomainState.Deleted);
        }
Esempio n. 2
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string message = string.Empty;
            string gtjson  = string.Empty;
            bool   result  = false;

            using (var reader = new StreamReader(context.Request.InputStream))
            {
                gtjson = reader.ReadToEnd();
            }

            if (!string.IsNullOrEmpty(gtjson))
            {
                MesObject Introduction = JsonConvert.DeserializeObject <MesObject>(gtjson);
                result   = true;
                message += Introduction.Name + ":" + Introduction.Subject;

                //var objList = new JavaScriptSerializer().Deserialize<dynamic>(gtjson);
                //foreach (MesObject p in objList)
                //{
                //    result = true;
                //    message += p.Name + ":" + p.Subject;
                //}
            }



            this.SendResponse(context, result, message);


            //test1
            //string lot_id = context.Request.QueryString["lot_id"];
            //string ope_id = context.Request.QueryString["ope_id"];
            //print test
            //context.Response.ContentType = "text/plain";
            //context.Response.Write("Lot ID: " + lot_id);
        }