Exemplo n.º 1
0
        //Создаётся группа
        private void MakeGroup_Click(object sender, EventArgs e)
        {
            CGroup group = new CGroup();

            Mylist.front();
            while (!Mylist.eol())
            {
                if (Mylist.getObject().Current)
                {
                    group.Add(Mylist.getObject());
                    Mylist.erase(Mylist.getCurrent());

                    Mylist.front();
                }
                else
                {
                    Mylist.next();
                }
            }

            if (group.getList().size > 0)
            {
                Mylist.push_back(group);
            }

            ActiveActionChange(createMenu, null);
        }
Exemplo n.º 2
0
        /* инициализаци¤ списка групп */
        private void init_combo_group()
        {
            try
            {
                if (gType == 2)
                {
                    comboBoxGroup.Enabled = false;
                }
                else
                {
                    comboBoxGroup.Items.Clear();

                    clGroup = new CGroup(connect);
                    List <STGroup> list = clGroup.GetListGroup(IS.idseason, gDiv, gStage);

                    if (list.Count > 0)
                    {
                        comboBoxGroup.Items.Add("");

                        comboBoxGroup.Enabled = true;

                        foreach (STGroup item in list)
                        {
                            comboBoxGroup.Items.Add(item.namegroup);
                        }
                    }
                    else
                    {
                        comboBoxGroup.Enabled = false;
                    }
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); }
        }
Exemplo n.º 3
0
 private void Physics_CheckedChanged(object sender, EventArgs e)
 {
     //selects and reveals Physics Group
     Pgroup.Show();
     CGroup.Hide();
     SeriesPara.Hide();
 }
Exemplo n.º 4
0
        public void task_250_1_4_to_7()         // повтор всех атрибутов кроме неизменяемых
        {
            //arrange
            MGroup gr = new MGroup("17-ИСбо-2а", 1, "ИСиТ", 1, 1, 0, 0, "Воскресенье");
            CGroup cg = new CGroup();

            cg.Insert(gr);
            bool expected = true;
            //act
            MGroup gr1 = new MGroup("17-ИСбо-2б", 2, "ИСиТД", 2, 2, 1, 1, "Воскресенье");

            cg.Insert(gr1);
            //gr1.Group = "17-ИДбо-2б";
            gr1.Semester         = 1;
            gr1.Specialty        = "ИСиТ";
            gr1.Shift            = 1;
            gr1.Students         = 1;
            gr1.MaxNumberOfClass = 0;
            gr1.MinNumberOfClass = 0;
            gr1.Weekends         = "Воскресенье";
            bool actual = cg.Update(gr1);

            //assert
            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 5
0
        public void task_250_1_1()         // Изменение когда все поля отличаются
        {
            //arrange
            MGroup gr = new MGroup("17-ИСбо-2а", 1, "ИСиТ", 1, 1, 0, 0, "Воскресенье");
            CGroup cg = new CGroup();

            cg.Insert(gr);
            bool expected = true;
            //act
            MGroup gr1 = new MGroup("17-ИСбо-2б", 2, "ИСиТД", 2, 2, 1, 1, "Воскресенье");

            cg.Insert(gr1);
            //gr1.Group = "17-ИДбо-2б";
            //gr1.Semester = 3;
            //gr1.Specialty = "ТМ";
            gr1.Shift            = 2;
            gr1.Students         = 3;
            gr1.MaxNumberOfClass = 3;
            gr1.MinNumberOfClass = 4;
            gr1.Weekends         = "Суббота";
            bool actual = cg.Update(gr1);

            //assert
            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 6
0
        private void CalendarGames_Load(object sender, EventArgs e)
        {
            try
            {
                clGame     = new CGame(connect);
                clTeam     = new CTeam(connect);
                clDivision = new CDivision(connect);
                clGroup    = new CGroup(connect);

                //  init_combo();

                this.WindowState = FormWindowState.Maximized;

                gpos = 0;

                bDivision   = false;
                bType       = false;
                iIdDivision = -1;
                iIdType     = -1;

                init_combo();

                init_data();

                recom = null;
            }
            catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); }
        }
