Example #1
0
        private void Uj_interju_mentes_btn_Click(object sender, RoutedEventArgs e)
        {
            if (inter_helyszin.Text == "" || inter_idopont_hour.Text == "" || inter_idopont_hour_end.Text == "" || inter_date_year.Text == "" || inter_date_month.Text == "" || inter_date_day.Text == "")
            {
                InterviewInfo_tbx.Text = "Minden mező kitöltése kötelező";
                return;
            }
            if (Convert.ToUInt32(inter_date_year.Text) < 1900 ||
                Convert.ToUInt32(inter_date_year.Text) > 2100 ||
                Convert.ToUInt32(inter_date_day.Text) > 31 ||
                Convert.ToUInt32(inter_date_day.Text) < 1 ||
                Convert.ToUInt32(inter_date_month.Text) > 12 ||
                Convert.ToUInt32(inter_date_month.Text) < 1)
            {
                InterviewInfo_tbx.Text = "Dátum megadása hibás!";
                return;
            }
            int hour_start   = Convert.ToInt32(inter_idopont_hour.Text);
            int minute_start = (inter_idopont_minute.Text != "" ? Convert.ToInt32(inter_idopont_minute.Text) : 0);
            int hour_end     = Convert.ToInt32(inter_idopont_hour_end.Text);
            int minute_end   = (inter_idopont_minute_end.Text != "" ? Convert.ToInt32(inter_idopont_minute_end.Text) : 0);

            if (hour_start == 0 || hour_start > 24 || minute_start > 59 || hour_end == 0 || hour_end > 24 || minute_end > 59)
            {
                InterviewInfo_tbx.Text = "Időpont megadása hibás!";
                return;
            }
            if ((hour_start == hour_end && minute_end < minute_start) || hour_end < hour_start)
            {
                InterviewInfo_tbx.Text = "Időpont megadása hibás!";
                return;
            }

            string        datum   = inter_date_year.Text + "." + DateHandler.NormalForm(Convert.ToUInt32(inter_date_month.Text).ToString()) + "." + DateHandler.NormalForm(Convert.ToUInt32(inter_date_day.Text).ToString()) + ".";
            ModelUserData user    = UserData.GetById(projekt.hr_id);
            string        idopont = hour_start + ":" + (minute_start < 10 ? "0" + minute_start.ToString() : minute_start.ToString()) + " - " + hour_end + ":" + (minute_end < 10 ? "0" + minute_end.ToString() : minute_end.ToString());

            new Email().Send(user.email, new EmailTemplate().Meeting_igenyles(user.name, Session.UserData.name, inter_jelolt.Text, projekt.megnevezes_projekt, datum, idopont, inter_helyszin.Text, inter_leiras.Text));
            new ModelSzakmaiInterviewIgeny().Insert(new ModelSzakmaiInterviewIgeny {
                jelolt_id = Convert.ToInt32(inter_jelolt_id.Text), projekt_id = projekt.id, user_id = Session.UserData.id, state = 1
            });
            formLoader();
            Interview_Panel_Close();
        }
Example #2
0
        protected void uj_interju_mentes_btn_Click(object sender, RoutedEventArgs e)
        {
            if (inter_helyszin.Text == "" || inter_idopont_hour.Text == "" || inter_idopont_hour_end.Text == "" || inter_date_year.Text == "" || inter_date_month.Text == "" || inter_date_day.Text == "")
            {
                InterviewInfo_tbx.Text = "Minden mező kitöltése kötelező";
                return;
            }
            if (Convert.ToUInt32(inter_date_year.Text) < 1900 ||
                Convert.ToUInt32(inter_date_year.Text) > 2100 ||
                Convert.ToUInt32(inter_date_day.Text) > 31 ||
                Convert.ToUInt32(inter_date_day.Text) < 1 ||
                Convert.ToUInt32(inter_date_month.Text) > 12 ||
                Convert.ToUInt32(inter_date_month.Text) < 1)
            {
                InterviewInfo_tbx.Text = "Dátum megadása hibás!";
                return;
            }
            int hour_start   = Convert.ToInt32(inter_idopont_hour.Text);
            int minute_start = (inter_idopont_minute.Text != "" ? Convert.ToInt32(inter_idopont_minute.Text) : 0);
            int hour_end     = Convert.ToInt32(inter_idopont_hour_end.Text);
            int minute_end   = (inter_idopont_minute_end.Text != "" ? Convert.ToInt32(inter_idopont_minute_end.Text) : 0);

            if (hour_start == 0 || hour_start > 24 || minute_start > 59 || hour_end == 0 || hour_end > 24 || minute_end > 59)
            {
                InterviewInfo_tbx.Text = "Időpont megadása hibás!";
                return;
            }
            if ((hour_start == hour_end && minute_end < minute_start) || hour_end < hour_start)
            {
                InterviewInfo_tbx.Text = "Időpont megadása hibás!";
                return;
            }

            string datum = inter_date_year.Text + "." + DateHandler.NormalForm(Convert.ToUInt32(inter_date_month.Text).ToString()) + "." + DateHandler.NormalForm(Convert.ToUInt32(inter_date_day.Text).ToString()) + ".";

            new Interview().addInterview(datum, inter_cim.SelectedItem.ToString(), inter_leiras.Text, inter_helyszin.Text, hour_start + ":" + (minute_start < 10 ? "0" + minute_start.ToString() : minute_start.ToString()), hour_end + ":" + (minute_end < 10 ? "0" + minute_end.ToString() : minute_end.ToString()));
            projectFormLoader();
            interviewPanelClose();
        }