예제 #1
0
        /// <summary>
        /// 清空目标站点页面,拷贝模板,并返回新加入的模板index页面的guid
        /// </summary>
        public string CopyTlp(int tlpID, M_Design_SiteInfo sfMod)
        {
            if (tlpID < 1 || sfMod == null || sfMod.ID < 1)
            {
                return("");
            }
            //后期扩展为只覆盖指定页??
            DBCenter.DelByWhere("ZL_Design_Page", "SiteID=" + sfMod.ID);
            string    guid = "";
            DataTable dt   = SelByTlpID(tlpID);

            dt.TableName = pageTbName;
            dt.Columns.Remove("ID");
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                DataRow dr = dt.Rows[i];
                dr["Guid"]   = System.Guid.NewGuid().ToString();
                dr["UserID"] = sfMod.UserID;
                dr["SiteID"] = sfMod.ID;
                //dr["Comp"] = dr["Comp"].ToString().Replace("/UploadFiles/", B_Design_SiteInfo.GetSiteUpDir(sfMod.ID));
                string path = dt.Rows[i]["Path"].ToString().ToLower().Replace(" ", "");
                if (path.Equals("/") || path.Equals("/index"))
                {
                    guid = dr["Guid"].ToString();
                }
            }
            SqlHelper.Insert_Bat(dt, SqlHelper.ConnectionString);
            return(guid);
        }
예제 #2
0
        public void Del(int suid, int tuid)
        {
            List <SqlParameter> sp = new List <SqlParameter>();

            string where = "UserID=" + suid + " AND TUserID=" + tuid;
            DBCenter.DelByWhere(TbName, where);
        }
예제 #3
0
        /// <summary>
        /// 消赞操作
        /// </summary>
        public bool DelLike(int uid, int infoID, string source)
        {
            List <SqlParameter> splist = new List <SqlParameter> {
                new SqlParameter("source", source)
            };

            return(DBCenter.DelByWhere(TbName, "CUser="******" AND MsgID=" + infoID + " AND Source=@source", splist));
        }
예제 #4
0
 /// <summary>
 /// 删除节点,并删除该节点的子节点
 /// </summary>
 public void DelNode(int NodeID)
 {
     if (NodeID < 1)
     {
         throw new Exception("NodeID不能小于或等于0");
     }
     DBCenter.DelByWhere(TbName, "NodeID=" + NodeID + " OR ParentID=" + NodeID);
 }
예제 #5
0
파일: B_UserAPP.cs 프로젝트: baixue001/IPS
        public void DelByUid(int uid, string plat)
        {
            List <SqlParameter> sp = new List <SqlParameter>()
            {
                new SqlParameter("plat", plat.Trim())
            };

            DBCenter.DelByWhere(TbName, "UserID=" + uid + " AND SourcePlat=@plat", sp);
        }
예제 #6
0
파일: B_UserAPP.cs 프로젝트: baixue001/IPS
        public void DelByOpenID(string openid)
        {
            List <SqlParameter> sp = new List <SqlParameter>()
            {
                new SqlParameter("openid", openid.Trim())
            };

            DBCenter.DelByWhere(TbName, "OpenID=@openid", sp);
        }
예제 #7
0
파일: B_Comment.cs 프로젝트: baixue001/IPS
 //------------------------
 public void U_Del(int uid, string ids)
 {
     if (string.IsNullOrEmpty(ids))
     {
         return;
     }
     SafeSC.CheckIDSEx(ids);
     DBCenter.DelByWhere(TbName, "CommentID IN (" + ids + ") AND UserID=" + uid);
 }
예제 #8
0
 public void Del(string ids)
 {
     if (string.IsNullOrEmpty(ids))
     {
         return;
     }
     SafeSC.CheckIDSEx(ids);
     DBCenter.DelByWhere(TbName, PK + " IN (" + ids + ")");
 }
예제 #9
0
 /// <summary>
 /// 删除不属于指定会员模型ID组合的会员模型记录
 /// </summary>
 public bool DelGroupModel(int GroupID, string modelids = "")
 {
     string where = "GroupID=" + GroupID;
     if (!string.IsNullOrEmpty(modelids))
     {
         SafeSC.CheckIDSEx(modelids); where += " AND GroupModel IN (" + modelids + ")";
     }
     return(DBCenter.DelByWhere("ZL_GroupModel", where));
 }
