Esempio n. 1
0
        public void SendSurvey(SurveyForm sfrm)
        {
            //MOG_SURVEY_PRIORITY priority;
            mtime = new MOG_Time();
            mtime.UpdateTime();

            //Controler stuff
            MOG_ControllerSurvey mController = new MOG_ControllerSurvey(mMog);

            mController.SetTitle(sfrm.SurveyNameTextBox.Text);
            mController.SetCategory(sfrm.SurveyCatComboBox.Text);
            mController.SetCreateTime(mtime.GetTimeStamp());
            mController.SetDescription(sfrm.SurveyDescTextBox.Text);

            // Set the priority
            MOG_SURVEY_PRIORITY priority = MOG_SURVEY_PRIORITY.MOG_SURVEY_PRIORITY_None;

            switch (sfrm.SurveyPriorityComboBox.Text)
            {
            case "None":
                priority = MOG_SURVEY_PRIORITY.MOG_SURVEY_PRIORITY_None;
                break;

            case "Low":
                priority = MOG_SURVEY_PRIORITY.MOG_SURVEY_PRIORITY_Low;
                break;

            case "Medium":
                priority = MOG_SURVEY_PRIORITY.MOG_SURVEY_PRIORITY_Medium;
                break;

            case "High":
                priority = MOG_SURVEY_PRIORITY.MOG_SURVEY_PRIORITY_High;
                break;

            case "Urgent":
                priority = MOG_SURVEY_PRIORITY.MOG_SURVEY_PRIORITY_Urgent;
                break;
            }
            mController.SetPriority(priority);

            //Figure out
            string users = "";

            mController.SetSurveyUsers(users);
            mController.SetCreator(mMog.GetUser().GetUserName());
            mController.SetExpireTime(sfrm.SurveyExpireDateTimePicker.Value.ToString());

            mController.Create();
            mController.Send();

            // Update the surveys window
            Update();
        }