Exemple #1
0
        /// <summary>
        /// 放入垃圾箱-1删除,0收件删除,1发件删除,2:标为已读
        /// </summary>
        public bool DropByids(string ids, int flag = 0)
        {
            string sqlStr = "";

            switch (flag)
            {
            case 0:
                sqlStr = "Update " + strTableName + " Set Status=1,IsDelInBox=1 Where MsgID in({0})";
                break;

            case 1:
                sqlStr = "Update " + strTableName + " Set IsDelSendbox=1 Where MsgID in({0})";
                break;

            case -1:
                sqlStr = "Update " + strTableName + " Set Status=-1 Where MsgID in({0})";
                break;

            default:
                break;
            }
            SafeSC.CheckIDSEx(ids);
            sqlStr = string.Format(sqlStr, ids);
            return(SqlHelper.ExecuteSql(sqlStr));
        }
Exemple #2
0
        public void UpdateStatus(string cmd, string ids)
        {
            if (string.IsNullOrEmpty(ids))
            {
                return;
            }
            int status = 1;

            switch (cmd)
            {
            case "stop":
                status = 0;
                break;

            case "back":
                status = -1;
                break;

            case "normal":
                status = 1;
                break;
            }
            SafeSC.CheckIDSEx(ids);
            DBCenter.UpdateSQL(strTableName, "isAudit=" + status, PK + " IN(" + ids + ")");
        }
Exemple #3
0
        /// <summary>
        /// 筛选用户商品,并更新购物车表信息
        /// </summary>
        /// <param name="cartid">PC下为Cookies值,APP中为用户ID,用于简化逻辑</param>
        /// <param name="proclass">类别</param>
        public DataTable SelByCartID(string cartid, int uid, int proClass, string ids = "")
        {
            //UpdateUidByCartID(cartid,uid);
            string fields = " A.*,B.LinPrice,B.PointVal,B.Thumbnails,B.ProClass,B.ProUnit,B.Allowed,B.Stock,B.FarePrice,B.LinPrice_Json,B.ParentID ";

            string where = "";
            SqlParameter[] sp = new SqlParameter[] { new SqlParameter("cartid", cartid) };
            if (uid > 0)
            {
                where = " (A.Cartid=@cartid OR A.UserID=" + uid + ")";
            }
            else
            {
                where = " A.Cartid=@cartid";
            }
            //--------------------------------------
            if (!string.IsNullOrEmpty(ids))
            {
                SafeSC.CheckIDSEx(ids); where += " AND A.ID IN (" + ids + ")";
            }
            if (proClass != -100)
            {
                where += " AND B.ProClass=" + proClass;
            }
            string sql = "SELECT " + fields + " FROM ZL_Cart A LEFT JOIN ZL_Commodities B ON A.ProID=B.ID WHERE " + where;
            //自营商品,店铺商品
            DataTable dt = SqlHelper.ExecuteTable(sql, sp);

            return(dt);
        }
Exemple #4
0
        public bool DelByIDS(string ids)
        {
            SafeSC.CheckIDSEx(ids);
            string sql = "DELETE FROM " + strTableName + " WHERE TemplateID IN (" + ids + ") AND Userid!=0";

            return(SqlHelper.ExecuteSql(sql));
        }
Exemple #5
0
        public bool DelByIDS(string ids)
        {
            SafeSC.CheckIDSEx(ids);
            string sql = "DELETE FROM " + TbName + " WHERE ID IN (" + ids + ")";

            return(SqlHelper.ExecuteSql(sql));
        }
Exemple #6
0
        public DataTable SelByIDS(string ids)
        {
            SafeSC.CheckIDSEx(ids);
            string sql = "SELECT * FROM " + strTableName + " WHERE ID IN (" + ids + ")";

            return(SqlHelper.ExecuteTable(CommandType.Text, sql));
        }
Exemple #7
0
        public void RemoveByIDS(string ids, int strid)
        {
            SafeSC.CheckIDSEx(ids);
            string sql = "Update ZL_User Set StructureID=REPLACE(StructureID,'," + strid + ",','') Where UserID in(" + ids + ")";

            SqlHelper.ExecuteNonQuery(CommandType.Text, sql);
        }
Exemple #8
0
        public static bool DelByIds(string ids)
        {
            SafeSC.CheckIDSEx(ids);
            string strsql = "DELETE FROM ZL_Grade WHERE GradeID IN (" + ids + ")";

            return(SqlHelper.ExecuteSql(strsql));
        }
