Exemple #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            nobatdehi temp = new nobatdehi();

            temp.doctorname = txtdoctorname.Text;
            managenobat manage = new managenobat(temp);

            txtfrom.Text = manage.getfreetime(dateTimePicker1.Value).TimeOfDay.ToString();
            DateTime xs = new DateTime(dateTimePicker1.Value.Year, dateTimePicker1.Value.Month, dateTimePicker1.Value.Day, 20, 0, 0);

            txtto.Text = xs.TimeOfDay.ToString();
        }
        private void button6_Click(object sender, EventArgs e)
        {
            paymentturn pay = new paymentturn(txtdoctor.Text, Convert.ToDouble(txtpayment.Text) / Convert.ToInt32(textBox1.Text), Convert.ToInt32(textBox1.Text), datenow.Value);

            readandwritepayment.writeinfile(pay);
            managenobat manage = new managenobat(x);

            manage.deletenobat(datenow.Value, txtfilecode.Text);
            foreach (Control c in panel1.Controls)
            {
                if (c is TextBox d)
                {
                    d.Text = "";
                }
            }
        }
        private void button1_Click(object sender, EventArgs e)
        { /* Boolean x= deleteturn.deleteturnfun(dateturn.Value, txtfileid.Text);*/
            nobatdehi delno = new nobatdehi();

            delno.date = dateturn.Value;
            managenobat manage = new managenobat(delno);
            Boolean     x      = manage.deletenobat(dateturn.Value, txtfileid.Text);

            if (x == true)
            {
                txtresult.Text = "succsesful";
            }
            else
            {
                txtresult.Text = "faild";
            }
        }
        private void button2_Click(object sender, EventArgs e)
        {
            if (txtpayment.Text == "")
            {
                MessageBox.Show("not correct");
                return;
            }
            string saveincomefile = Application.StartupPath + "\\income.txt";
            string cost           = txtdoctor.Text + "*" + txtpayment.Text + "\n";

            System.IO.File.AppendAllText(saveincomefile, cost);
            managenobat manage = new managenobat(x);

            manage.deletenobat(datenow.Value, txtfilecode.Text);
            foreach (Control c in panel1.Controls)
            {
                if (c is TextBox d)
                {
                    d.Text = "";
                }
            }
        }
Exemple #5
0
        private void btnratings_Click(object sender, EventArgs e)
        {
            if (!chkrestrictions.Checked)
            {
                chkodd.Checked  = false;
                chkeven.Checked = false;
            }
            DateTime  date = ratetime.Value;
            nobatdehi x;
            string    work       = "";
            string    doctorname = "";

            if (chkeven.Checked == true)
            {
                if (date.DayOfWeek == DayOfWeek.Saturday || date.DayOfWeek == DayOfWeek.Monday || date.DayOfWeek == DayOfWeek.Wednesday)
                {
                    MessageBox.Show("please inter true date,this date is " + date.DayOfWeek + " and isnt odd");
                    return;
                }
            }
            else if (chkodd.Checked == true)
            {
                if (date.DayOfWeek == DayOfWeek.Sunday || date.DayOfWeek == DayOfWeek.Tuesday || date.DayOfWeek == DayOfWeek.Thursday)
                {
                    MessageBox.Show("please inter true date,this date is " + date.DayOfWeek + " and isnt even");
                    return;
                }
            }
            if (date.DayOfWeek == DayOfWeek.Friday)
            {
                MessageBox.Show("its closed in fridays");
                return;
            }
            if (rbExamination.Checked == true)
            {
                work       = "moayene";
                doctorname = cbexam.SelectedItem.ToString();
            }
            else if (rb1serface.Checked == true)
            {
                work       = "tarmim1";
                doctorname = cbsu1.SelectedItem.ToString();
            }
            else if (rbsurface2.Checked == true)
            {
                work       = "tarmim2";
                doctorname = cbsu2.SelectedItem.ToString();
            }
            else if (rbroot.Checked == true)
            {
                work       = "darmanreshe";
                doctorname = cbroot.SelectedItem.ToString();
            }
            if (chkhaveid.Checked == true)
            {
                x = new nobatdehi(date, txtfilecode.Text, work, doctorname, chkeven.Checked, chkodd.Checked);
            }
            else
            {
                path = Application.StartupPath;
                string name       = txtname.Text;
                string familyname = txtfamily.Text;
                string phone      = txtphone.Text;
                string id         = txtfilecode.Text;
                x = new nobatdehi(name, familyname, id, work, phone, date, txtfilecode.Text, doctorname, chkeven.Checked, chkodd.Checked);
            }
            //DateTime s = x.readandgetnobat(path);
            managenobat manage = new managenobat(x);
            DateTime    s      = manage.getnobat();

            //DateTime s =
            if (s == new DateTime(1, 1, 1, 1, 1, 1))
            {
                DialogResult res = MessageBox.Show("not have turn in this day do you want to set after this day", "settime", MessageBoxButtons.YesNo, MessageBoxIcon.Error);
                if (res == DialogResult.Yes)
                {
                    //s = x.another();
                    s = manage.another();
                    txtresult.Text = s.AddMinutes(+(double)x.minute).ToString();
                    txtfrom.Text   = s.ToString() + " " + s.DayOfWeek;
                }
            }
            else
            {
                txtresult.Text = s.AddMinutes(+(double)x.minute).ToString();
                txtfrom.Text   = s.ToString() + " " + s.DayOfWeek;
            }
        }