public AppointmentContentInfo GetLatestContentInfo(int itemId, string cookieSn, string wxOpenId, string userName) { AppointmentContentInfo contentInfo = null; string sqlWhere = $"WHERE {AppointmentContentAttribute.AppointmentItemId} = {itemId}"; sqlWhere += $" AND ({AppointmentContentAttribute.CookieSn} = '{PageUtils.FilterSql(cookieSn)}'"; if (!string.IsNullOrEmpty(wxOpenId)) { sqlWhere += $" AND {AppointmentContentAttribute.WxOpenId} = '{PageUtils.FilterSql(wxOpenId)}'"; } else if (!string.IsNullOrEmpty(userName)) { sqlWhere += $" AND {AppointmentContentAttribute.UserName} = '{PageUtils.FilterSql(userName)}'"; } sqlWhere += ")"; var sqlSelect = BaiRongDataProvider.TableStructureDao.GetSelectSqlString(ConnectionString, TableName, 0, SqlUtils.Asterisk, sqlWhere, "ORDER BY ID DESC"); using (var rdr = ExecuteReader(sqlSelect)) { if (rdr.Read()) { contentInfo = new AppointmentContentInfo(rdr); } rdr.Close(); } return(contentInfo); }
public void Update(AppointmentContentInfo contentInfo) { IDataParameter[] parms = null; var sqlUpdate = BaiRongDataProvider.TableStructureDao.GetUpdateSqlString(contentInfo.ToNameValueCollection(), ConnectionString, TableName, out parms); ExecuteNonQuery(sqlUpdate, parms); }
public int Insert(AppointmentContentInfo contentInfo) { var contentId = 0; IDataParameter[] parms = null; var sqlInsert = BaiRongDataProvider.TableStructureDao.GetInsertSqlString(contentInfo.ToNameValueCollection(), ConnectionString, TableName, out parms); using (var conn = GetConnection()) { conn.Open(); using (var trans = conn.BeginTransaction()) { try { contentId = ExecuteNonQueryAndReturnId(trans, sqlInsert, parms); trans.Commit(); } catch { trans.Rollback(); throw; } } } DataProviderWx.AppointmentItemDao.AddUserCount(contentInfo.AppointmentItemId); DataProviderWx.AppointmentDao.AddUserCount(contentInfo.AppointmentId); return(contentId); }
public AppointmentContentInfo GetLatestContentInfo(int itemID, string cookieSN, string wxOpenID, string userName) { AppointmentContentInfo contentInfo = null; string SQL_WHERE = $"WHERE {AppointmentContentAttribute.AppointmentItemID} = {itemID}"; SQL_WHERE += $" AND ({AppointmentContentAttribute.CookieSN} = '{PageUtils.FilterSql(cookieSN)}'"; if (!string.IsNullOrEmpty(wxOpenID)) { SQL_WHERE += $" AND {AppointmentContentAttribute.WXOpenID} = '{PageUtils.FilterSql(wxOpenID)}'"; } else if (!string.IsNullOrEmpty(userName)) { SQL_WHERE += $" AND {AppointmentContentAttribute.UserName} = '{PageUtils.FilterSql(userName)}'"; } SQL_WHERE += ")"; var SQL_SELECT = BaiRongDataProvider.TableStructureDao.GetSelectSqlString(ConnectionString, TABLE_NAME, 0, SqlUtils.Asterisk, SQL_WHERE, "ORDER BY ID DESC"); using (var rdr = ExecuteReader(SQL_SELECT)) { if (rdr.Read()) { contentInfo = new AppointmentContentInfo(rdr); } rdr.Close(); } return(contentInfo); }
public int Insert(AppointmentContentInfo contentInfo) { var contentID = 0; IDataParameter[] parms = null; var SQL_INSERT = BaiRongDataProvider.TableStructureDao.GetInsertSqlString(contentInfo.ToNameValueCollection(), ConnectionString, TABLE_NAME, out parms); using (var conn = GetConnection()) { conn.Open(); using (var trans = conn.BeginTransaction()) { try { ExecuteNonQuery(trans, SQL_INSERT, parms); contentID = BaiRongDataProvider.DatabaseDao.GetSequence(trans, TABLE_NAME); trans.Commit(); } catch { trans.Rollback(); throw; } } } DataProviderWX.AppointmentItemDAO.AddUserCount(contentInfo.AppointmentItemID); DataProviderWX.AppointmentDAO.AddUserCount(contentInfo.AppointmentID); return(contentID); }
void rptContents_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { var contentInfo = new AppointmentContentInfo(e.Item.DataItem); var ltlItemIndex = e.Item.FindControl("ltlItemIndex") as Literal; var ltlRealName = e.Item.FindControl("ltlRealName") as Literal; var ltlAppointementTitle = e.Item.FindControl("ltlAppointementTitle") as Literal; var ltlMobile = e.Item.FindControl("ltlMobile") as Literal; var ltlExtendVal = e.Item.FindControl("ltlExtendVal") as Literal; var ltlEmail = e.Item.FindControl("ltlEmail") as Literal; var ltlAddDate = e.Item.FindControl("ltlAddDate") as Literal; var ltlStatus = e.Item.FindControl("ltlStatus") as Literal; var ltlMessage = e.Item.FindControl("ltlMessage") as Literal; var ltlEditUrl = e.Item.FindControl("ltlEditUrl") as Literal; var ltlSelectUrl = e.Item.FindControl("ltlSelectUrl") as Literal; AppointmentItemInfo itemInfo = null; if (_itemInfoDictionary.ContainsKey(contentInfo.AppointmentItemId)) { itemInfo = _itemInfoDictionary[contentInfo.AppointmentItemId]; } else { itemInfo = DataProviderWx.AppointmentItemDao.GetItemInfo(contentInfo.AppointmentItemId); _itemInfoDictionary.Add(contentInfo.AppointmentItemId, itemInfo); } ltlItemIndex.Text = (e.Item.ItemIndex + 1).ToString(); ltlRealName.Text = contentInfo.RealName; if (itemInfo != null) { ltlAppointementTitle.Text = itemInfo.Title; AppointmentTitle = itemInfo.Title; } ltlMobile.Text = contentInfo.Mobile; ltlEmail.Text = contentInfo.Email; ltlAddDate.Text = DateUtils.GetDateAndTimeString(contentInfo.AddDate); ltlStatus.Text = EAppointmentStatusUtils.GetText(EAppointmentStatusUtils.GetEnumType(contentInfo.Status)); ltlMessage.Text = contentInfo.Message; ltlEditUrl.Text = $@"<a href=""javascrip:;"" onclick=""{ModalAppointmentHandle.GetOpenWindowStringToSingle( PublishmentSystemId, contentInfo.Id)}"">预约处理</a>"; ltlSelectUrl.Text = $@"<a href=""javascrip:;"" onclick=""{ModalAppointmentContentDetail.GetOpenWindowStringToSingle( PublishmentSystemId, contentInfo.Id)}"">预约详情</a>"; } }
public List <AppointmentContentInfo> GetLatestContentInfoList(int appointmentId, string cookieSn, string wxOpenId, string userName) { var list = new List <AppointmentContentInfo>(); string sqlWhere = $"WHERE {AppointmentContentAttribute.AppointmentId} = {appointmentId}"; sqlWhere += $" AND ({AppointmentContentAttribute.CookieSn} = '{PageUtils.FilterSql(cookieSn)}'"; if (!string.IsNullOrEmpty(wxOpenId)) { sqlWhere += $" AND {AppointmentContentAttribute.WxOpenId} = '{PageUtils.FilterSql(wxOpenId)}'"; } else if (!string.IsNullOrEmpty(userName)) { sqlWhere += $" AND {AppointmentContentAttribute.UserName} = '{PageUtils.FilterSql(userName)}'"; } sqlWhere += ")"; var sqlSelect = BaiRongDataProvider.TableStructureDao.GetSelectSqlString(ConnectionString, TableName, 0, SqlUtils.Asterisk, sqlWhere, "ORDER BY ID DESC"); using (var rdr = ExecuteReader(sqlSelect)) { while (rdr.Read()) { var contentInfo = new AppointmentContentInfo(rdr); var isExists = false; foreach (var theContentInfo in list) { if (theContentInfo.AppointmentItemId == contentInfo.AppointmentItemId) { isExists = true; } } if (!isExists) { list.Add(contentInfo); } } rdr.Close(); } return(list); }
public List <AppointmentContentInfo> GetLatestContentInfoList(int appointmentID, string cookieSN, string wxOpenID, string userName) { var list = new List <AppointmentContentInfo>(); string SQL_WHERE = $"WHERE {AppointmentContentAttribute.AppointmentID} = {appointmentID}"; SQL_WHERE += $" AND ({AppointmentContentAttribute.CookieSN} = '{PageUtils.FilterSql(cookieSN)}'"; if (!string.IsNullOrEmpty(wxOpenID)) { SQL_WHERE += $" AND {AppointmentContentAttribute.WXOpenID} = '{PageUtils.FilterSql(wxOpenID)}'"; } else if (!string.IsNullOrEmpty(userName)) { SQL_WHERE += $" AND {AppointmentContentAttribute.UserName} = '{PageUtils.FilterSql(userName)}'"; } SQL_WHERE += ")"; var SQL_SELECT = BaiRongDataProvider.TableStructureDao.GetSelectSqlString(ConnectionString, TABLE_NAME, 0, SqlUtils.Asterisk, SQL_WHERE, "ORDER BY ID DESC"); using (var rdr = ExecuteReader(SQL_SELECT)) { while (rdr.Read()) { var contentInfo = new AppointmentContentInfo(rdr); var isExists = false; foreach (var theContentInfo in list) { if (theContentInfo.AppointmentItemID == contentInfo.AppointmentItemID) { isExists = true; } } if (!isExists) { list.Add(contentInfo); } } rdr.Close(); } return(list); }
public AppointmentContentInfo GetContentInfo(int contentId) { AppointmentContentInfo contentInfo = null; string sqlWhere = $"WHERE ID = {contentId}"; var sqlSelect = BaiRongDataProvider.TableStructureDao.GetSelectSqlString(ConnectionString, TableName, 0, SqlUtils.Asterisk, sqlWhere, null); using (var rdr = ExecuteReader(sqlSelect)) { if (rdr.Read()) { contentInfo = new AppointmentContentInfo(rdr); } rdr.Close(); } return(contentInfo); }
public AppointmentContentInfo GetContentInfo(int contentID) { AppointmentContentInfo contentInfo = null; string SQL_WHERE = $"WHERE ID = {contentID}"; var SQL_SELECT = BaiRongDataProvider.TableStructureDao.GetSelectSqlString(ConnectionString, TABLE_NAME, 0, SqlUtils.Asterisk, SQL_WHERE, null); using (var rdr = ExecuteReader(SQL_SELECT)) { if (rdr.Read()) { contentInfo = new AppointmentContentInfo(rdr); } rdr.Close(); } return(contentInfo); }
public List <AppointmentContentInfo> GetAppointmentContentInfoList(int publishmentSystemId, int appointmentId, int appointmentItemId) { var appointmentContentInfolList = new List <AppointmentContentInfo>(); string sqlWhere = $"WHERE {AppointmentContentAttribute.PublishmentSystemId} = {publishmentSystemId} AND {AppointmentContentAttribute.AppointmentId} = {appointmentId} AND {AppointmentContentAttribute.AppointmentItemId} = {appointmentItemId}"; var sqlSelect = BaiRongDataProvider.TableStructureDao.GetSelectSqlString(ConnectionString, TableName, 0, SqlUtils.Asterisk, sqlWhere, "ORDER BY ID DESC"); using (var rdr = ExecuteReader(sqlSelect)) { while (rdr.Read()) { var appointmentContentInfo = new AppointmentContentInfo(rdr); appointmentContentInfolList.Add(appointmentContentInfo); } rdr.Close(); } return(appointmentContentInfolList); }
public List <AppointmentContentInfo> GetAppointmentContentInfoList(int publishmentSystemID, int appointmentID, int appointmentItemID) { var appointmentContentInfolList = new List <AppointmentContentInfo>(); string SQL_WHERE = $"WHERE {AppointmentContentAttribute.PublishmentSystemID} = {publishmentSystemID} AND {AppointmentContentAttribute.AppointmentID} = {appointmentID} AND {AppointmentContentAttribute.AppointmentItemID} = {appointmentItemID}"; var SQL_SELECT = BaiRongDataProvider.TableStructureDao.GetSelectSqlString(ConnectionString, TABLE_NAME, 0, SqlUtils.Asterisk, SQL_WHERE, "ORDER BY ID DESC"); using (var rdr = ExecuteReader(SQL_SELECT)) { while (rdr.Read()) { var appointmentContentInfo = new AppointmentContentInfo(rdr); appointmentContentInfolList.Add(appointmentContentInfo); } rdr.Close(); } return(appointmentContentInfolList); }