Exemple #9
0
        /// <summary>
        /// 修改状态(带条件)
        /// </summary>
        /// <returns></returns>
        private bool UpDateStatus(string ids, int value, string wherestr = "")
        {
            SafeSC.CheckIDSEx(ids);
            string sql = "UPDATE " + TbName + " SET Auditing=" + value + " WHERE Noteid IN (" + ids + ")" + wherestr;

            return(SqlHelper.ExecuteSql(sql));
        }
        public bool UpdateByPaperID(string ids, int paperid)
        {
            SafeSC.CheckIDSEx(ids);
            string sql = "Update " + strTableName + " SET Paper_ID=0 WHERE Paper_Id=" + paperid + " Update " + strTableName + " SET Paper_Id=" + paperid + " WHERE p_id IN (" + ids + ")";

            return(SqlHelper.ExecuteSql(sql));
        }
Exemple #11
0
        public void DelByIDS(string ids)
        {
            SafeSC.CheckIDSEx(ids);
            string sql = "DELETE FROM " + strTableName + " WHERE " + PK + " IN(" + ids + ")";

            SqlHelper.ExecuteSql(sql);
        }
        public void U_DelByIDS(string ids, int uid)
        {
            SafeSC.CheckIDSEx(ids);
            string sql = "DELETE FROM " + strTableName + " WHERE " + PK + " IN(" + ids + ")" + " AND UserID=" + uid;

            SqlHelper.ExecuteSql(sql);
        }
Exemple #13
0
        /// <summary>
        /// 批量将邮件设为已阅读
        /// </summary>
        public void UnreadToRead(string ids, int uid)
        {
            SafeSC.CheckIDSEx(ids);
            string sql = "Update ZL_Message Set ReadUser=ReadUser+'," + uid + ",' Where msgid in (" + ids + ") And ReadUser not like '%," + uid + ",%'";

            SqlHelper.ExecuteSql(sql);
        }
Exemple #14
0
        public bool ReFromDraft(string ids, int uid)
        {
            SafeSC.CheckIDSEx(ids);
            string sql = "Update " + strTableName + " Set SaveData=0 Where MsgID in(" + ids + ") Where Sender=" + uid;

            return(SqlHelper.ExecuteSql(sql));
        }
Exemple #15
0
        public bool DelByUid(string ids, int uid)
        {
            SafeSC.CheckIDSEx(ids);
            string sql = "Delete From " + TbName + " Where ID in(" + ids + ") And UserID=" + uid;

            return(SqlHelper.ExecuteSql(sql));
        }
Exemple #16
0
        public DataTable Search(string ztype, string ids, string remind, int status, int uid)
        {
            List <SqlParameter> sp = new List <SqlParameter>();

            string where = " 1=1 ";
            if (!string.IsNullOrEmpty(ztype))
            {
                where += " AND A.ZType=@ztype"; sp.Add(new SqlParameter("ztype", ztype));
            }
            if (!string.IsNullOrEmpty(remind))
            {
                where += " AND A.Remind=@remind"; sp.Add(new SqlParameter("remind", remind));
            }
            if (status != -100)
            {
                where += " AND A.Status=" + status;
            }
            if (uid > 0)
            {
                where += " AND A.UserID=" + uid;
            }
            if (!string.IsNullOrEmpty(ids))
            {
                SafeSC.CheckIDSEx(ids); where += " AND A.ID IN (" + ids + ")";
            }
            return(DBCenter.JoinQuery("A.*,B.UserFace", TbName, "ZL_User_PlatView", "A.UserID=B.UserID", where, "A.ID DESC", sp.ToArray()));
        }
Exemple #17
0
        public DataTable GetSelectNodeANDRid(int Nodeid, string roleIDS)
        {
            SafeSC.CheckIDSEx(roleIDS);
            string sqlstr = "select * from ZL_NodeRole where NID=" + Nodeid + " and RID in (" + roleIDS + ")";

            return(SqlHelper.ExecuteTable(CommandType.Text, sqlstr));
        }
Exemple #18
0
        public PageSetting SelPage(int cpage, int psize, string ztype = "", string ids = "", string remind = "", int status = -100, int uid = 0)
        {
            string where = "1=1 ";
            List <SqlParameter> sp = new List <SqlParameter>();

            if (!string.IsNullOrEmpty(ztype))
            {
                where += " AND A.ZType=@ztype"; sp.Add(new SqlParameter("ztype", ztype));
            }
            if (!string.IsNullOrEmpty(ids))
            {
                SafeSC.CheckIDSEx(ids); where += " AND A.ID IN (" + ids + ")";
            }
            if (!string.IsNullOrEmpty(remind))
            {
                where += " AND A.Remind=@remind"; sp.Add(new SqlParameter("remind", remind));
            }
            if (status != -100)
            {
                where += " AND A.Status=" + status;
            }
            if (uid > 0)
            {
                where += " AND A.UserID=" + uid;
            }
            PageSetting setting = PageSetting.Single(cpage, psize, TbName, PK, where, PK + " DESC", sp);

            DBCenter.SelPage(setting);
            return(setting);
        }
