Esempio n. 1
0
        public SaveDeviation(String actionType, DeviationList deviationList, PrincipalWin principalWin)
        {
            InitializeComponent();
            deviationModel = new DeviationModel();
            emailSender    = new EmailSender();
            languageModel  = new LanguageModel();

            this.actionType = actionType;

            this.deviationList = deviationList;
            this.principalWin  = principalWin;

            //set  language
            if (LanguageName.languageName != "DeviationManager.Lang.language_en")
            {
                this.setLanguage();
            }

            initialize();

            if (actionType == "newDeviation")
            {
                addApproval();
                setSignature();

                //approvement Table readonly
                this.approvementGroupDataGrid.ReadOnly = true;
            }
        }
        public DeviationList()
        {
            InitializeComponent();

            deviationModel = new DeviationModel();
            autorisation   = new Autorisation();
            emailSender    = new EmailSender();
            languageModel  = new LanguageModel();

            //DataGridViw Configuration
            this.DataViewConfiguration();

            //initilize
            this.setLabelDeviationNumber();

            //init dates
            this.initdates();

            //show deviation list
            this.showDeviationList();

            //set  language
            if (LanguageName.languageName != "DeviationManager.Lang.language_en")
            {
                this.setLanguage();
            }

            this.DeviationDataGridView.Columns[9].DefaultCellStyle.ForeColor = Color.Blue;
        }
Esempio n. 3
0
        public EmailGUI(Deviation deviation, SaveDeviation saveDeviation)
        {
            InitializeComponent();
            this.deviation      = deviation;
            this.saveDeviation  = saveDeviation;
            this.deviationModel = new DeviationModel();
            emailSender         = new EmailSender();
            languageModel       = new LanguageModel();

            //generate email Content from deviation
            this.generateEmailContent();
        }
        public ApprovementGroupGUI()
        {
            InitializeComponent();

            deviationModel = new DeviationModel();

            //DataGridView Configuration
            this.DataViewConfiguration();

            //list approvement group
            this.showApprovementGroupList();
        }
Esempio n. 5
0
        public PrincipalWin()
        {
            InitializeComponent();
            this.autorisation = new Autorisation();
            this.emailSender  = new EmailSender();

            deviationModel = new DeviationModel();
            this.init();

            //initilize deviation list
            this.setLabelDeviationNumber();

            this.DeviationDataGridView.Columns[9].DefaultCellStyle.ForeColor = Color.Goldenrod;
        }
Esempio n. 6
0
        public static List <ArticleRating> PredictRatings(Dictionary <int, Vector> userRatings, DeviationModel[,] table, int targetUser, int[] idsToPredict)
        {
            List <ArticleRating> predictions = new List <ArticleRating>();

            for (int i = 0; i < idsToPredict.Length; i++)
            {
                float numerator   = 0;
                float denominator = 0;
                for (int j = 0; j < userRatings[targetUser].ArticleRatings.Length; j++)
                {
                    ArticleRating articleRating = userRatings[targetUser].ArticleRatings.FirstOrDefault(x => x.ArticleId == DataParser.ids[j]);
                    if (articleRating.Rating != null)
                    {
                        DeviationModel model = table[DataParser.ids.IndexOf(idsToPredict[i]), DataParser.ids.IndexOf(articleRating.ArticleId)];
                        numerator   += ((float)articleRating.Rating + model.Deviation) * model.NumberOfRatingsForBoth;
                        denominator += model.NumberOfRatingsForBoth;
                    }
                }
                predictions.Add(new ArticleRating(idsToPredict[i], numerator / denominator));
            }

            return(predictions);
        }
Esempio n. 7
0
        public Connection()
        {
            InitializeComponent();

            this.deviationModel = new DeviationModel();
        }
Esempio n. 8
0
        public ChangePassword()
        {
            InitializeComponent();

            this.deviationModel = new DeviationModel();
        }