Ejemplo n.º 1
0
 /// <summary>
 /// 更新商品浏览次
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public string clickNum(int id)
 {
     if (Request.HttpMethod == "POST")
     {
         SOSOshop.BLL.Db bll = new SOSOshop.BLL.Db();
         bll.ExecuteNonQuery("UPDATE Product SET Product_ClickNum=Product_ClickNum+1 WHERE Product_ID=" + id);
     }
     return("");
 }
        /// <summary>
        /// 已处理操作
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool YiChuli(int id)
        {
            SOSOshop.Model.AdminInfo adminInfo = SOSOshop.BLL.AdministrorManager.Get();
            string s = string.Format(@"update MemberIntegralGiftExchange set ontime=getdate(),Editer={1},[State]=2 where [State]<>0 and [id]={0}",
                                     id, adminInfo == null ? 0 : adminInfo.AdminId);

            SOSOshop.BLL.Db db = new SOSOshop.BLL.Db();
            return(0 < db.ExecuteNonQuery(s));
        }
Ejemplo n.º 3
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            //context.Response.Write("Hello World");
            string id         = context.Request["pid"];
            string cuprice    = context.Request["cuprice"];
            string discount   = context.Request["discount"];
            string btime      = context.Request["btime"];
            string etime      = context.Request["etime"];
            string maxsell    = context.Request["maxsell"];
            string minsell    = context.Request["minsell"];
            string otcminsell = context.Request["otcminsell"];
            string canel      = context.Request["canel"];

            if (!string.IsNullOrEmpty(id))
            {
                try
                {
                    //用户操作权限审核
                    if (SOSOshop.BLL.PowerPass.isPass("001030000"))
                    {
                        SOSOshop.BLL.Db db = new SOSOshop.BLL.Db();
                        //设置促销
                        string sql = string.Format("update product set cuprice={0},discount={1},maxsell={2},begindate='{3}',enddate='{4}',otcminsell={6},minsell={7} where Product_ID={5}", cuprice, discount, maxsell, btime, etime, id, otcminsell, minsell);
                        //取消促销设置
                        if (!string.IsNullOrEmpty(canel))
                        {
                            sql = string.Format("update product set cuprice=0,discount=0,maxsell=0,minsell=0,otcminsell=0,begindate=null,enddate=null where Product_ID={0}", id);
                        }
                        int       result     = db.ExecuteNonQuery(sql);
                        AdminInfo adminModel = (AdminInfo)SOSOshop.BLL.AdministrorManager.Get();
                        SOSOshop.BLL.Logs.Log.LogAdminAdd(string.Format("设置了促销商品:[{0}][{1}]", id, new SOSOshop.BLL.Db().ExecuteScalar("SELECT Product_Name FROM dbo.Product WHERE Product_ID=" + id), string.IsNullOrEmpty(canel) ? "促销" : "取消促销"), adminModel.AdminId, adminModel.AdminName, 1);
                        //大表同步更新
                        // sql = "";

                        context.Response.Write("{\"state\":" + result + ",\"message\":\"设置完成\"}");
                    }
                    else
                    {
                        context.Response.Write("{\"state\":-1,\"message\":\"对不起!您没有操作权限。\"}");
                    }
                }
                catch (Exception x)
                {
                    context.Response.Write("{\"state\":-1,\"message\":\"" + x.Message + "\"}");
                }
            }
            else
            {
                context.Response.Write("{\"state\":-1,\"message\":\"操作错误!\"}");
            }
        }
Ejemplo n.º 4
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string id   = context.Request["pid"];
            string stop = context.Request["stop"];
            string sql  = null;

            if (!string.IsNullOrEmpty(id) && !string.IsNullOrEmpty(stop))
            {
                try
                {
                    //用户操作权限审核

                    if (SOSOshop.BLL.PowerPass.isPass("001009003"))
                    {
                        int sp = int.Parse(stop);

                        SOSOshop.BLL.Db db = new SOSOshop.BLL.Db();
                        if (sp == 1)
                        {
                            sql = "update product set Product_bShelves=1,Product_bStop=" + stop + " where Product_ID=" + id;//商品停用并下架
                        }
                        else
                        {
                            sql = "update product set Product_bStop=" + stop + " where Product_ID=" + id;//商品启用,不改变商品上下架状态
                        }
                        //context.Response.Write(sql);
                        int result = db.ExecuteNonQuery(sql);

                        //大表同步更新
                        //sql = "";



                        context.Response.Write("{\"state\":" + result + ",\"message\":\"已处理\"}");
                    }
                    else
                    {
                        context.Response.Write("{\"state\":-1,\"message\":\"对不起!您没有操作权限。\"}");
                    }
                }
                catch (Exception x)
                {
                    context.Response.Write("{\"state\":-1,\"message\":\"" + x.Message + sql + "\"}");
                }
            }
            else
            {
                context.Response.Write("{\"state\":-1,\"message\":\"操作错误!\"}");
            }
        }