예제 #10
0
파일: B_Node.cs 프로젝트: baixue001/IPS
 /// <summary>
 /// 删除节点,并删除该节点的子节点
 /// </summary>
 public void DelNode(string nids)
 {
     if (string.IsNullOrEmpty(nids))
     {
         return;
     }
     SafeSC.CheckIDSEx(nids);
     DBCenter.DelByWhere(TbName, "NodeID IN(" + nids + ")");
 }
예제 #11
0
파일: B_WX_User.cs 프로젝트: baixue001/IPS
        /// <summary>
        /// 取消订阅,移除微信用户信息,移除绑定信息
        /// </summary>
        public bool DelByOpenid(string openid)
        {
            List <SqlParameter> sp = new List <SqlParameter> {
                new SqlParameter("@openid", openid)
            };

            DBCenter.DelByWhere(TbName, "OpenID=@openid", sp);
            new B_UserAPP().DelByOpenID(openid);
            return(true);
        }
예제 #12
0
 public void DelByIDS(string ids, int uid = 0)
 {
     SafeSC.CheckIDSEx(ids);
     string where = "ID IN(" + ids + ") ";
     if (uid > 0)
     {
         where += " AND UserID=" + uid;
     }
     DBCenter.DelByWhere(TbName, where);
 }
예제 #13
0
파일: B_Node.cs 프로젝트: baixue001/IPS
 public void DelModelTemplate(int NodeID, string ModelIDs)
 {
     ModelIDs = StrHelper.PureIDSForDB(ModelIDs);
     if (string.IsNullOrEmpty(ModelIDs))
     {
         return;
     }
     SafeSC.CheckIDSEx(ModelIDs);
     DBCenter.DelByWhere("ZL_Node_ModelTemplate", "NodeID=" + NodeID + " AND ModelID Not IN (" + ModelIDs + ")");
 }
예제 #14
0
파일: B_Favorite.cs 프로젝트: baixue001/IPS
 public bool DelByIDS(string ids, int uid = 0)
 {
     SafeSC.CheckIDSEx(ids);
     string where = PK + " IN (" + ids + ")";
     if (uid > 0)
     {
         where += " AND Owner=" + uid;
     }
     return(DBCenter.DelByWhere(TbName, where));
 }
예제 #15
0
    protected void Save_Btn_Click(object sender, EventArgs e)
    {
        M_UserInfo   mu    = buser.GetLogin();
        M_Shop_Bonus bnMod = new M_Shop_Bonus();
        DataTable    dt    = JsonConvert.DeserializeObject <DataTable>(Data_Hid.Value);

        if (Mid > 0)
        {
            bnMod = bnBll.SelReturnModel(Mid);
        }
        bnMod.Alias       = Alias_T.Text.Trim();
        bnMod.IsDefault   = IsDefault_Chk.Checked ? 1 : 0;
        bnMod.ParentID    = 0;
        bnMod.Remark      = Remark_T.Text;
        bnMod.BonusType   = Convert.ToInt32(dt.Rows[0]["BonusType"]);
        bnMod.BonusValue1 = DataConvert.CDouble(dt.Rows[0]["BonusValue1"]).ToString("F2");

        if (bnMod.IsDefault == 1)
        {
            DBCenter.UpdateSQL(bnMod.TbName, "IsDefault=0", "IsDefault=1");
        }
        if (bnMod.ID > 0)
        {
            bnBll.UpdateByID(bnMod);
        }
        else
        {
            bnMod.StoreID = mu.SiteID;
            bnMod.ID      = bnBll.Insert(bnMod);
        }
        //更新子类目信息
        if (dt.Rows.Count > 1)
        {
            string ids = StrHelper.GetIDSFromDT(dt, "ID");
            DBCenter.DelByWhere(bnMod.TbName, "ID NOT IN (" + ids + ") AND ParentID=" + bnMod.ID);
            for (int i = 1; i < dt.Rows.Count; i++)
            {
                //为防止信息修改,增加店铺验证
                DataRow      dr    = dt.Rows[i];
                M_Shop_Bonus model = new M_Shop_Bonus().GetModelFromReader(dr);
                model.ParentID = bnMod.ID;
                model.StoreID  = bnMod.StoreID;
                if (model.ID > 0)
                {
                    bnBll.UpdateByID(model);
                }
                else
                {
                    model.ID = bnBll.Insert(model);
                }
            }
        }

        function.WriteSuccessMsg("操作成功", "Bonus.aspx");
    }
