public AddStudentView()
 {
     InitializeComponent();
     this.DataContext = this;
     main             = this;
     BorderColor      = AppVariable.GetBrush(MainWindow.main.BorderBrush.ToString());
 }
        public MaterialCircular(string Row, string Title, string Category, string Type, string SubType, string Date, string Link)
        {
            InitializeComponent();
            DataContext      = this;
            Dlink            = Link;
            BorderColor      = AppVariable.GetBrush(FindElement.Settings.SkinCode ?? AppVariable.DEFAULT_BORDER_BRUSH);
            txtCategory.Text = Category;
            txtDate.Text     = Date;
            txtSubType.Text  = SubType;
            txtTitle.Text    = Title;
            txtType.Text     = Type;
            txtRow.Text      = Row;

            if (!System.IO.Directory.Exists(AppVariable.fileNameBakhsh + txtRow.Text + txtTitle.Text))
            {
                txtDown.Text = "دانلود";
            }
            else
            {
                txtDown.Text = "مطالعه";
                Style style = this.FindResource("WorkButton") as Style;
                btnSave.Style  = style;
                imgDown.Source = new BitmapImage(new Uri("pack://application:,,,/MoalemYar;component/Resources/pdf.png", UriKind.Absolute));
            }
        }
 public AddQuestionsView()
 {
     InitializeComponent();
     this.DataContext = this;
     main             = this;
     BorderColor      = AppVariable.GetBrush(MainWindow.main.BorderBrush.ToString());
     strDate          = pc.GetYear(DateTime.Now).ToString("0000") + "/" + pc.GetMonth(DateTime.Now).ToString("00") + "/" + pc.GetDayOfMonth(DateTime.Now).ToString("00");
 }
 public AddSchoolView()
 {
     InitializeComponent();
     this.DataContext = this;
     main             = this;
     BorderColor      = AppVariable.GetBrush(MainWindow.main.BorderBrush.ToString());
     GenerateEducateYear();
 }
Exemple #5
0
 public About()
 {
     InitializeComponent();
     DataContext = this;
     History     = Properties.Resources.History;
     AppName     = AppVariable.getAppTitle;
     AppVersion  = AppVariable.getAppVersion;
     TimeColor   = AppVariable.GetBrush(MainWindow.main.BorderBrush.ToString());
 }
Exemple #6
0
        public AttendancelistView()
        {
            InitializeComponent();

            this.DataContext = this;
            main             = this;
            strDate          = pc.GetYear(DateTime.Now).ToString("0000") + "/" + pc.GetMonth(DateTime.Now).ToString("00") + "/" + pc.GetDayOfMonth(DateTime.Now).ToString("00");
            txtDate.Text     = string.Format("تاریخ امروز : {0} ", strDate);
            BorderColor      = AppVariable.GetBrush(MainWindow.main.BorderBrush.ToString());
        }
        public void getTopStudent(long BaseId)
        {
            using (var db = new DataClass.myDbContext())
            {
                var query = db.Scores.Join(
                    db.Students,
                    c => c.StudentId,
                    v => v.Id,
                    (c, v) => new DataClass.DataTransferObjects.StudentsScoresDto {
                    Id = c.Id, BaseId = v.BaseId, StudentId = v.Id, Name = v.Name, LName = v.LName, FName = v.FName, Scores = c.Scores
                }
                    ).OrderBy(x => x.Scores).Where(x => x.BaseId == BaseId).ToList();


                var res = query.GroupBy(x => new { x.StudentId })
                          .Select(x => new
                {
                    x.Key.StudentId,
                    Name  = x.FirstOrDefault().Name,
                    LName = x.FirstOrDefault().LName,
                    FName = x.FirstOrDefault().FName,
                    Sum   = x.Sum(y => AppVariable.EnumToNumber(y.Scores))
                }).OrderByDescending(x => x.Sum).Take(6).ToArray();

                foreach (var item in res)
                {
                    Arthas.Controls.Metro.MetroProgressBar metroProgressBar;
                    TextBlock textBlock;
                    Control   _currentUser;
                    metroProgressBar = new Arthas.Controls.Metro.MetroProgressBar()
                    {
                        FlowDirection = FlowDirection.LeftToRight,
                        Background    = AppVariable.GetBrush("#15a4fa"),
                        CornerRadius  = new CornerRadius(0),
                        Value         = item.Sum
                    };
                    textBlock = new TextBlock()
                    {
                        Opacity  = .4,
                        Margin   = new Thickness(0, 5, 0, 0),
                        FontSize = 15,
                        Text     = item.Name + " " + item.LName
                    };


                    _currentUser = metroProgressBar;
                    stkDash.Children.Add(textBlock);

                    stkDash.Children.Add(_currentUser);
                }
            }
        }
 public AzmonHistoryView()
 {
     InitializeComponent();
     DataContext = this;
     BorderColor = AppVariable.GetBrush(FindElement.Settings.ChartColor ?? AppVariable.CHART_GREEN);
 }
        private void dataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            try
            {
                dynamic selectedItem = dataGrid.SelectedItems[0];

                waterfallFlow.Children.Clear();
                Series series = new ColumnSeries();

                switch (FindElement.Settings.ChartType ?? 0)
                {
                case 0:
                    series = new ColumnSeries {
                    };
                    break;

                case 1:
                    series = new StackedColumnSeries {
                    };
                    break;

                case 2:
                    series = new LineSeries {
                    };
                    break;

                case 3:
                    series = new StepLineSeries {
                    };
                    break;

                case 4:
                    series = new StackedAreaSeries {
                    };
                    break;
                }

                getStudentScore(selectedItem.Id); // get Student scores

                //get scores merge duplicates and replace string to int
                var score = _initialCollection.GroupBy(x => new { x.Book, x.Date, x.StudentId })
                            .Select(x => new
                {
                    x.Key.StudentId,
                    x.Key.Book,
                    x.Key.Date,
                    Sum = x.Sum(y => AppVariable.EnumToNumber(y.Scores))
                }).ToArray();

                //get Book Count for generate chart
                var bookCount = score.GroupBy(x => new { x.Book })
                                .Select(g => new
                {
                    g.Key.Book
                }).ToList();

                MaterialChart _addUser;
                Control       _currentUser;

                //generate chart based on count of books
                foreach (var item in bookCount)
                {
                    _addUser     = new MaterialChart(item.Book, selectedItem.Name + " " + selectedItem.LName, getDateArray(item.Book), getScoreArray(item.Book), getAverage(item.Book), getAverageStatus(item.Book), series, AppVariable.GetBrush(FindElement.Settings.ChartColor ?? AppVariable.CHART_GREEN));
                    _currentUser = _addUser;
                    waterfallFlow.Children.Add(_currentUser);
                }

                waterfallFlow.Refresh();
            }
            catch (ArgumentNullException) { }
            catch (NullReferenceException)
            {
            }
        }