public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";

            HttpPostedFile files = context.Request.Files[0];
            // string url = context.Server.MapPath("~/");
            string name   = context.Request["GoodsName"];
            int    typeid = int.Parse(context.Request["TypeID"]);
            int    cfid   = int.Parse(context.Request["CFID"]);

            using (MYAdminManagerEntities1 mb = new MYAdminManagerEntities1())
            {
                Goods     good = new Goods();
                GoodsType type = mb.GoodsType.Find(typeid);
                CFplace   cf   = mb.CFplace.Find(cfid);

                files.SaveAs(context.Server.MapPath("~/") + "\\attres\\imgs\\" + files.FileName);
                if (File.Exists(context.Server.MapPath("~/") + "\\attres\\imgs\\" + files.FileName))
                {
                    good.GoodsName = name;
                    good.img       = files.FileName;
                    good.CFID      = cf.CFID;
                    good.TypeID    = type.TypeID;
                    mb.Goods.Add(good);
                    if (mb.SaveChanges() > 0)
                    {
                        context.Response.Write("ok");
                    }
                }
            }
        }
Beispiel #2
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            int    ids  = int.Parse(context.Request["ids"]);
            string pwd  = context.Request["pwd1"];
            string rpwd = context.Request["rpwd1"];

            using (MYAdminManagerEntities1 mb = new MYAdminManagerEntities1())
            {
                AdminUser user = mb.AdminUser.Find(ids);
                if (pwd == user.UserPwd)
                {
                    user.UserPwd = rpwd;
                    if (mb.SaveChanges() > 0)
                    {
                        context.Response.Write("ok");
                    }
                    else
                    {
                        context.Response.Write("no");
                    }
                }
                else
                {
                    context.Response.Write("no");
                }
            }
        }
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string name = context.Request["name"];

            using (MYAdminManagerEntities1 mb = new MYAdminManagerEntities1())
            {
                CFplace cf = new CFplace();
                cf.CFPlaces = name;
                mb.CFplace.Add(cf);
                if (mb.SaveChanges() > 0)
                {
                    context.Response.Write("ok");
                }
            }
        }
Beispiel #4
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            int    ids  = int.Parse(context.Request.QueryString["ids"]);
            string name = context.Request.QueryString["name"];

            using (MYAdminManagerEntities1 mb = new MYAdminManagerEntities1())
            {
                GoodsType goods = mb.GoodsType.Find(ids);
                goods.TypeName = name;
                if (mb.SaveChanges() > 0)
                {
                    context.Response.Write("ok");
                }
            }
        }
Beispiel #5
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            int ids = int.Parse(context.Request.QueryString["ids"]);

            using (MYAdminManagerEntities1 mb = new MYAdminManagerEntities1())
            {
                Buyer buyer = mb.Buyer.Find(ids);
                mb.Buyer.Remove(buyer);
                //var userid= mb.AdminUser.FirstOrDefault(model => model.UserID == user.UserID);
                //user.UserID = int.Parse(userid.ToString());
                if (mb.SaveChanges() > 0)
                {
                    context.Response.Write("ok");
                }
            }
        }
 public void ProcessRequest(HttpContext context)
 {
     context.Response.ContentType = "text/plain";
     string name = context.Request["name"];
     string times = context.Request["time"];
     using (MYAdminManagerEntities1 mb = new MYAdminManagerEntities1())
     {
         Buyer buyer = new Buyer();
         buyer.BuyerName = name;
         buyer.HZTime = DateTime.Parse(times);
         mb.Buyer.Add(buyer);
         if (mb.SaveChanges() > 0)
         {
             context.Response.Write("ok");
         }
     }
 }
        public void ProcessRequest(HttpContext context)
        {
            int    ids    = int.Parse(context.Request.QueryString["ids"]);
            string name   = context.Request["name"];
            string places = context.Request["places"];

            using (MYAdminManagerEntities1 mb = new MYAdminManagerEntities1())
            {
                Goods good = mb.Goods.Find(ids);
                var   list = mb.CFplace.Select(c => new { c.CFID, c.CFPlaces }).Where(cfs => cfs.CFPlaces == places).ToList();
                good.GoodsName = name;
                good.CFID      = list[0].CFID;

                if (mb.SaveChanges() > 0)
                {
                    context.Response.Write("ok");
                }
            }
        }
Beispiel #8
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            int    ids   = int.Parse(context.Request.QueryString["ids"]);
            string name  = context.Request["name"];
            string phone = context.Request["phone"];

            using (MYAdminManagerEntities1 mb = new MYAdminManagerEntities1())
            {
                AdminUser user = mb.AdminUser.Find(ids);
                user.UserName  = name;
                user.UserPhone = phone;

                if (mb.SaveChanges() > 0)
                {
                    context.Response.Write("ok");
                }
            }
        }