| [710] | 1 | using System;
|
|---|
| 2 | using System.Collections.Generic;
|
|---|
| 3 | using System.Text;
|
|---|
| 4 | using BazaZamowien.PREMIEDataSetTableAdapters;
|
|---|
| 5 |
|
|---|
| 6 | namespace BazaZamowien.Classes
|
|---|
| 7 | {
|
|---|
| 8 | class PremieMail
|
|---|
| 9 | {
|
|---|
| 10 | public static void initMailForm(MailForm form, int IDEpremia)
|
|---|
| 11 | {
|
|---|
| 12 | PREMIE2TableAdapter adapter = new PREMIE2TableAdapter();
|
|---|
| 13 | adapter.Connection.ConnectionString = ConnString.getConnString().PremieConnStr;
|
|---|
| 14 | PREMIEDataSet.PREMIE2DataTable table = adapter.GetDataByID(IDEpremia);
|
|---|
| 15 | PREMIEDataSet.PREMIE2Row row = table[0];
|
|---|
| 16 |
|
|---|
| 17 | form.odTextBox.Text = "Dyrekcja Commercial Travellers";
|
|---|
| 18 | form.odEmailTextBox.Text = User.getUser().Email;
|
|---|
| 19 | form.doWiadomosciTextBox.Text = User.getUser().Email;
|
|---|
| 20 |
|
|---|
| 21 | decimal premia = Convert.ToDecimal(row["netto"]);
|
|---|
| 22 |
|
|---|
| 23 | if (premia > 0) {
|
|---|
| 24 | form.tematTextBox.Text = "PREMIA";
|
|---|
| 25 | form.trescTextBox.Lines = new string[] {"Gratulujê","",
|
|---|
| 26 | "Jest mi niezmiernie mi³o poinformowaæ, ¿e z uwagi na",
|
|---|
| 27 | "<<<OPIS>>> w miesiacu <<<ROK>>>.<<<MIESIAC>>> ",
|
|---|
| 28 | "przezna³em ci premie w wysokoci Brutto=<<<BRUTTO>>>.","",
|
|---|
| 29 | "¯yczê jak najlepszych wyników i zadowolenia z pracy w " + DateTime.Today.Year + " roku!"};
|
|---|
| 30 | form.trescTextBox.Text = form.trescTextBox.Text.Replace("<<<OPIS>>>", row.OPIS);
|
|---|
| 31 | form.trescTextBox.Text = form.trescTextBox.Text.Replace("<<<ROK>>>", row.ROK.ToString());
|
|---|
| 32 | form.trescTextBox.Text = form.trescTextBox.Text.Replace("<<<MIESIAC>>>", row.MIESIAC.ToString());
|
|---|
| 33 | form.trescTextBox.Text = form.trescTextBox.Text.Replace("<<<BRUTTO>>>", String.Format("{0:C}",row.BRUTTO));
|
|---|
| 34 | }
|
|---|
| 35 | else
|
|---|
| 36 | {
|
|---|
| 37 | form.tematTextBox.Text = "Potr¹cenie premii";
|
|---|
| 38 | form.trescTextBox.Lines = new string[]{ "Potr¹cenie premii","",
|
|---|
| 39 | "Agencja Akwizycji Commercial Travellers z informuje Pani¹/Pana <<<OSOBA>>>, ",
|
|---|
| 40 | "¿e w <<<ROK>>>.<<<MIESIAC>>> z powodu ",
|
|---|
| 41 | "\"<<<OPIS>>>\" bylismy zmuszeni potr¹ciæ kwotê Netto=<<<NETTO>>>, Brutto=<<<BRUTTO>>>.","",
|
|---|
| 42 | "Mam nadziejê, ¿e robimy to po raz ostatni ..."};
|
|---|
| 43 | form.trescTextBox.Text = form.trescTextBox.Text.Replace("<<<OSOBA>>>", row.NAME);
|
|---|
| 44 | form.trescTextBox.Text = form.trescTextBox.Text.Replace("<<<OPIS>>>", row.OPIS);
|
|---|
| 45 | form.trescTextBox.Text = form.trescTextBox.Text.Replace("<<<ROK>>>", row.ROK.ToString());
|
|---|
| 46 | form.trescTextBox.Text = form.trescTextBox.Text.Replace("<<<MIESIAC>>>", row.MIESIAC.ToString());
|
|---|
| 47 | form.trescTextBox.Text = form.trescTextBox.Text.Replace("<<<BRUTTO>>>", String.Format("{0:C}",row.BRUTTO));
|
|---|
| 48 | form.trescTextBox.Text = form.trescTextBox.Text.Replace("<<<NETTO>>>", String.Format("{0:C}",row.NETTO));
|
|---|
| 49 | }
|
|---|
| 50 |
|
|---|
| 51 |
|
|---|
| 52 | BoundItem item = new BoundItem(PremieUtils.podajMailaPracownika(Convert.ToInt32(row.IDEPracownika)),row.NAME);
|
|---|
| 53 |
|
|---|
| 54 | form.doComboBox.Items.Add(item);
|
|---|
| 55 | form.doComboBox.SelectedItem = item;
|
|---|
| 56 | }
|
|---|
| 57 | }
|
|---|
| 58 | }
|
|---|