Ejemplo n.º 1
0
 public void UpdateStatus(string ids, int status)
 {
     if (string.IsNullOrWhiteSpace(ids))
     {
         return;
     }
     SafeSC.CheckIDSEx(ids);
     DBCenter.UpdateSQL(TbName, "Status=" + status, PK + " IN(" + ids + ")");
 }
Ejemplo n.º 2
0
 //------------------------
 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);
 }
Ejemplo n.º 3
0
        /// <summary>
        /// 查看是否有权限 有则返回True否则返回False code为权限代码
        /// </summary>
        public static bool SelReturnByIDs(string ids, string code)
        {
            SafeSC.CheckIDSEx(ids);
            DataTable dt = SqlHelper.ExecuteTable(CommandType.Text, "select * from ZL_UserPurview where roleid in(" + ids + ")");
            DataView  dv = dt.DefaultView;

            dv.RowFilter = "PurviewCode='" + code + "'";
            return(dv.Count > 0);
        }
Ejemplo n.º 4
0
        public bool UpdateByField(string field, string value, int id)
        {
            SafeSC.CheckDataEx(field);
            string sql = "Update " + strTableName + " Set " + field + "=@value Where ID=" + id;

            SqlParameter[] sp = new SqlParameter[] { new SqlParameter("value", value) };
            SqlHelper.ExecuteNonQuery(CommandType.Text, sql, sp);
            return(true);
        }
Ejemplo n.º 5
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));
 }
Ejemplo n.º 6
0
 /// <summary>
 /// 为会员组指定模型(先删除绑定,再为其加入)
 /// </summary>
 public void SetGroupModel(int GroupID, string modelids)
 {
     SafeSC.CheckIDSEx(modelids);
     DelGroupModel(GroupID);
     foreach (string mid in modelids.Split(','))
     {
         AddGroupModels(GroupID, DataConvert.CLng(mid));
     }
 }
Ejemplo n.º 7
0
 public bool DelByids(string ids)
 {
     if (SafeSC.CheckIDS(ids))
     {
         string sql = "Delete From " + TbName + " Where ID IN (" + ids + ")";
         return(SqlHelper.ExecuteNonQuery(CommandType.Text, sql) > 0);
     }
     return(false);
 }
Ejemplo n.º 8
0
 public static bool DelQuestion(string ids)
 {
     if (string.IsNullOrEmpty(ids))
     {
         return(false);
     }
     SafeSC.CheckIDSEx(ids);
     return(DBCenter.DelByIDS("ZL_QUESTION", "QID", ids));
 }
Ejemplo n.º 9
0
 public void DelByIDS(string ids)
 {
     if (string.IsNullOrEmpty(ids))
     {
         return;
     }
     SafeSC.CheckIDSEx(ids);
     DBCenter.DelByIDS(TbName, PK, ids);
 }
Ejemplo n.º 10
0
 public void ChangeSure(string ids, int sure)
 {
     if (string.IsNullOrEmpty(ids))
     {
         return;
     }
     SafeSC.CheckIDSEx(ids);
     DBCenter.UpdateSQL(TbName, "IsSure=" + sure, "ID IN (" + ids + ")");
 }
Ejemplo n.º 11
0
 /// <summary>
 /// 用于用户中心OrderList
 /// </summary>
 /// <param name="ids">订单的IDS</param>
 public DataTable U_SelForOrderList(string ids)
 {
     if (string.IsNullOrEmpty(ids))
     {
         return(new DataTable());
     }
     SafeSC.CheckIDSEx(ids);
     return(DBCenter.Sel("ZL_CartProView", "ID IN (" + ids + ")"));
 }
Ejemplo n.º 12
0
        /// <summary>
        /// 彻底删除,草稿(删记录)
        /// </summary>
        public void RealDelByIDS(string ids, int uid)
        {
            SafeSC.CheckIDSEx(ids);
            string suid = "'," + uid + ",'";
            string sql  = "Update " + strTableName + " Set RealDelIDS =ISNULL(RealDelIDS,'') +" + suid + " Where " + PK + " in(" + ids + ")";

            SqlHelper.ExecuteSql(sql);
            DelAttachAndRecord(ids, uid);
        }
Ejemplo n.º 13
0
 /// <summary>
 /// 审核贴子
 /// </summary>
 public void CheckByIDS(string ids)
 {
     if (string.IsNullOrEmpty(ids))
     {
         return;
     }
     SafeSC.CheckIDSEx(ids);
     DBCenter.UpdateSQL(TbName, "Status=" + (int)ConStatus.Audited, "ID IN (" + ids + ")");
 }
Ejemplo n.º 14
0
 public static bool Add(M_AdminInfo model)
 {
     model.AdminName = model.AdminName.Replace(" ", "");
     if (!SafeSC.CheckUName(model.AdminName))
     {
         throw new Exception("用户名含有非法字符!!");
     }
     DBCenter.Insert(model);
     return(true);
 }
Ejemplo n.º 15
0
 public bool ChangeRecycle(string ids, int isdel)
 {
     if (string.IsNullOrEmpty(ids))
     {
         return(false);
     }
     SafeSC.CheckIDSEx(ids);
     DBCenter.UpdateSQL(TbName, "IsDel=" + isdel, "PaymentID IN (" + ids + ")");
     return(true);
 }
Ejemplo n.º 16
0
 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));
 }