Exemple #19
0
        public DataTable SelUFaceByIDS(string ids)
        {
            SafeSC.CheckIDSEx(ids);
            string sql = "Select UserID,TrueName,UserFace From " + TbView + " Where UserID IN(" + ids + ")";

            return(SqlHelper.ExecuteTable(CommandType.Text, sql));
        }
Exemple #20
0
        public bool UpdatePidByIDS(string ids, int id)
        {
            SafeSC.CheckIDSEx(ids);
            string sql = "UPDATE " + strTableName + " SET Pid=" + id + " WHERE SpecID IN (" + ids + ")";

            return(SqlHelper.ExecuteSql(sql));
        }
Exemple #21
0
        /// <summary>
        /// 设置隐藏
        /// </summary>
        /// <returns></returns>
        public bool ChangeStatus(string ids, int istrue)
        {
            SafeSC.CheckIDSEx(ids);
            string sql = "UPDATE " + strTableName + " SET IsTrue=" + istrue + " WHERE  TemplateID IN (" + ids + ") AND Userid!=0";

            return(SqlHelper.ExecuteSql(sql));
        }
Exemple #22
0
        public void RealDelByIDS(string ids)
        {
            SafeSC.CheckIDSEx(ids);
            string sql = "DELETE FROM " + TbName + " WHERE PaymentID IN (" + ids + ")";

            SqlHelper.ExecuteSql(sql);
        }
Exemple #23
0
        public bool SetEnableByIds(string ids, int flag)
        {
            SafeSC.CheckIDSEx(ids);
            string sql = "Update " + strTableName + " SET IsTrue=" + flag + " WHERE PageNodeid IN (" + ids + ")";

            return(SqlHelper.ExecuteSql(sql));
        }
Exemple #24
0
        public bool DelByIDS(string ids)
        {
            SafeSC.CheckIDSEx(ids);
            string sql = "Delete From [dbo].[ZL_UserRecei] Where ID IN (" + ids + ")";

            return(SqlHelper.ExecuteSql(sql));
        }
Exemple #25
0
        public bool DeleteBylist(string ids)
        {
            SafeSC.CheckIDSEx(ids);
            string sqlStr = "delete from ZL_Manufacturers where (id in (" + ids + "))";

            return(SqlHelper.ExecuteSql(sqlStr, null));
        }
Exemple #26
0
        public static bool DelByIDS(string ids)
        {
            SafeSC.CheckIDSEx(ids);
            string sql = "DELETE FROM ZL_GuestBook WHERE GID IN (" + ids + ")";

            DBCenter.DB.ExecuteNonQuery(new SqlModel(sql, null));
            return(true);
        }
Exemple #27
0
        /// <summary>
        /// 根据类型读取指定编号订单
        /// </summary>
        public DataTable GetOrderbyOrderNo(string OrderNo, string type)
        {
            SafeSC.CheckIDSEx(type);
            SqlParameter[] sp     = new SqlParameter[] { new SqlParameter("OrderNo", OrderNo) };
            string         strSql = "select * from ZL_Orderinfo where OrderNo = @OrderNo AND Ordertype in(" + type + ") order by(id) desc";

            return(SqlHelper.ExecuteTable(CommandType.Text, strSql, sp));
        }
Exemple #28
0
        /// <summary>
        /// 恢复收件箱,发件箱
        /// </summary>
        public bool ReFromRecycle(string ids, int uid)
        {
            SafeSC.CheckIDSEx(ids);
            string suid = "'," + uid + ",'";
            string sql  = "Update " + strTableName + " Set DelIDS=REPLACE(REPLACE(DelIDS," + suid + ",','),',,',',') Where MsgID in(" + ids + ")";//将用户的ID从DelIDS中移除,并且将,,替换为,保持格式正常

            return(SqlHelper.ExecuteSql(sql));
        }
Exemple #29
0
        public DataTable GetOrderbyOrderlist(string ids)
        {
            SafeSC.CheckIDSEx(ids);
            string sqlStr = "select * from ZL_Orderinfo where id in (" + ids + ") order by(id) desc";

            //string sqlStr = "select PaymentNum from zl_payment where paymentid=" + idlist;
            return(SqlHelper.ExecuteTable(CommandType.Text, sqlStr, null));
        }
Exemple #30
0
        /// <summary>
        /// 更改管理员锁定状态(不包含超管)
        /// </summary>
        /// <param name="ids"></param>
        /// <param name="islock">true:1锁定</param>
        /// <returns></returns>
        public bool LockAdmin(string ids, bool islock)
        {
            SafeSC.CheckIDSEx(ids);
            int isLocked = islock ? 1 : 0;

            DBCenter.UpdateSQL(tbName, "IsLock=" + isLocked, "AdminID IN(" + ids + ") AND AdminID!=1", null);
            return(true);
        }