Exemplo n.º 7
0
 private void Circuits_CheckedChanged(object sender, EventArgs e)
 {
     //selects and reveals Circuits Group
     CGroup.Show();
     Pgroup.Hide();
     SeriesPara.Show();
 }
Exemplo n.º 8
0
        protected override AbstractShape createShapes(string code)
        {
            AbstractShape shape = null;

            switch (code)
            {
            case "Circle":
                shape = new CCircle();
                break;

            case "Rectangle":
                shape = new CRectangle();
                break;

            case "Polygon":
                shape = new CPolygon();
                break;

            case "Star":
                shape = new CStar();
                break;

            case "Group":
                shape = new CGroup();
                break;
            }

            return(shape);
        }
Exemplo n.º 9
0
            public virtual void Render(EtaCtlGraph ctl_graph, CGroup group, DrawingContext dc, ref double description_offset, double x, double y, double width, double height, Brush foreground, Typeface typeface)
            {
                FormattedText _ft_description = new FormattedText(Description, CultureInfo.CurrentCulture, FlowDirection.LeftToRight, typeface, 10, foreground);
                double        _ftd_x          = group.DescriptionCorner == CGroup.EDescriptionCorner.LeftTop || group.DescriptionCorner == CGroup.EDescriptionCorner.LeftBottom ? x : x + width - _ft_description.Width;
                double        _ftd_y          = group.DescriptionCorner == CGroup.EDescriptionCorner.LeftTop || group.DescriptionCorner == CGroup.EDescriptionCorner.RightTop ? y + description_offset : y + height - description_offset - _ft_description.Height;

                dc.DrawText(_ft_description, new Point(_ftd_x, _ftd_y)); description_offset += _ft_description.Height;
            }
Exemplo n.º 10
0
        private void buttonOk_Click(object sender, EventArgs e)
        {
            int?itype;
            int?iidstage;

            try
            {
                if (iddivision > 0)
                {
                    if (type >= 0)
                    {
                        itype = type;
                    }
                    else
                    {
                        itype = null;
                    }

                    if (idstage > 0)
                    {
                        iidstage = idstage;
                    }
                    else
                    {
                        iidstage = null;
                    }


                    string     text        = null;
                    List <int> lst_idgroup = new List <int>();
                    CGroup     clGroup     = new CGroup(connect);
                    for (int i = 0; i < checkedListBoxGroup.Items.Count; i++)
                    {
                        if (checkedListBoxGroup.GetItemChecked(i))
                        {
                            clGroup = new CGroup(connect, IS.idseason, iddivision, checkedListBoxGroup.Items[i].ToString());
                            if (!string.IsNullOrEmpty(text))
                            {
                                text += string.Format(",{0}", clGroup.stGroup.idgroup);
                            }
                            else
                            {
                                text = clGroup.stGroup.idgroup.ToString();
                            }
                            lst_idgroup.Add(clGroup.stGroup.idgroup);
                        }
                    }

                    //   if (!string.IsNullOrEmpty(text)) ret.strgroup = text;

                    ReportExcelRatingsTeam cl = new ReportExcelRatingsTeam(connect, IS.idseason, iddivision,
                                                                           itype, iidstage, lst_idgroup);
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); }

            // DialogResult = DialogResult.OK;
        }
