Beispiel #1
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            var en = new ManageDoctorEntity();
            var re = new ManageDoctorRepo();

            en.Id    = txtId.Text;
            en.Name  = txtName.Text;
            en.Phone = txtPhone.Text;
            re.Search(en, mgvDoctor);
        }
        public void Update(ManageDoctorEntity en)
        {
            var sql = "update doctor set name = '" + en.Name + "', age = '" + en.Age + "', sex = '" + en.Sex + "',reference = '" + en.Reference + "',address = '" + en.Address + "',phone = '" + en.Phone + "',speciality = '" + en.Speciality + "',available= '" + en.Available + "',time = '" + en.Time + "' where id = '" + en.Id + "'; ";
            var ex  = DataAccess.ExecuteQuery(sql);

            if (ex == 1)
            {
                MessageBox.Show("Updated");
            }
        }
Beispiel #3
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            var en = new ManageDoctorEntity();
            var re = new ManageDoctorRepo();

            en.Id         = txtDid.Text;
            en.Name       = txtDname.Text;
            en.Age        = txtDage.Text;
            en.Sex        = txtDsex.Text;
            en.Reference  = txtDreference.Text;
            en.Speciality = txtDspeciality.Text;
            en.Available  = txtDavailable.Text;
            en.Address    = txtDaddress.Text;
            en.Phone      = txtDphone.Text;
            en.Time       = dtpTime.Value.ToString("hh:mm tt");

            re.Update(en);
        }
        public void Search(ManageDoctorEntity en, MetroGrid mgv)
        {
            var sql = "select id,name,age,sex,reference,speciality,available,time,address,phone from doctor where id = '" + en.Id + "' or name = '" + en.Name + "' or phone = '" + en.Phone + "'; ";

            DataAccess.PopulateGridView(mgv, sql);
        }