Esempio 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 + ")");
 }
Esempio 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);
 }
Esempio 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);
        }
Esempio 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);
        }
Esempio 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));
 }
Esempio 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));
     }
 }
Esempio 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);
 }
Esempio 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));
 }
Esempio n. 9
0
 public void DelByIDS(string ids)
 {
     if (string.IsNullOrEmpty(ids))
     {
         return;
     }
     SafeSC.CheckIDSEx(ids);
     DBCenter.DelByIDS(TbName, PK, ids);
 }
Esempio 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 + ")");
 }
Esempio 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 + ")"));
 }
Esempio 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);
        }
Esempio 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 + ")");
 }
Esempio 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);
 }
Esempio 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);
 }
Esempio 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));
 }
Esempio 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));
        }
Esempio 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 + ")"));
 }
Esempio 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 + ")"));
 }
Esempio 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));
 }
Esempio 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));
        }
Esempio 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);
 }
Esempio 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 + ")");
 }
Esempio 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));
 }
Esempio 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);
        }
Esempio 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);
        }
Esempio 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]));
        }
Esempio 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);
        }
Esempio 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);
     }
 }
Esempio 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);
 }