public MainForm()
 {
     InitializeComponent();
     if (!File.Exists("Info.xml"))
     {
         Informations.write("<نام بیمارستان>", "<نام مدیر>");
     }
 }
 private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
 {
     this.Invoke(new MethodInvoker(delegate() {
         label3.Text               = "بیمارستان " + Informations.read().HospitalName;
         comboBoxEx1.DataSource    = BL.Read().Select(a => new { a.Id, a.Name }).ToList();
         comboBoxEx1.DisplayMember = "Name";
         comboBoxEx1.ValueMember   = "Id";
         comboBoxEx1.SelectedValue = -1;
     }));
 }
        public static Informations read()
        {
            XmlSerializer serializer;

            serializer = new XmlSerializer(typeof(Informations));
            StreamReader reader = new StreamReader("Info.xml");
            Informations a      = (Informations)serializer.Deserialize(reader);

            reader.Close();
            return(a);
        }
        public static void write(String HName, String MName)
        {
            XmlSerializer serializer;

            serializer = new XmlSerializer(typeof(Informations));
            StreamWriter writer = new StreamWriter("Info.xml");
            Informations a      = new Informations();

            a.HospitalName = HName;
            a.ManagerName  = MName;
            serializer.Serialize(writer, a);
            writer.Close();
        }
 private void MainForm_Shown(object sender, EventArgs e)
 {
     labelX1.Text = "بیمارستان " + Informations.read().HospitalName;
 }
Exemplo n.º 6
0
 private void Form1_Activated(object sender, EventArgs e)
 {
     label2.Text = Informations.read().ManagerName;
     label3.Text = "بیمارستان " + Informations.read().HospitalName;
 }
Exemplo n.º 7
0
 private void buttonX1_Click_1(object sender, EventArgs e)
 {
     Informations.write(textBoxX2.Text, textBoxX1.Text);
     this.Hide();
 }
Exemplo n.º 8
0
 public Manager_Settings()
 {
     InitializeComponent();
     info = Informations.read();
 }