Exemplo n.º 11
0
            public override void Render(EtaCtlGraph ctl_graph, CGroup group, DrawingContext dc, ref double description_offset, double x, double y, double width, double height, Brush foreground, Typeface typeface)
            {
                base.Render(ctl_graph, @group, dc, ref description_offset, x, y, width, height, foreground, typeface); Pen _pen_graph = new Pen(foreground, 1);
                double _y_diff = group.MaxGroupYValue - group.MinGroupYValue; int _samples_cnt = SamplesCount; double _group_cnt = (group.MaxGroupXValue - group.MinGroupXValue) * SamplesPerUnit;

                x += (MinXValue - group.MinGroupXValue) / (group.MaxGroupXValue - group.MinGroupXValue) * width;
                StreamGeometry _sg = new StreamGeometry();
                List <Point>   _list_points = new List <Point>(128);

                using (StreamGeometryContext _sgc = _sg.Open()) {
                    if (_samples_cnt <= 128)
                    {
                        double _x_step = width / (_group_cnt - 1); bool _is_first = true;
                        foreach (double _sample in Samples)
                        {
                            double _y_curr = y + ((group.MaxGroupYValue - _sample) / _y_diff * height);
                            if (_is_first)
                            {
                                _is_first = false; _sgc.BeginFigure(new Point(x, _y_curr), true, false);
                            }
                            else
                            {
                                _list_points.Add(new Point(x, _y_curr));
                            }
                            x += _x_step;
                        }
                    }
                    else
                    {
                        double _ovf_step = ((double)_samples_cnt) / 128;
                        double _x_step = width / _group_cnt; bool _is_first = true;
                        double _sample_trace = 0, _trace_ovf = 0; int _trace_cnt = 0;
                        IEnumerator <double> _samples_enumerator = Samples.GetEnumerator();
                        bool _is_value = _samples_enumerator.MoveNext();
                        while (_is_value)
                        {
                            double _sample = _samples_enumerator.Current;
                            if (_is_first)
                            {
                                _is_first = false; _sgc.BeginFigure(new Point(x, y + ((group.MaxGroupYValue - _sample) / _y_diff * height)), true, false);
                            }
                            _sample_trace += _sample; _trace_ovf += 1; _trace_cnt++;
                            _is_value      = _samples_enumerator.MoveNext();
                            if (_trace_ovf >= _ovf_step || (!_is_value && _trace_cnt > 0))
                            {
                                _trace_ovf -= _ovf_step; _sample_trace /= _trace_cnt;
                                double _y_curr = y + ((group.MaxGroupYValue - (_is_value ? _sample_trace : _sample)) / _y_diff * height), _x_off = _x_step * _trace_cnt;
                                _list_points.Add(new Point(x + _x_off, _y_curr)); x += _x_off;
                                _sample_trace = 0; _trace_cnt = 0;
                            }
                        }
                    }
                    _sgc.PolyLineTo(_list_points, true, false);
                }
                _sg.Freeze();
                dc.DrawGeometry(null, _pen_graph, _sg);
            }
Exemplo n.º 12
0
        private void Group_Load(object sender, EventArgs e)
        {
            try
            {
                clGroup = new CGroup(connect);

                init_data();
            }
            catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); }
        }
Exemplo n.º 13
0
        private void ReportStatsPlaer_Load(object sender, EventArgs e)
        {
            try
            {
                clDiv   = new CDivision(connect);
                clGroup = new CGroup(connect);

                init_combo_division();
            }
            catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); }
        }
Exemplo n.º 14
0
        public void Task_248_2()         //Удаление не существующей строки
        {
            //arrange
            MGroup gr       = new MGroup("17-ИСбо-2а", 1, "ИСиТ", 1, 1, 0, 0, "Воскресенье");
            bool   expected = false;
            //act
            CGroup cg     = new CGroup();
            bool   actual = cg.Delete(gr);

            //assert
            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 15
0
        public void Task_251_1()         //пустая таблица
        {
            //arrange
            bool expected = true;
            //act
            MGroup gr     = new MGroup("17-ИСбо-2а", 1, "ИСиТ", 1, 1, 0, 0, "Воскресенье");
            CGroup cg     = new CGroup();
            bool   actual = cg.Insert(gr);

            //assert
            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 16
0
        private void ReportTeamStanding_Load(object sender, EventArgs e)
        {
            try
            {
                clDiv   = new CDivision(connect);
                clGroup = new CGroup(connect);

                init_combo_division();

                dateTimePickerDate.Enabled = false;
            }
            catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); }
        }
