Ejemplo n.º 1
0
        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;
                    }
                }
            }
        }
Ejemplo n.º 2
0
        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>";
            }
        }
Ejemplo n.º 3
0
        public void ddlStatus_SelectedIndexChanged(object sender, EventArgs e)
        {
            var status = EAppointmentStatusUtils.GetEnumType(DdlStatus.SelectedValue);

            if (status == EAppointmentStatus.Agree || status == EAppointmentStatus.Refuse)
            {
                PhMessage.Visible = true;
            }
            else
            {
                PhMessage.Visible = false;
            }
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        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);
        }
        public void ExportAppointmentContentCSV(string filePath, List <AppointmentContentInfo> appointmentContentInfolList, string appointmentTitle, int appointmentID)
        {
            var appointmentInfo = DataProviderWX.AppointmentDAO.GetAppointmentInfo(appointmentID);

            var head = new List <string>();

            head.Add("序号");
            head.Add("预约名称");
            if (appointmentInfo.IsFormRealName == "True")
            {
                head.Add(appointmentInfo.FormRealNameTitle);
            }
            if (appointmentInfo.IsFormMobile == "True")
            {
                head.Add(appointmentInfo.FormMobileTitle);
            }
            if (appointmentInfo.IsFormEmail == "True")
            {
                head.Add(appointmentInfo.FormEmailTitle);
            }
            head.Add("预约时间");
            head.Add("预约状态");
            head.Add("留言");
            var configExtendInfoList = DataProviderWX.ConfigExtendDAO.GetConfigExtendInfoList(PublishmentSystemId, appointmentID, EKeywordTypeUtils.GetValue(EKeywordType.Appointment));

            foreach (var cList in configExtendInfoList)
            {
                head.Add(cList.AttributeName);
            }

            var rows = new List <List <string> >();

            var index = 1;

            foreach (var applist in appointmentContentInfolList)
            {
                var row = new List <string>();

                row.Add((index++).ToString());
                row.Add(appointmentTitle);
                if (appointmentInfo.IsFormRealName == "True")
                {
                    row.Add(applist.RealName);
                }
                if (appointmentInfo.IsFormMobile == "True")
                {
                    row.Add(applist.Mobile);
                }
                if (appointmentInfo.IsFormEmail == "True")
                {
                    row.Add(applist.Email);
                }
                row.Add(DateUtils.GetDateAndTimeString(applist.AddDate));
                row.Add(EAppointmentStatusUtils.GetText(EAppointmentStatusUtils.GetEnumType(applist.Status)));
                row.Add(applist.Message);

                var SettingsXML = applist.SettingsXML.Replace("{", "").Replace("}", "");
                var arr         = SettingsXML.Split(',');
                if (arr[0] != "")
                {
                    for (var i = 0; i < arr.Length; i++)
                    {
                        var arr1 = arr[i].Replace("\"", "").Split(':');
                        row.Add(arr1[1]);
                    }
                }
                rows.Add(row);
            }

            CSVUtils.Export(filePath, head, rows);
        }