Ejemplo n.º 5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     #region ajax 上架、下架、删除
     if (!string.IsNullOrEmpty(Request.QueryString["ajax"]))
     {
         if (SOSOshop.BLL.PowerPass.isPass("008011002"))
         {
             string id       = Request.Form["id"];
             string Shangjia = Request.Form["Shangjia"];
             string Del      = Request.Form["Del"];
             string s        = "";
             if (!string.IsNullOrEmpty(Shangjia) && Shangjia == "1")
             {
                 s = string.Format("update MemberIntegralGift set [State]=(case when State=1 then 2 when State=2 then 1 else State end) where [id]={0}", id);
             }
             else if (!string.IsNullOrEmpty(Del) && Del == "1")
             {
                 s = string.Format("update MemberIntegralGift set [State]=0 where [id]={0}", id);
             }
             try
             {
                 SOSOshop.BLL.Db db  = new SOSOshop.BLL.Db();
                 int             ret = db.ExecuteNonQuery(s);
                 if (ret > 0)
                 {
                     Response.Write("{\"state\":1,\"message\":\"处理成功!\"}");
                 }
                 else
                 {
                     Response.Write("{\"state\":0,\"message\":\"处理失败!\"}");
                 }
             }
             catch (Exception x)
             {
                 Response.Write("{\"state\":-2,\"message\":\"" + x.Message + "\"}");
             }
         }
         else
         {
             Response.Write("{\"state\":-1,\"message\":\"对不起,您没有编辑权限,请联系管理员!\"}");
         }
         Response.End();
     }
     #endregion
     if (!this.Page.IsPostBack)
     {
         SOSOshop.BLL.PromptInfo.Popedom("008011002");
         GetList();
     }
 }
