public void GetProgSchedule(Guid SchoolId, Guid SchoolProgramId)
        {
            DayCareBAL.ProgScheduleService          proxyProgClassCategory = new DayCareBAL.ProgScheduleService();
            List <DayCarePL.ProgScheduleProperties> lstProgClassCategory   = proxyProgClassCategory.LoadProgScheduleForChildSchedule(SchoolId, SchoolProgramId);

            ddlProgSchedule.Items.Clear();
            if (lstProgClassCategory != null && lstProgClassCategory.Count > 0)
            {
                foreach (DayCarePL.ProgScheduleProperties objProgSchedule in lstProgClassCategory)
                {
                    string strSchedule = objProgSchedule.Day + " - " + (objProgSchedule.BeginTime != null ? Convert.ToDateTime(objProgSchedule.BeginTime).ToShortTimeString() : "") + " - " + (objProgSchedule.EndTime != null ? Convert.ToDateTime(objProgSchedule.EndTime).ToShortTimeString() : "") + " - " + objProgSchedule.ClassRoomName + " - " + objProgSchedule.FullName;
                    ddlProgSchedule.Items.Add(new ListItem(strSchedule, objProgSchedule.Id.ToString()));
                }
            }
            ddlProgSchedule.Items.Insert(0, new ListItem("--Select--", DayCarePL.Common.GUID_DEFAULT));
        }
        public bool SubmitRecord()
        {
            bool result = false;

            try
            {
                DayCareBAL.ChildScheduleService   proxyChildSchedule = new DayCareBAL.ChildScheduleService();
                DayCarePL.ChildScheduleProperties objChildSchedule   = new DayCarePL.ChildScheduleProperties();

                objChildSchedule.ChildSchoolYearId = GetChildSchoolYearId();
                objChildSchedule.SchoolProgramId   = new Guid(ddlProgram.SelectedValue);
                //objChildSchedule.ProgClassCategoryId = new Guid(ddlClassCategory.SelectedValue);
                DayCareBAL.ProgScheduleService          proxyProgClassCategory = new DayCareBAL.ProgScheduleService();
                List <DayCarePL.ProgScheduleProperties> lstProgClassCategory   = proxyProgClassCategory.LoadProgScheduleForChildSchedule(GetSchoolId(), new Guid(ddlProgram.SelectedValue));
                if (lstProgClassCategory != null && lstProgClassCategory.Count > 0)
                {
                    objChildSchedule.ProgClassRoomId = lstProgClassCategory.Find(cr => cr.Id.Equals(new Guid(ddlProgSchedule.SelectedValue))).ProgClassRoomId;
                }
                objChildSchedule.ProgScheduleId = new Guid(ddlProgSchedule.SelectedValue);
                if (rdpBeginDate.SelectedDate != null)
                {
                    objChildSchedule.BeginDate = rdpBeginDate.SelectedDate.Value;
                }
                if (rdpEndDate.SelectedDate != null)
                {
                    objChildSchedule.EndDate = rdpEndDate.SelectedDate.Value;
                }
                if (!string.IsNullOrEmpty(txtDiscount.Text.Trim()))
                {
                    objChildSchedule.Discount = Convert.ToDouble(txtDiscount.Text.Trim());
                }
                else
                {
                    objChildSchedule.Discount = 0;
                }
                if (ViewState["SelectedChildScheduleId"] != null)
                {
                    objChildSchedule.Id = new Guid(ViewState["SelectedChildScheduleId"].ToString());
                    int CountChildData = proxyChildSchedule.GetCountChildData(GetChildSchoolYearId());
                    if (CountChildData == 1)
                    {
                        if (!proxyChildSchedule.CheckProgramIdPrimaryOrNotForChildSchedule(new Guid(ddlProgram.SelectedValue)))
                        {
                            MasterAjaxManager = this.Page.Master.FindControl("RadAjaxManager1") as Telerik.Web.UI.RadAjaxManager;
                            MasterAjaxManager.ResponseScripts.Add(string.Format("ShowMessage('{0}','{1}')", "Please select Primary subject first", "false"));
                            return(false);
                        }
                    }
                }
                else
                {
                    if (Session["StaffId"] != null)
                    {
                        objChildSchedule.CreatedById = new Guid(Session["StaffId"].ToString());
                    }
                }
                if (Session["StaffId"] != null)
                {
                    objChildSchedule.LastModifiedById = new Guid(Session["StaffId"].ToString());
                }
                if (proxyChildSchedule.Save(objChildSchedule))
                {
                    ClearAll();
                    rgChildSchedule.MasterTableView.Rebind();
                    MasterAjaxManager = this.Page.Master.FindControl("RadAjaxManager1") as Telerik.Web.UI.RadAjaxManager;
                    MasterAjaxManager.ResponseScripts.Add(string.Format("ShowMessage('{0}','{1}')", "Saved Successfully", "false"));
                    rgChildSchedule.MasterTableView.CurrentPageIndex = 0;
                    result = true;
                }
                else
                {
                    MasterAjaxManager = this.Page.Master.FindControl("RadAjaxManager1") as Telerik.Web.UI.RadAjaxManager;
                    MasterAjaxManager.ResponseScripts.Add(string.Format("ShowMessage('{0}','{1}')", "Internal Error", "false"));
                    result = false;
                }
            }
            catch (Exception ex)
            {
                result = false;
            }
            return(result);
        }