Exemple #1
0
        void uc_CheckChanged(object sender, RunningClassEventArgs e)
        {
            var alreadySelected = Session["AlreadySelectedProgramBatches"] as Dictionary <int, List <int> >;

            if (alreadySelected == null)
            {
                Response.Redirect("~" + Request.Url.PathAndQuery, true);
            }
            else
            {
                foreach (ListSubYearUC uc in pnlSubControls.Controls)
                {
                    uc.Checked = false;
                    alreadySelected[e.ProgramId].Remove(uc.SelectedProgramBatchId);
                    uc.ClearProgramBatch();
                }
                var send = sender as ListSubYearUC;
                if (send != null)
                {
                    //send.SelectedProgramBatchId = e.ProgramBatchId;
                    send.SetSelectedBatch(e.ProgramBatchId, e.ProgramBatchName, e.RunningClassId);
                    send.Checked = true;
                }
            }
        }
 void yuc_BatchSelectClicked(object sender, RunningClassEventArgs e)
 {
     Session["RunningClassYear"]   = e;
     lblBatchSelectionHeading.Text = "Batch selection for: " + e.ProgrameName + ">" + e.YearName +
                                     ((e.SubYearName == "") ? "" : ">" + e.SubYearName);
     BatchSelect.LoadBatches(e.ProgramId, AcademicYearId, SessionId, e.ProgramBatchId);
     pnlBatchSelect.Visible = true;
 }
Exemple #3
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     if (SaveClicked != null)
     {
         var args = new RunningClassEventArgs()
         {
             SubYearId = SubYearId
             ,
             YearId = YearId
                      //,RunningClassId = r
             ,
             ProgramId = ProgramId
                         //,Type =
             , ProgramBatchId   = Convert.ToInt32(hidProgramBatchId.Value)
             , ProgramBatchName = lblProgramBatch.Text
         };
         SaveClicked(this, args);
     }
 }
Exemple #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            BatchSelect.DoneClicked   += BatchSelect_DoneClicked;
            BatchSelect.BatchSelected += BatchSelect_BatchSelected;
            if (!IsPostBack)
            {
                //here key is program id and value is list <programbatch id>
                Session["AlreadySelectedProgramBatches"] = new Dictionary <int, List <int> >();

                Session["RunningClassYear"] = new RunningClassEventArgs();
                var aId = Request.QueryString["aId"];
                var sId = Request.QueryString["sId"];
                if (aId != null)
                {
                    try
                    {
                        AcademicYearId = Convert.ToInt32(aId);
                        if (sId != null)
                        {
                            // then its for session, so display only those years whose subyears are present
                            SessionId = Convert.ToInt32(sId);
                        }
                    }
                    catch
                    {
                        Response.Redirect("../List.aspx");
                    }
                }
                else
                {
                    Response.Redirect("../List.aspx");
                }
            }



            var user = Page.User as CustomPrincipal;

            if (user != null)
            {
                LoadStructure(user.SchoolId);
            }
        }
Exemple #5
0
        //protected void rdbtn_CheckedChanged(object sender, EventArgs e)
        //{
        //    var t = this;
        //    //checkChanged event call
        //    if (CheckChanged != null)
        //    {
        //        var arg = new RunningClassEventArgs()
        //        {
        //            SubYearId = SubYearId
        //            ,
        //            YearId = YearId
        //            ,
        //            ProgramBatchId = SelectedProgramBatchId
        //            ,
        //            ProgramId = ProgramId
        //            ,
        //        };
        //        CheckChanged(this, arg);
        //    }
        //}

        //public bool Checked
        //{
        //    get { return rdbtn.Checked; }
        //    set { rdbtn.Checked = value; }
        //}

        protected void lnkBtn_Click(object sender, EventArgs e)
        {
            if (CheckChanged != null)
            {
                var arg = new RunningClassEventArgs()
                {
                    SubYearId = SubYearId
                    ,
                    YearId = YearId
                    ,
                    ProgramBatchId = SelectedProgramBatchId
                    ,
                    ProgramId          = ProgramId
                    , RunningClassId   = RunningClassId
                    , ProgramBatchName = " | " + lblBatchName.Text
                };
                CheckChanged(this, arg);
            }
            if (BatchSelectClicked != null)
            {
                BatchSelectClicked(this, new RunningClassEventArgs()
                {
                    //LevelId = LevelId
                    //,
                    //FacultyId = FacultyId
                    //,
                    ProgramId = ProgramId
                    ,
                    YearId = YearId
                    ,
                    SubYearId = SubYearId
                    ,
                    ProgrameName = hidProgrameName.Value
                    ,
                    YearName = hidYearName.Value
                    ,
                    SubYearName = hidSubYearName.Value
                    ,
                    ProgramBatchId = SelectedProgramBatchId
                });
            }
        }
Exemple #6
0
        protected void lnkBtn_Click(object sender, EventArgs e)
        {
            if (CheckChanged != null)
            {
                var arg = new RunningClassEventArgs()
                {
                    SubYearId = SubYearId
                    ,
                    YearId = YearId
                    ,
                    ProgramBatchId = SelectedProgramBatchId
                    ,
                    ProgramId = ProgramId
                    ,
                    RunningClassId = RunningClassId
                    ,
                    ProgramBatchName = lblBatchName.Text
                };
                CheckChanged(this, arg);
            }
            if (BatchSelectClicked != null)
            {
                //earlier selected programBatch
                if (SelectedProgramBatchId <= 0)
                {
                    if (EarlierSelectedBatchId > 0)
                    {
                        SelectedProgramBatchId = EarlierSelectedBatchId;
                        var alreadySelected = Session["AlreadySelectedProgramBatches"] as Dictionary <int, List <int> >;
                        if (alreadySelected == null)
                        {
                            Response.Redirect("~" + Request.Url.PathAndQuery, true);
                        }
                        else
                        {
                            alreadySelected[ProgramId].Add(EarlierSelectedBatchId);
                            SetSelectedBatch(EarlierSelectedBatchId, hidEarlierSelectedBatchName.Value, RunningClassId);
                        }
                    }
                }
                //end

                BatchSelectClicked(this, new RunningClassEventArgs()
                {
                    //LevelId = LevelId
                    //,
                    //FacultyId = FacultyId
                    //,
                    ProgramId = ProgramId
                    ,
                    YearId = YearId
                    ,
                    SubYearId = SubYearId
                    ,
                    ProgrameName = hidProgrameName.Value
                    ,
                    YearName = hidYearName.Value
                    ,
                    SubYearName = hidSubYearName.Value
                    ,
                    ProgramBatchId = SelectedProgramBatchId
                    ,
                    RunningClassId = RunningClassId
                });
            }
        }