Ejemplo n.º 1
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/html";
            if (context.Request["goodId"] == null || context.Request["phone"] == null)
            {
                return;
            }
            Person person = new Person();

            AdminMng.QueryPersonByPhone(context.Request["phone"], ref person);
            Good good = new Good();

            PersonMng.GetGoodById(Convert.ToInt32(context.Request["goodId"]), ref good);
            Buy buy = new Buy();

            buy.PersonId = person.Id;
            buy.GoodId   = good.Id;
            buy.IsCheck  = false;
            buy.Num      = Convert.ToInt32(context.Request["num"]);
            buy.Date     = System.DateTime.Now.ToString();
            PersonMng.AddBuy(buy);
            context.Response.Redirect("goodHandler.ashx");
            return;
        }