public void UpdateStatus(string ids, int status) { if (string.IsNullOrWhiteSpace(ids)) { return; } SafeSC.CheckIDSEx(ids); DBCenter.UpdateSQL(TbName, "Status=" + status, PK + " IN(" + ids + ")"); }
//------------------------ 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); }
/// <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); }
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); }
/// <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)); }
/// <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)); } }
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); }
public static bool DelQuestion(string ids) { if (string.IsNullOrEmpty(ids)) { return(false); } SafeSC.CheckIDSEx(ids); return(DBCenter.DelByIDS("ZL_QUESTION", "QID", ids)); }
public void DelByIDS(string ids) { if (string.IsNullOrEmpty(ids)) { return; } SafeSC.CheckIDSEx(ids); DBCenter.DelByIDS(TbName, PK, ids); }
public void ChangeSure(string ids, int sure) { if (string.IsNullOrEmpty(ids)) { return; } SafeSC.CheckIDSEx(ids); DBCenter.UpdateSQL(TbName, "IsSure=" + sure, "ID IN (" + ids + ")"); }
/// <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 + ")")); }
/// <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); }
/// <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 + ")"); }
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); }
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); }
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)); }
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)); }
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 + ")")); }
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 + ")")); }
/// <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)); }
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)); }
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); }
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 + ")"); }
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)); }
//-----后台使用 /// <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); }
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); }
/// <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])); }
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); }
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); } }
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); }