protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Doctor(); Department(); Bind(); FillAppointmnetGrid(); month.Visible = false; DateTime sDate = Calendar1.SelectedDate; string doc = ddlDoctor.SelectedValue.ToString(); GenerateDocSlotLabels(doc, sDate); } //this.BindGrid(); } protected void Calendar1_SelectionChanged1(object sender, EventArgs e) { try { DateTime sDate = Calendar1.SelectedDate; string doc = ddlDoctor.SelectedValue.ToString(); GenerateDocSlotLabels(doc, sDate); } catch (Exception ex) { throw new Exception(ex.ToString()); } } protected void GenerateDocSlotLabels(string doc, DateTime sDate) { doc = ddlDoctor.SelectedValue.ToString(); sDate = Calendar1.SelectedDate; string sDay = sDate.ToString("MM/dd/yyyy"); DataTable dt = tsbll.GetAvailableSlotsbyDocAndDate(doc, sDay); foreach (DataRow dr in dt.Rows) { Button label = new Button(); label.Text = dr["SlotTime"].ToString(); //label.Style["Left"] = "20px"; label.CssClass = "btn btn-primary"; //label.CssClass = "background - color: #19bc49;"; label.Click += new EventHandler(labelClick); pnlLabel.Controls.Add(label); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)