public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } _contentId = Body.GetQueryInt("contentID"); if (_contentId == 0) { _contentIdList = TranslateUtils.StringCollectionToIntList(Body.GetQueryString("IDCollection")); } if (!IsPostBack) { EAppointmentStatusUtils.AddListItems(DdlStatus); ControlUtils.SelectListItems(DdlStatus, EAppointmentStatusUtils.GetValue(EAppointmentStatus.Agree)); if (_contentId > 0) { var contentInfo = DataProviderWx.AppointmentContentDao.GetContentInfo(_contentId); if (contentInfo != null) { DdlStatus.SelectedValue = contentInfo.Status; TbMessage.Text = contentInfo.Message; } } } }
public bool IsExist(int itemId, string cookieSn, string wxOpenId, string userName) { var isExist = false; var statusList = new List <string>(); statusList.Add(EAppointmentStatusUtils.GetValue(EAppointmentStatus.Handling)); statusList.Add(EAppointmentStatusUtils.GetValue(EAppointmentStatus.Agree)); string sqlWhere = $"WHERE {AppointmentContentAttribute.AppointmentItemId} = {itemId} AND {AppointmentContentAttribute.Status} IN ({TranslateUtils.ToSqlInStringWithQuote(statusList)})"; sqlWhere += $" AND ({AppointmentContentAttribute.CookieSn} = '{PageUtils.FilterSql(cookieSn)}'"; if (!string.IsNullOrEmpty(wxOpenId)) { sqlWhere += $" OR {AppointmentContentAttribute.WxOpenId} = '{PageUtils.FilterSql(wxOpenId)}'"; } else if (!string.IsNullOrEmpty(userName)) { sqlWhere += $" OR {AppointmentContentAttribute.UserName} = '{PageUtils.FilterSql(userName)}'"; } sqlWhere += ")"; var sqlSelect = BaiRongDataProvider.TableStructureDao.GetSelectSqlString(ConnectionString, TableName, 0, AppointmentContentAttribute.Id, sqlWhere, null); using (var rdr = ExecuteReader(sqlSelect)) { if (rdr.Read()) { isExist = true; } rdr.Close(); } return(isExist); }
public bool IsExist(int itemID, string cookieSN, string wxOpenID, string userName) { var isExist = false; var statusList = new List <string>(); statusList.Add(EAppointmentStatusUtils.GetValue(EAppointmentStatus.Handling)); statusList.Add(EAppointmentStatusUtils.GetValue(EAppointmentStatus.Agree)); string SQL_WHERE = $"WHERE {AppointmentContentAttribute.AppointmentItemID} = {itemID} AND {AppointmentContentAttribute.Status} IN ({TranslateUtils.ToSqlInStringWithQuote(statusList)})"; SQL_WHERE += $" AND ({AppointmentContentAttribute.CookieSN} = '{PageUtils.FilterSql(cookieSN)}'"; if (!string.IsNullOrEmpty(wxOpenID)) { SQL_WHERE += $" OR {AppointmentContentAttribute.WXOpenID} = '{PageUtils.FilterSql(wxOpenID)}'"; } else if (!string.IsNullOrEmpty(userName)) { SQL_WHERE += $" OR {AppointmentContentAttribute.UserName} = '{PageUtils.FilterSql(userName)}'"; } SQL_WHERE += ")"; var SQL_SELECT = BaiRongDataProvider.TableStructureDao.GetSelectSqlString(ConnectionString, TABLE_NAME, 0, AppointmentContentAttribute.ID, SQL_WHERE, null); using (var rdr = ExecuteReader(SQL_SELECT)) { if (rdr.Read()) { isExist = true; } rdr.Close(); } return(isExist); }