Ejemplo n.º 17
0
        public DataTable GetSpecContent(int SpecID, string Order, string Conditions)
        {
            SafeSC.CheckDataEx(Order, Conditions);
            string strSql = string.Format("select a.* from ZL_CommonModel a where a.SpecialID Like @SpecID order by {0} {1}", Order, Conditions);

            SqlParameter[] sp = new SqlParameter[] {
                new SqlParameter("@SpecID", "%," + SpecID + ",%")
            };
            return(SqlHelper.ExecuteTable(CommandType.Text, strSql, sp));
        }
Ejemplo n.º 18
0
 public DataTable SelByIDS(string ids)
 {
     ids = StrHelper.PureIDSForDB(ids);
     if (string.IsNullOrEmpty(ids))
     {
         return(null);
     }
     SafeSC.CheckDataEx(ids);
     return(SqlHelper.ExecuteTable("SELECT * FROM " + TbName + " WHERE c_id IN(" + ids + ")"));
 }
Ejemplo n.º 19
0
 public DataTable SelByIDS(string ids)
 {
     ids = StrHelper.PureIDSForDB(ids);
     if (string.IsNullOrEmpty(ids))
     {
         return(null);
     }
     SafeSC.CheckIDSEx(ids);
     return(SqlHelper.ExecuteTable(CommandType.Text, "SELECT * FROM " + strTableName + " WHERE ID IN (" + ids + ")"));
 }
Ejemplo n.º 20
0
 /// <summary>
 /// 修改贴子状态,用于删除等,用于用户操作
 /// </summary>
 public bool UpdateStatus(int cateid, string ids, int status, int uid = 0)
 {
     SafeSC.CheckIDSEx(ids);
     string where = "ID IN(" + ids + ") And CateID=" + cateid;
     if (uid != 0)
     {
         where += " AND CUser="******"Status=" + status, where));
 }
Ejemplo n.º 21
0
        public DataTable SelByIDS(string ids)
        {
            if (!SafeSC.CheckIDS(ids))
            {
                return(new DataTable());
            }
            string sql = "SELECT * FROM " + strTableName + " WHERE k_id IN (" + ids + ")";

            return(SqlHelper.ExecuteTable(sql));
        }
Ejemplo n.º 22
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);
 }
Ejemplo n.º 23
0
 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 + ")");
 }
Ejemplo n.º 24
0
 public DataTable SelByIDS(string nodeids, string nodeType = "")
 {
     SafeSC.CheckIDSEx(nodeids);
     string where = "NodeID IN (" + nodeids + ")";
     if (!string.IsNullOrEmpty(nodeType))
     {
         SafeSC.CheckIDSEx(nodeType); where += " AND NodeType IN (" + nodeType + ")";
     }
     return(DBCenter.Sel(TbName, where, defOrder));
 }
Ejemplo n.º 25
0
        //-----后台使用
        /// <summary>
        /// 彻底删除数据库记录与相关附件
        /// </summary>
        public void DelByAdmin(string ids) //删除数据库记录与相关附件
        {
            SafeSC.CheckIDSEx(ids);
            string    sql = "Select MsgID,AttachMent From " + strTableName + " Where MsgID in(" + ids + ")";
            DataTable dt  = SqlHelper.ExecuteTable(CommandType.Text, sql);

            DelAttach(dt);
            string delSql = "Delete From " + strTableName + " Where MsgID in(" + ids + ")";

            SqlHelper.ExecuteSql(delSql);
        }
Ejemplo n.º 26
0
        public void UpdateByField(string field, string value, string ids)
        {
            SafeSC.CheckDataEx(field);
            SafeSC.CheckIDSEx(ids);
            List <SqlParameter> sp = new List <SqlParameter>()
            {
                new SqlParameter("value", value)
            };

            DBCenter.UpdateSQL(strTableName, field + " = @value", PK + " IN (" + ids + ")", sp);
        }
Ejemplo n.º 27
0
        /// <summary>
        ///根据问题类型统计数量
        /// </summary>
        public int GetCountByQueType(string ids)
        {
            if (string.IsNullOrEmpty(ids))
            {
                return(0);
            }
            SafeSC.CheckIDSEx(ids);
            string sql = "SELECT COUNT(*) FROM " + strTableName + " WHERE QueType IN (" + ids + ")";

            return(DataConvert.CLng(DBCenter.DB.ExecuteTable(new SqlModel(sql, null)).Rows[0][0]));
        }
Ejemplo n.º 28
0
        public void DelByIDS(string ids)
        {
            if (string.IsNullOrEmpty(ids))
            {
                return;
            }
            SafeSC.CheckIDSEx(ids);
            string sql = "DELETE FROM " + TbName + " WHERE ID IN (" + ids + ")";

            SqlHelper.ExecuteSql(sql);
        }
Ejemplo n.º 29
0
 public B_Label()
 {
     dir         = function.VToP(vdir);
     dirfilename = dir + "Directory.label";
     if (!File.Exists(dirfilename))
     {
         SafeSC.CreateDir(vdir);
         DataSet ds = new DataSet("NewDataSet");
         ds.WriteXml(dirfilename);
     }
 }
Ejemplo n.º 30
0
 public DataTable SelByIDS(string ids)
 {
     if (!string.IsNullOrEmpty(ids))
     {
         SafeSC.CheckIDSEx(ids);
         ids = ids.TrimEnd(new char[] { ',' });
         string sql = "Select * From " + strTableName + " Where SpecID IN (" + ids + ")";
         return(SqlHelper.ExecuteTable(CommandType.Text, sql));
     }
     return(null);
 }