private void mbtnInsert_Click(object sender, EventArgs e)
        {
            var entity = new AppointmentEntity();
            var repo   = new AppointmentRepo();

            //var app = new Appoinment();
            //entity.ConvertToEntity(this);
            entity.GeneratedId      = this.txtId.Text;
            entity.PatientName      = this.lblName.Text;
            entity.PatientAge       = Int32.Parse(this.lblAge.Text);
            entity.PatientSex       = this.lblSex.Text;
            entity.PatientReference = this.lblRefer.Text;
            entity.AppoinmentDate   = this.mdtAppoinmentDate.Value.Date.ToString("yyyy-MM-dd");
            entity.PatientDoctor    = mgvDoctorAppointment.CurrentRow.Cells["name"].Value.ToString();
            entity.Time             = this.dtpTime.Value.ToString();
            if (MessageBox.Show("Are you sure?", "Confirmation", MessageBoxButtons.YesNo) == DialogResult.No)
            {
                return;
            }
            else
            {
                repo.InsertAppoinment(entity);
                this.Hide();
                re.Show();
                re.Clear();
            }
        }
Пример #2
0
        private void btnCreate_Click(object sender, EventArgs e)
        {
            ReceptionistDash dash = new ReceptionistDash(userName);

            this.Hide();
            dash.Show();
        }
Пример #3
0
        private void mbtnLogin_Click(object sender, EventArgs e)
        {
            if (this.txtUserName.Text != "" && this.txtPassword.Text != "")
            {
                var user = new UserLoginEntity();
                user.UserName = this.txtUserName.Text.Trim();
                user.UserPass = this.txtPassword.Text.Trim();

                var userRep = new UserLoginRepo();
                if (user.UserName.Substring(0, 1) == "A" || user.UserName.Substring(0, 1) == "a")
                {
                    if (userRep.UserLoginAdmin(user))
                    {
                        MessageBox.Show("Welcome Admin");
                        this.Visible = false;
                        var admin = new AdminDash(txtUserName.Text.Trim());
                        admin.Visible = true;
                    }
                    else
                    {
                        MessageBox.Show("Invalid Id or Password");
                    }
                }
                else if (user.UserName.Substring(0, 1) == "R" || user.UserName.Substring(0, 1) == "r")
                {
                    if (userRep.UserLoginReciptionist(user))
                    {
                        //MessageBox.Show("Hey There");
                        var reciption = new ReceptionistDash(txtUserName.Text.Trim());
                        //this.Visible = false;
                        this.Hide();
                        reciption.Show();
                        //reciption.Visible = true;
                    }
                    else
                    {
                        MessageBox.Show("Invalid Id or Password");
                    }
                }
                else if (user.UserName.Substring(0, 1) == "D" || user.UserName.Substring(0, 1) == "d")
                {
                    if (userRep.UserLoginDoctor(user))
                    {
                        MessageBox.Show("Welcome Doctor");
                        var doctor = new DoctorDash(txtUserName.Text.Trim());
                        this.Visible   = false;
                        doctor.Visible = true;
                    }
                    else
                    {
                        MessageBox.Show("Invalid Id or Password");
                    }
                }
            }
        }
Пример #4
0
 private void mbtnBack_Click(object sender, EventArgs e)
 {
     this.Hide();
     re.Show();
     re.Clear();
 }