Exemplo n.º 17
0
        public void Task_251_2()         //дуюлирование атрибута "Группа" остальные атрибуты раздичаются
        {
            //arrange
            MGroup gr       = new MGroup("17-ИСбо-2а", 1, "ИСиТ", 1, 1, 0, 0, "Воскресенье");
            CGroup cg       = new CGroup();
            bool   g        = cg.Insert(gr);
            bool   expected = false;
            //act
            MGroup gr1    = new MGroup("17-ИСбо-2а", 2, "ИСиТД", 2, 2, 1, 1, "Суббота");
            bool   actual = cg.Insert(gr1);

            //assert
            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 18
0
        public void Task_251_from_3_or_9()         // дублирование всех атрибутов, кроме атрибута "Группа"
        {
            //arrange
            MGroup gr       = new MGroup("17-ИДбо-2а", 1, "ИСиТ", 1, 1, 0, 0, "Воскресенье");
            CGroup cg       = new CGroup();
            bool   g        = cg.Insert(gr);
            bool   expected = true;
            //act
            MGroup gr1    = new MGroup("17-ИДбо-2б", 1, "ИСиТ", 1, 1, 0, 0, "Воскресенье");
            bool   actual = cg.Insert(gr1);

            //assert
            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 19
0
        public void Task_251_11()         //полное дублирование всех атрибутов
        {
            //arrange
            MGroup gr       = new MGroup("17-ТМбо-2а", 1, "ИСиТ", 1, 1, 0, 0, "Воскресенье");
            CGroup cg       = new CGroup();
            bool   g        = cg.Insert(gr);
            bool   expected = false;
            //act
            MGroup gr1    = new MGroup("17-ТМбо-2а", 1, "ИСиТ", 1, 1, 0, 0, "Воскресенье");
            bool   actual = cg.Insert(gr1);

            //assert
            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 20
0
        public void Task_251_10()         //добавление записи ктороая не дублирует ни один атрибут уже имеющейся записи
        {
            //arrange
            MGroup gr       = new MGroup("17-ЮФбо-2а", 1, "ИСиТ", 1, 1, 0, 0, "Воскресенье");
            CGroup cg       = new CGroup();
            bool   g        = cg.Insert(gr);
            bool   expected = true;
            //act
            MGroup gr1    = new MGroup("17-ЮФбо-2б", 2, "ИСиТД", 2, 2, 1, 1, "Суббота");
            bool   actual = cg.Insert(gr1);

            //assert
            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 21
0
 private void addAssessItemGroupStyle(CGroup group)
 {
     try
     {
         SqlDataSource sds = new SqlDataSource();
         sds.ConnectionString  = connectionString;
         sds.InsertCommand     = "dbo.addAssessItemGroupStyle";
         sds.InsertCommandType = SqlDataSourceCommandType.StoredProcedure;
         sds.InsertParameters.Add(new Parameter("GroupName", DbType.String, group.name));
         sds.Insert();
     }
     catch (Exception ex)
     {
         message = ex.Message;
     }
 }
Exemplo n.º 22
0
        private void del()
        {
            try
            {
                STGroup data = GetSelectionData();

                if (MessageBox.Show("Вы действиетльно желаете удалить данную запись?", "Внимание!",
                                    MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.OK)
                {
                    CGroup clGroup = new CGroup(connect);
                    clGroup.Delete(data);
                    init_data();
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); }
        }
Exemplo n.º 23
0
 private void comboBoxGroup_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         if (comboBoxGroup.Text.Length > 0)
         {
             clGroup = new CGroup(connect, idseason, iddivision, comboBoxGroup.Text.Trim());
             idgroup = clGroup.stGroup.idgroup;
         }
         else
         {
             idgroup = 0;
         }
     }
     catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); }
 }
Exemplo n.º 24
0
        private void init_list_group(int id)
        {
            try
            {
                checkedListBoxGroup.Items.Clear();

                CGroup         clGroup = new CGroup(connect);
                List <STGroup> lst     = clGroup.GetListGroup(IS.idseason, id);

                foreach (STGroup group in lst)
                {
                    checkedListBoxGroup.Items.Add(group.namegroup);
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); }
        }
Exemplo n.º 25
0
        /// <summary>
        /// Create the QCL record.
        /// </summary>
        /// <param name="context"></param>
        protected override void DoWork(CodeActivityContext context)
        {
            var mgr = new QclManager {
                PM = PM
            };
            int chkId = mgr.CreateQcl(PatId1.Get(context),
                                      TskId.Get(context),
                                      StaffIdResponsible.Get(context),
                                      StaffIdRequesting.Get(context),
                                      DueDate.Get(context),
                                      CGroup.Get(context),
                                      PrsId.Get(context),
                                      Instructions.Get(context),
                                      Comment.Get(context));

            ChkId.Set(context, chkId);
        }
Exemplo n.º 26
0
    private void loadGroup(CItem item, int id_group)
    {
        if (dvAssessItemGroupStyles.Count > 0)
        {
            for (int i = 0; i < dvAssessItemGroupStyles.Count; i++)
            {
                if (Convert.ToInt32(dvAssessItemGroupStyles.Table.Rows[i]["ID_Group"]) == id_group)
                {
                    CGroup group = new CGroup();
                    group.id   = Convert.ToInt32(dvAssessItemGroupStyles.Table.Rows[i]["ID_Group"]);
                    group.name = dvAssessItemGroupStyles.Table.Rows[i]["GroupName"].ToString();

                    item.group = group;
                }
            }
        }
    }
Exemplo n.º 27
0
        private void ReportStatsTeamAndPlayers_Load(object sender, EventArgs e)
        {
            try
            {
                clTeam  = new CTeam(connect);
                clDiv   = new CDivision(connect);
                clGroup = new CGroup(connect);
                clET    = new CEntryTeam(connect);

                prAll = false;

                init_combo_division();

                radioButtonUsTeam.Checked = true;
            }
            catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); }
        }
