Ejemplo n.º 1
0
        private void SaveSY()
        {
            try
            {
                Boolean ret     = false;
                string  message = String.Empty;

                int SYto = 0;
                SYto = int.Parse(txtSY.Text) + 1;

                SchoolYearServiceClient syService = new SchoolYearServiceClient();
                SchoolYear schoolyear             = new SchoolYear()
                {
                    SY        = txtSY.Text + "-" + SYto.ToString(),
                    CurrentSY = false
                };


                ret = syService.CreateSY(ref schoolyear, ref message);


                MessageBox.Show("Saved Successfully!");

                Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.ToString());
            }
        }
Ejemplo n.º 2
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            if (SYSelected != null)
            {
                SchoolYearServiceClient syService = new SchoolYearServiceClient();
                string message = String.Empty;

                if (!syService.DeleteSY(SYSelected.SY, ref message))
                {
                    message = "Deletion of School Year Failed";
                }
                else
                {
                    MessageBox.Show("Deleted succesfully!");
                }
            }
        }
Ejemplo n.º 3
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            if (SYSelected != null)
            {
                SchoolYearServiceClient syService = new SchoolYearServiceClient();
                string message = String.Empty;

                if (!syService.DeleteSY(SYSelected.SY, ref message))
                {
                    message = "Deletion of School Year Failed";
                }
                else
                {
                    MessageBox.Show("Deleted succesfully!");
                }
            }
        }
Ejemplo n.º 4
0
        public void LoadSY()
        {
            SchoolYearServiceClient syService = new SchoolYearServiceClient();
            string message = String.Empty;
            try
            {
                var sy = syService.GetAllSY();
                SYList = new List<SchoolYear>(sy);
                gvSY.DataSource = SYList;
                gvSY.Refresh();

                if (gvSY.RowCount != 0)
                    gvSY.Rows[0].IsSelected = true;
            }
            catch (Exception ex)
            {
                message = "Error Loading List of School Years";
                MessageBox.Show(ex.ToString());
            }

        }
Ejemplo n.º 5
0
        public void LoadSY()
        {
            SchoolYearServiceClient syService = new SchoolYearServiceClient();
            string message = String.Empty;

            try
            {
                var sy = syService.GetAllSY();
                SYList          = new List <SchoolYear>(sy);
                gvSY.DataSource = SYList;
                gvSY.Refresh();

                if (gvSY.RowCount != 0)
                {
                    gvSY.Rows[0].IsSelected = true;
                }
            }
            catch (Exception ex)
            {
                message = "Error Loading List of School Years";
                MessageBox.Show(ex.ToString());
            }
        }
Ejemplo n.º 6
0
        private void SaveSY()
        {
            try
            {
                Boolean ret = false;
                string message = String.Empty;

                int SYto = 0;
                SYto = int.Parse(txtSY.Text) + 1;
                                
                SchoolYearServiceClient syService = new SchoolYearServiceClient();
                SchoolYear schoolyear = new SchoolYear()
                {
                    SY = txtSY.Text + "-" + SYto.ToString(),
                    CurrentSY = false
                };

              
                    ret = syService.CreateSY(ref schoolyear, ref message);


                MessageBox.Show("Saved Successfully!");

                Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.ToString());
            }
        }
Ejemplo n.º 7
0
        private void UpdateCurrentSY(string szSY, bool bSY)
        {
            try
            {
                Boolean ret = false;
                string message = String.Empty;

                SchoolYearServiceClient syService = new SchoolYearServiceClient();
                SchoolYear schoolyear = new SchoolYear()
                {
                    SY = szSY,
                    CurrentSY = bSY
                };

                ret = syService.UpdateSY(ref schoolyear, ref message);
                schoolyear.CurrentSY = true;
                Log("U", "SchoolYear", schoolyear);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.ToString());
            }
        }