예제 #16
0
 public void DelByIDS(string ids, int storeid = -100)
 {
     if (string.IsNullOrEmpty(ids))
     {
         return;
     }
     SafeSC.CheckIDSEx(ids);
     string where = "ID IN (" + ids + ") ";
     if (storeid != -100)
     {
         where += " AND StoreID=" + storeid;
     }
     DBCenter.DelByWhere(TbName, where);
 }
예제 #17
0
 public void DelByIDS(string ids, int uid = 0)
 {
     if (string.IsNullOrEmpty(ids))
     {
         return;
     }
     SafeSC.CheckIDSEx(ids);
     string where = PK + " IN (" + ids + ") ";
     if (uid > 0)
     {
         where += " AND UserID=" + uid;
     }
     DBCenter.DelByWhere(TbName, where);
 }
예제 #18
0
파일: B_Arrive.cs 프로젝트: baixue001/IPS
 public bool DelByIDS(string ids, int storeID = -100)
 {
     if (string.IsNullOrEmpty(ids))
     {
         return(false);
     }
     SafeSC.CheckIDSEx(ids);
     string where = PK + " IN (" + ids + ")";
     if (storeID != -100)
     {
         where += " AND StoreID=" + storeID;
     }
     return(DBCenter.DelByWhere(TbName, where));
 }
예제 #19
0
 public bool DelByIDS(string ids, int uid = -100)
 {
     string where = " 1=1 ";
     if (string.IsNullOrEmpty(ids))
     {
         return(false);
     }
     if (uid != -100)
     {
         where += " AND CUser="******" AND ID IN (" + ids + ")";
     SafeSC.CheckIDSEx(ids);
     return(DBCenter.DelByWhere(TbName, where));
 }
예제 #20
0
        public void BatInsert(int proID, string json)
        {
            //先清除再重新写入
            DBCenter.DelByWhere(TbName, "ProID=" + proID);
            if (string.IsNullOrEmpty(json) || json.Equals("[]"))
            {
                return;
            }
            DataTable dt = JsonConvert.DeserializeObject <DataTable>(json);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                M_Shop_Present ptMod = new M_Shop_Present().GetModelFromReader(dt.Rows[i]);
                ptMod.ProID = proID;
                Insert(ptMod);
            }
        }
예제 #21
0
        public bool DelByIDS(string cartid, string uname, string ids)
        {
            SafeSC.CheckIDSEx(ids);
            List <SqlParameter> sp = new List <SqlParameter>()
            {
                new SqlParameter("cartid", cartid), new SqlParameter("uname", uname)
            };

            string where = " ID IN (" + ids + ") ";
            if (!string.IsNullOrEmpty(uname))
            {
                where += " AND (CartID=@cartid OR UserName=@uname)";
            }
            else
            {
                where += " AND CartID=@cartid";
            }
            return(DBCenter.DelByWhere(TbName, where, sp));
        }
예제 #22
0
파일: B_Favorite.cs 프로젝트: baixue001/IPS
 public void U_Del(int uid, int infoID, int type)
 {
     string where = "Owner=" + uid + " AND InfoID=" + infoID + " AND FavoriType=" + type;
     DBCenter.DelByWhere(TbName, where);
 }
예제 #23
0
 public void DelByWhere(string where, List <SqlParameter> splist)
 {
     DBCenter.DelByWhere(TbName, where, splist);
 }
