/// <summary> /// 推广--获取用户具有权限的城市过滤条件对象 /// </summary> /// <param name="userid"></param> /// <returns></returns> public BusinessFilter GetCityFilterByPromotion(int userid) { Wicresoft.DataAccess.SQLServer dal = new Wicresoft.DataAccess.SQLServer(); BusinessFilter filter = new BusinessFilter("Dictionary"); string sql = string.Format("select a.FK_Center,b.parent as CityID,b.name from AssistantDataPermission as a left join [Dictionary] as b on a.fk_center = b.pkid where a.fk_center <> -1 and a.fk_Assistant =" + userid); DataTable dt = dal.ExcuteDataTable(new DataTable(), sql, CommandType.Text); //if (temp != null && temp.Rows.Count != 0) //{ // filter.AddCustomerFilter("Dictionary.PKID IN (" + temp.Rows[0]["CityID"].ToString() + ")", AndOr.AND); //} string strCity = string.Empty; for (int i = 0; i < dt.Rows.Count; i++) { if (dt.Rows[i]["CityID"] != null && dt.Rows[i]["CityID"].ToString() != string.Empty) { strCity += "," + dt.Rows[i]["CityID"].ToString(); } } if (strCity != string.Empty) { strCity = strCity.Substring(1, strCity.Length - 1); filter.AddCustomerFilter("Dictionary.PKID IN (" + strCity + ")", AndOr.AND); } return(filter); }
/* Andy Modify 2009-03-08 */ public string GetAuthorizedADTerracePKID(int userid) { Wicresoft.DataAccess.SQLServer dal = new Wicresoft.DataAccess.SQLServer(); string sql = string.Format(sp_GetHaveDataPermissionADTerraceOnUser, userid); return(dal.ExecuteScalar(sql, CommandType.Text).ToString()); }
public string GetAuthorizedCitiesPKID(int userid) { Wicresoft.DataAccess.SQLServer dal = new Wicresoft.DataAccess.SQLServer(); string sql = string.Format(sp_GetUserDataPermissionOnCity, userid); return(dal.ExecuteScalar(sql, CommandType.Text).ToString()); }
/// <summary> /// 推广--获取用户具有权限的中心过滤条件对象 /// </summary> /// <param name="userid"></param> /// <returns></returns> public BusinessFilter GetCenterFilterByPromotion(string userid) { Wicresoft.DataAccess.SQLServer dal = new Wicresoft.DataAccess.SQLServer(); BusinessFilter filter = new BusinessFilter("Dictionary"); filter.AddCustomerFilter("Dictionary.PKID IN (" + GetCenterFilterByPromotion(int.Parse(userid)) + ")", AndOr.AND); return(filter); }
public DataTable GetPagedRecords_New(out int totalCount, string tblName, int pageSize, int pageIndex, string idColumn, string fieldList, OrderByType obType, string strOrderBy, string strWhere, string strJoin, string strJoin1, string fieldList1) { Wicresoft.DataAccess.SQLServer dal = new Wicresoft.DataAccess.SQLServer(); string sql = string.Format(sp_GetPagedRecords_withCustomOrder_New, tblName, pageSize, pageIndex, idColumn, fieldList, strOrderBy, strWhere.Replace("'", "''"), strJoin, (int)obType, @strJoin1, fieldList1); DataSet ds = dal.ExecuteDataSet(sql, CommandType.Text); totalCount = Convert.ToInt32(ds.Tables[0].Rows[0][0]); return(ds.Tables[1]); }
/// <summary> /// 获取用户具有权限的中心过滤条件对象 /// </summary> /// <param name="userid"></param> /// <returns></returns> public BusinessFilter GetAuthorizedCenterFilter(int userid) { Wicresoft.DataAccess.SQLServer dal = new Wicresoft.DataAccess.SQLServer(); string sql = string.Format(sp_GetUserDataPermissionOnCenter, userid); string centerpkids = dal.ExecuteScalar(sql, CommandType.Text).ToString(); BusinessFilter filter = new BusinessFilter("Dictionary"); filter.AddCustomerFilter("Dictionary.PKID IN (" + centerpkids + ")", AndOr.AND); return(filter); }
/// <summary> /// 推广--获取用户具有权限的中心过滤条件对象 /// </summary> /// <param name="userid"></param> /// <returns></returns> public string GetCenterFilterByPromotion(int userid) { Wicresoft.DataAccess.SQLServer dal = new Wicresoft.DataAccess.SQLServer(); string str = string.Empty; string sql = "select FK_Center from AssistantDataPermission where fk_Assistant = " + userid; DataTable temp = dal.ExcuteDataTable(new DataTable(), sql, CommandType.Text); if (temp != null && temp.Rows.Count != 0) { for (int i = 0; i < temp.Rows.Count; i++) { str += temp.Rows[i]["FK_Center"].ToString() + ","; } str = str.Substring(0, str.Length - 1); } return(str); }