Exemplo n.º 28
0
        /// <summary>
        /// Checks for QCL's with attributes matching the parameters passed in.
        /// </summary>
        /// <param name="context"></param>
        protected override void DoWork(CodeActivityContext context)
        {
            var mgr = new QclManager {
                PM = PM
            };
            bool qclExists = mgr.CheckQclExists(PatId1.Get(context),
                                                TskId.Get(context),
                                                StaffIdResponsible.Get(context),
                                                StaffIdRequesting.Get(context),
                                                DueDate.Get(context),
                                                CGroup.Get(context),
                                                PrsId.Get(context),
                                                Instructions.Get(context),
                                                Comment.Get(context),
                                                Completed.Get(context));

            QclExists.Set(context, qclExists);
        }
Exemplo n.º 29
0
        private void comboBoxGroup_SelectedIndexChanged(object sender, EventArgs e)
        {
            string name = null;

            try
            {
                if (comboBoxGroup.Text.Length > 0)
                {
                    name    = comboBoxGroup.Text.Trim();
                    clGroup = new CGroup(connect, IS.idseason, gDiv, name);

                    gGroup = clGroup.stGroup.idgroup;

                    init_combo_team();
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); }
        }
Exemplo n.º 30
0
        private void DlgGroup_Load(object sender, EventArgs e)
        {
            try
            {
                this.Text = caption;

                clGroup    = new CGroup(connect);
                clScheme   = new CScheme(connect);
                clDivision = new CDivision(connect);

                init_combo_division();

                init_combo_scheme(0);

                set_data();
            }
            catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); }
        }