예제 #24
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ExHelper.CheckUserAuth("cash");
        if (function.isAjax())
        {
            //string action = Request.Form["action"];
            string     result = "";
            M_UserInfo mu     = buser.GetLogin();
            //直接生成新单,无效的订单一定时间自动清理(未付款)
            int    uid  = DataConvert.CLng(Request.Form["uid"]);
            string cart = Request.Form["cart"];
            if (string.IsNullOrEmpty(cart))
            {
                throw new Exception("未指定消费项目");
            }
            if (string.IsNullOrEmpty(Request.Form["uid"]))
            {
                throw new Exception("未指定用户");
            }
            //---------------------------根据信息生成订单
            DataTable        cartDT = JsonConvert.DeserializeObject <DataTable>(cart);
            M_User_StoreUser suMod  = new M_User_StoreUser();
            if (uid > 0)
            {
                suMod = suBll.SelModelByUid(uid, mu.SiteID);
            }
            List <M_CartPro> cpList = new List <M_CartPro>();
            //-----------------
            M_OrderList orderMod = null;
            if (Mid > 0)
            {
                orderMod = orderBll.SelReturnModel(Mid);
            }
            else
            {
                orderMod = orderBll.NewOrder(mu, M_OrderList.OrderEnum.Normal);
            }
            //每次均重新获取
            orderMod.Userid       = mu.UserID;
            orderMod.AddUser      = mu.UserName;//收银员名称
            orderMod.Receiver     = suMod.UserID.ToString();
            orderMod.Rename       = suMod.HoneyName;
            orderMod.StoreID      = mu.SiteID;
            orderMod.Ordersamount = 0;
            foreach (DataRow dr in cartDT.Rows)
            {
                int       cid   = Convert.ToInt32(dr["ID"]);
                M_CartPro cpMod = new M_CartPro();
                if (cid > 0)
                {
                    cpMod = cpBll.SelReturnModel(cid);
                    if (cpMod.Orderlistid != Mid)
                    {
                        throw new Exception("购物车数据与订单不匹配");
                    }
                }
                else
                {
                    cpMod.StoreID = mu.SiteID;
                }
                //-------------------
                M_Product proMod = proBll.GetproductByid(Convert.ToInt32(dr["ProID"]));
                cpMod.ProID            = proMod.ID;
                cpMod.Proname          = proMod.Proname;
                cpMod.Danwei           = proMod.ProUnit;
                cpMod.Shijia           = proMod.LinPrice;
                cpMod.Pronum           = Convert.ToInt32(dr["Pronum"]);
                cpMod.AllMoney         = cpMod.Shijia * cpMod.Pronum;
                orderMod.Ordersamount += cpMod.AllMoney;
                //-------------------------
                cpMod.Username  = suMod.HoneyName;
                cpMod.code      = DataConvert.CStr(dr["code"]);      //技师ID
                cpMod.Attribute = DataConvert.CStr(dr["Attribute"]); //技师姓名
                cpList.Add(cpMod);
                //city,bindpro,
            }
            if (orderMod.id > 0)
            {
                orderBll.UpdateByID(orderMod);
            }
            else
            {
                orderMod.id = orderBll.insert(orderMod);
            }
            string cpIds = "";
            foreach (M_CartPro cpMod in cpList)
            {
                if (cpMod.ID > 0)
                {
                    cpBll.UpdateByID(cpMod);
                }
                else
                {
                    cpMod.Orderlistid = orderMod.id;
                    cpMod.ID          = cpBll.GetInsert(cpMod);
                }
                cpIds += cpMod.ID + ",";
            }
            //删除未提交的购物车信息
            cpIds = cpIds.TrimEnd(',');
            DBCenter.DelByWhere("ZL_CartPro", "OrderListID=" + orderMod.id + " AND ID NOT IN (" + cpIds + ")");
            result = orderMod.id.ToString();

            //---------------------------------------------


            Response.Clear();
            Response.Write(result);
            Response.Flush(); Response.End(); return;
        }
        if (!IsPostBack)
        {
            M_UserInfo mu = buser.GetLogin();
            if (Mid > 0)
            {
                M_OrderList orderMod = orderBll.SelReturnModel(Mid);
                if (orderMod.StoreID != mu.SiteID)
                {
                    function.WriteErrMsg("你无权操作该订单");
                }
                if (orderMod.OrderStatus != (int)M_OrderList.StatusEnum.Normal)
                {
                    function.WriteErrMsg("该订单不可修改");
                }
                DataTable cpDT = cpBll.SelByOrderID(orderMod.id);
                Cart_Hid.Value = JsonConvert.SerializeObject(cpDT);
            }
        }
    }
예제 #25
0
 public bool Del(string strWhere)
 {
     return(DBCenter.DelByWhere(strTableName, strWhere));
 }
예제 #26
0
 public void U_Del(int uid, int id)
 {
     DBCenter.DelByWhere(TbName, "CUser="******" AND ID=" + id);
 }
예제 #27
0
 public void U_Del(int uid, string ids)
 {
     SafeSC.CheckIDSEx(ids);
     DBCenter.DelByWhere(TbName, "ID IN (" + ids + ") AND UserID=" + uid);
 }
예제 #28
0
 public void U_Del(int uid, int id)
 {
     DBCenter.DelByWhere(TbName, PK + "=" + id + " AND UserID=" + uid);
 }
예제 #29
0
 public void ClearRecycle()
 {
     DBCenter.DelByWhere(TbName, "Aside=1");
 }
예제 #30
0
 /// <summary>
 /// 清空回收站
 /// </summary>
 public bool DelAll(int cateid)
 {
     return(DBCenter.DelByWhere(TbName, "CateID = " + cateid + "AND Status=" + (int)ConStatus.Recycle));
 }