Example #1
0
        private void SetSDForUpdate(Surgical sDetail)
        {
            textBoxPatientID.Text = sDetail.PatientID.ToString();
            textBoxSurgicalID.Text = sDetail.SurgicalID.ToString();
            dateCreate.Value = sDetail.Date;
            textBoxDescription.Text = sDetail.Description;
            comboBoxState.SelectedIndex = sDetail.State;

            DataTable dtStaff = Staff.GetListStaff();
            for (int i = 0; i < dtStaff.Rows.Count; i++)
            {
                String staffName = dtStaff.Rows[i][6].ToString() + " " + dtStaff.Rows[i][5].ToString();
                Staff newStaff = Staff.GetStaff(Convert.ToInt32(dtStaff.Rows[i][0]));
                listStaff.Add(newStaff);
                listBoxSystemStaff.Items.Add(staffName);
            }
            listBoxSystemStaff.SelectedIndex = 0;

            DataTable dtSD = SurgicalDetail.GetListSurgicalDetail(sDetail.SurgicalID);
            for (int i = 0; i < dtSD.Rows.Count; i++)
            {
                String staffName = dtSD.Rows[i][2].ToString() + " " + dtSD.Rows[i][3].ToString();
                SurgicalDetail newSD = new SurgicalDetail();
                newSD.SurgicalID = Convert.ToInt32(dtSD.Rows[i][0]);
                newSD.StaffID = Convert.ToInt32(dtSD.Rows[i][1]);
                listSD.Add(newSD);
                listBoxCurrentStaff.Items.Add(staffName);
            }
            if (listBoxCurrentStaff.Items.Count > 0)
                listBoxCurrentStaff.SelectedIndex = 0;
        }
Example #2
0
 public static int InsertSurgicalDetail(SurgicalDetail newSD)
 {
     String sqlInsert = @"INSERT INTO SURGICALDETAIL (SURGICALID, STAFFID)
                         VALUES        (@SURGICALID,@STAFFID)";
     SqlParameter[] sqlParameters = { new SqlParameter("@SURGICALID", newSD.SurgicalID),
                                     new SqlParameter("@STAFFID", newSD.StaffID)};
     return SqlResult.ExecuteNonQuery(sqlInsert, sqlParameters);
 }
Example #3
0
        public static int InsertSurgicalDetail(SurgicalDetail newSD)
        {
            String sqlInsert = @"INSERT INTO SURGICALDETAIL (SURGICALID, STAFFID)
                                VALUES        (@SURGICALID,@STAFFID)";

            SqlParameter[] sqlParameters = { new SqlParameter("@SURGICALID", newSD.SurgicalID),
                                             new SqlParameter("@STAFFID",    newSD.StaffID) };
            return(SqlResult.ExecuteNonQuery(sqlInsert, sqlParameters));
        }
Example #4
0
 private void buttonInsertFunction_Click(object sender, EventArgs e)
 {
     int selectedStaff = listBoxSystemStaff.SelectedIndex;
     if (CheckStaffInSurgical(listStaff[selectedStaff].StaffID))
     {
         MessageBox.Show("Nhân viên đã có trong danh sách tham gia ca phẩu thuật", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
     else
     {
         SurgicalDetail newSD = new SurgicalDetail(0, listStaff[selectedStaff].StaffID);
         listSD.Add(newSD);
         listBoxCurrentStaff.Items.Add(listBoxSystemStaff.Items[selectedStaff].ToString());
         listBoxCurrentStaff.SelectedIndex = 0;
     }
 }