示例#1
0
        private Control GenerateContentForUserCell(NailDate existsNailDate, DateTime certainTime)
        {
            Control result = null;

            if (certainTime <= nowDateTime)
            {
                return(null);
            }
            if (existsNailDate == null)
            {
                var b = new TagButton()
                {
                    Tag = certainTime, Text = "Записаться"
                };
                //b.Attributes.Add("time", certainTime.ToString("Дата dd MMMM yyyy HH:mm"));
                //b.UseSubmitBehavior = false;
                //b.OnClientClick = "showModal(event); return false;";
                b.Click += onAddDateButtonClick;
                result   = b;
            }
            else
            {
                result = new Label()
                {
                    Text = "Занято"
                };
                (result as Label).Attributes.Add("onclick", "showEnterPhonePrompt(this.getAttribute('dateid'))");
                (result as Label).Attributes.Add("onmouseover", "this.innerHTML = 'Изменить'");
                (result as Label).Attributes.Add("onmouseleave", "this.innerHTML = 'Занято'");
                (result as Label).Attributes.Add("dateid", existsNailDate.ID.ToString());
            }
            return(result);
        }
示例#2
0
        private Control GenerateContentForOwnerCell(NailDate existsNailDate, DateTime certainTime)
        {
            var b = new TagButton()
            {
                Tag = existsNailDate
            };

            b.Click += onButtonPressedByOwner;
            if (existsNailDate != null)
            {
                b.Text = existsNailDate.ClientName;
                //b.BackColor = Color.FromArgb(1, 228, 83, 131);
            }
            else
            {
                b.Tag  = certainTime;
                b.Text = certainTime > nowDateTime ? "Блокировать" : "Добавить";
            }
            return(b);
        }