예제 #1
0
        protected void RadGridClassStudent_OnRowDrop(object sender, GridDragDropEventArgs e)
        {
            if (e.DraggedItems.Count != 0)
            {
                foreach (var dataItem in e.DraggedItems)
                {
                    var sid = dataItem.GetDataKeyValue("ProgramClassStudentId").ToString();
                    var cProgramClassStudent = new CProgramClassStudent();
                    var programClassStudent  = cProgramClassStudent.Get(Convert.ToInt32(sid));

                    var cStudent = new CStudent();
                    var student  = cStudent.Get(programClassStudent.StudentId);

                    var cProgramRegistration = new CProgramRegistration();
                    var programRegistration  = cProgramRegistration.Get(programClassStudent.ProgramRegistrationId);
                    if (programRegistration.EndDate < DateTime.Today)
                    {
                        ShowMessage("Move Failed : " + cStudent.GetStudentName(student) + "'s the End Date should not be earlier than today.");
                    }
                    else if (cProgramClassStudent.Delete(programClassStudent))
                    {
                        ShowMessage("Moved successfuly : " + cStudent.GetStudentName(student));
                    }
                }

                refreshGrid();
            }
            else
            {
                ShowMessage("Transfer Failed");
            }
        }
예제 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // find user control
            _radGridInvoiceItems = InvoiceItemGrid1.GetRadGridInvoiceItems();
            // connect event of invoice Items.
            _radGridInvoiceItems.PreRender += _radGridInvoiceItems_PreRender;
            _radGridInvoiceItems.MasterTableView.DataSourceID = null;
            _radGridInvoiceItems.DataSourceID = null;
            // just view
            InvoiceItemGrid1.SetEditMode(false);

            Id = Convert.ToInt32(Request["id"]);

            if (!IsPostBack)
            {
                var global   = new CGlobal();
                var cStudent = new CStudent();
                var student  = cStudent.Get(Id);

                var studentSite = new CSiteLocation().Get(student.SiteLocationId);

                StudentSiteId         = studentSite.SiteId;
                StudentSiteLocationId = student.SiteLocationId;

                LoadAgency();
                LoadFaculty();
                LoadProgramGroup("0");
                LoadProgram("0");

                ddlProgramWeeks.DataSource     = new CProgram().GetProgramWeeksList();
                ddlProgramWeeks.DataTextField  = "Name";
                ddlProgramWeeks.DataValueField = "Value";
                ddlProgramWeeks.DataBind();

                ddlPrgHours.DataSource     = global.GetDictionary(150);
                ddlPrgHours.DataTextField  = "Name";
                ddlPrgHours.DataValueField = "Value";
                ddlPrgHours.DataBind();


                var cCountry       = new CCountry().Get((int)student.CountryId);
                var cCountryMarket = new CCountryMarket().Get((int)cCountry.CountryMarketId);
                ViewState["CountryMarketId"] = cCountry.CountryMarketId;

                ttName1.Text = cStudent.GetStudentName(student) + " [" + student.StudentNo + "]";
                ttName2.Text = cCountryMarket.Name;
            }

            ddlAgency.OpenDropDownOnLoad       = false;
            ddlFaculty.OpenDropDownOnLoad      = false;
            ddlProgramGrp.OpenDropDownOnLoad   = false;
            ddlProgramName.OpenDropDownOnLoad  = false;
            ddlProgramWeeks.OpenDropDownOnLoad = false;
            ddlPrgHours.OpenDropDownOnLoad     = false;
        }
예제 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // find user control
            _sqlDataSourceInvoiceItems = InvoiceItemGrid1.GetSqlDataSourceInvoiceItems();
            _radGridInvoiceItems       = InvoiceItemGrid1.GetRadGridInvoiceItems();
            _radGridInvoiceItems.MasterTableView.CommandItemSettings.ShowSaveChangesButton = false;
            // Simple
            InvoiceItemGrid1.SetTypeOfInvoiceCoaItem(1);

            if (!IsPostBack)
            {
                InvoiceItemGrid1.SetEditMode(true);

                var cStudent = new CStudent();
                var student  = cStudent.GetStudentList(CurrentSiteLocationId);
                foreach (var stu in student)
                {
                    RadComboBoxMenu.Items.Add(new RadComboBoxItem(cStudent.GetStudentName(stu) + "(" + stu.StudentNo + ")", stu.StudentId.ToString()));
                }
            }
        }
예제 #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // find user control
            _radGridInvoiceItems = InvoiceItemGrid1.GetRadGridInvoiceItems();
            // connect event of invoice Items.
            _radGridInvoiceItems.PreRender += _radGridInvoiceItems_PreRender;
            _radGridInvoiceItems.MasterTableView.DataSourceID = null;
            _radGridInvoiceItems.DataSourceID = null;
            // just view
            InvoiceItemGrid1.SetEditMode(false);

            Id = Convert.ToInt32(Request["id"]);

            if (!IsPostBack)
            {
                var cStudent = new CStudent();
                var student  = cStudent.Get(Id);

                LoadAgency(student.SiteLocationId);
                var cCountry       = new CCountry().Get((int)student.CountryId);
                var cCountryMarket = new CCountryMarket().Get((int)cCountry.CountryMarketId);
                ViewState["CountryMarketId"] = cCountry.CountryMarketId;

                ttName1.Text = cStudent.GetStudentName(student) + " [" + student.StudentNo + "]";
                ttName2.Text = cCountryMarket.Name;

                // Package Program
                ddlPackageProgram.DataSource     = new CPackageProgram().GetPackageProgramBySiteIdAndCountryId(student.SiteLocationId);
                ddlPackageProgram.DataTextField  = "Name";
                ddlPackageProgram.DataValueField = "Value";
                ddlPackageProgram.DataBind();
                if (ddlPackageProgram.Items.Count > 0)
                {
                    SetPackageProgramData(ddlPackageProgram.Items[0].Value);
                }
            }

            ddlPackageProgram.OpenDropDownOnLoad = false;
        }