Ejemplo n.º 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            #region ajax 修改积分
            if (!string.IsNullOrEmpty(Request.QueryString["ajax"]))
            {
                if (SOSOshop.BLL.PowerPass.isPass("008011001"))
                {
                    string id       = Request.Form["id"];
                    string integral = Request.Form["integral"];
                    string s        = string.Format("update MemberIntegralTemplate set [integral]={0} where [id]={1}", integral, id);
                    try
                    {
                        SOSOshop.BLL.Db db  = new SOSOshop.BLL.Db();
                        int             ret = db.ExecuteNonQuery(s);
                        if (ret > 0)
                        {
                            Response.Write("{\"state\":1,\"message\":\"更新成功!\"}");
                        }
                        else
                        {
                            Response.Write("{\"state\":0,\"message\":\"更新失败!\"}");
                        }
                    }
                    catch (Exception x)
                    {
                        Response.Write("{\"state\":-2,\"message\":\"" + x.Message + "\"}");
                    }
                }
                else
                {
                    Response.Write("{\"state\":-1,\"message\":\"对不起,您没有编辑权限,请联系管理员!\"}");
                }
                Response.End();
            }
            #endregion

            //修改积分倍数
            if (!string.IsNullOrEmpty(Request.Form["multiple"]))
            {
                bllo.update(Request.Form["id"], int.Parse(Request.Form["multiple"]));
                Response.End();
            }

            if (!this.Page.IsPostBack)
            {
                SOSOshop.BLL.PromptInfo.Popedom("008011001");
                GetList();
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 重新计算是否有在出售的otc品种
        /// </summary>
        public static void InitProduct_otc()
        {
            SOSOshop.BLL.Db bll = new SOSOshop.BLL.Db();
            DataSet         ds1 = bll.ExecuteDataSet("select id from Tag_PharmAttribute AS tag where tag_id=71 order by id");

            SOSOshop.BLL.DrugsBase.Tag_PharmAttribute ta = new SOSOshop.BLL.DrugsBase.Tag_PharmAttribute();
            for (int i = 0; i < ds1.Tables[0].Rows.Count; i++)
            {
                int    tagid = (int)ds1.Tables[0].Rows[i][0];
                int    count = ta.GetCount(tagid);
                string sql   = string.Format(@"IF EXISTS(SELECT * FROM Tag_PharmAttribute_Product_Count WHERE Tag_PharmAttribute_id={1})
UPDATE Tag_PharmAttribute_Product_Count SET Product_Count={0} WHERE Tag_PharmAttribute_id={1}
ELSE
INSERT Tag_PharmAttribute_Product_Count (Tag_PharmAttribute_id,Product_Count) VALUES({1},{0})", count, tagid);
                bll.ExecuteNonQuery(sql);
            }
        }
Ejemplo n.º 8
0
        public void ProcessRequest(HttpContext context)
        {
            string id   = context.Request["pid"];
            string stop = context.Request["verify"];
            string sql  = null;

            if (!string.IsNullOrEmpty(id) && !string.IsNullOrEmpty(stop))
            {
                try
                {
                    //用户操作权限审核
                    if (SOSOshop.BLL.PowerPass.isPass("001009002"))
                    {
                        int sp = int.Parse(stop);

                        SOSOshop.BLL.Db db = new SOSOshop.BLL.Db();
                        if (sp == 1)
                        {
                            sql = "update product set Product_bShelves=0,Product_bStop=0, shop_state=0 where Product_ID=" + id;//审核商品
                        }
                        //context.Response.Write(sql);
                        int result = db.ExecuteNonQuery(sql);

                        //大表同步更新
                        sql = "";

                        context.Response.Write("{\"state\":" + result + ",\"message\":\"已处理\"}");
                    }
                    else
                    {
                        context.Response.Write("{\"state\":-1,\"message\":\"对不起!您没有审核权限。\"}");
                    }
                }
                catch (Exception x)
                {
                    context.Response.Write("{\"state\":-1,\"message\":\"" + x.Message + "\"}");
                }
            }
            else
            {
                context.Response.Write("{\"state\":-1,\"message\":\"操作错误!\"}");
            }
        }
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string bshelves = context.Request["bshelves"];
            string state    = context.Request["state"];
            string pid      = context.Request["pid"];

            if (!string.IsNullOrEmpty(pid))
            {
                if (SOSOshop.BLL.PowerPass.isPass("001009004"))
                {
                    string s = string.Format("update product set Product_State='{1}' where [Product_ID]={2}", bshelves, state, pid);
                    try
                    {
                        SOSOshop.BLL.Db db  = new SOSOshop.BLL.Db();
                        int             ret = db.ExecuteNonQuery(s);
                        if (ret > 0)
                        {
                            AdminInfo adminModel = (AdminInfo)SOSOshop.BLL.AdministrorManager.Get();
                            SOSOshop.BLL.Logs.Log.LogAdminAdd(string.Format("{2}了商品:[{0}][{1}]", pid, new SOSOshop.BLL.Db().ExecuteScalar("SELECT Product_Name FROM dbo.Product WHERE Product_ID=" + pid), bshelves == "1" ? "上架" : "下架"), adminModel.AdminId, adminModel.AdminName, 1);
                            context.Response.Write("{\"state\":" + ret + ",\"message\":\"更新成功!\"}");
                        }
                        else
                        {
                            context.Response.Write("{\"state\":" + ret + ",\"message\":\"更新失败!\"}");
                        }
                    }
                    catch (Exception x)
                    {
                        context.Response.Write("{\"state\":-2,\"message\":\"" + x.Message + "\"}");
                    }
                }
                else
                {
                    context.Response.Write("{\"state\":-1,\"message\":\"对不起,您没有编辑权限,请联系管理员!\"}");
                }
            }
            else
            {
                context.Response.Write("{\"state\":-1,\"message\":\"未知错误!\"}");
            }
        }
Ejemplo n.º 10
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string id      = context.Request["pid"];
            string shelves = context.Request["shelves"];

            if (!string.IsNullOrEmpty(id) && !string.IsNullOrEmpty(shelves))
            {
                try
                {
                    //用户操作权限审核
                    if (SOSOshop.BLL.PowerPass.isPass("001009005"))
                    {
                        SOSOshop.BLL.Db db = new SOSOshop.BLL.Db();


                        string sql = string.Format("UPDATE product SET beactive='{0}' ,Product_bShelves='{1}' WHERE Product_ID={2}", shelves.Equals("1") ? "是" : "否", shelves, id);
                        //context.Response.Write(sql);
                        int       result     = db.ExecuteNonQuery(sql);
                        AdminInfo adminModel = (AdminInfo)SOSOshop.BLL.AdministrorManager.Get();
                        SOSOshop.BLL.Logs.Log.LogAdminAdd(string.Format("{2}了商品:[{0}][{1}]", id, new SOSOshop.BLL.Db().ExecuteScalar("SELECT Product_Name FROM dbo.Product WHERE Product_ID=" + id), shelves == "1" ? "上架" : "下架"), adminModel.AdminId, adminModel.AdminName, 1);
                        //大表同步更新
                        sql = "";

                        context.Response.Write("{\"state\":" + result + ",\"message\":\"已处理\"}");
                    }
                    else
                    {
                        context.Response.Write("{\"state\":-1,\"message\":\"对不起!您没有操作权限。\"}");
                    }
                }
                catch (Exception x)
                {
                    context.Response.Write("{\"state\":-1,\"message\":\"" + x.Message + "\"}");
                }
            }
            else
            {
                context.Response.Write("{\"state\":-1,\"message\":\"操作错误!\"}");
            }
        }
Ejemplo n.º 11
0
 /// <summary>
 /// 重新计算一下锁库数量
 /// </summary>
 public static void InitStock_Lock()
 {
     SOSOshop.BLL.Db bll = new SOSOshop.BLL.Db();
     bll.ExecuteNonQuery("UPDATE dbo.Stock_Lock SET Stock=dbo.fn_select_lockStock(Product_ID) WHERE Stock>0 AND Stock<>dbo.fn_select_lockStock(Product_ID)");
 }