Пример #1
0
 private void But_AddSpecialization_Click(object sender, EventArgs e)
 {
     ConnectionClass.Parameters(new SqlParameter("@SpecificationName", Txt_AddSpecialization.Text));
     ConnectionClass.SQLCommand("Cproc_AddSpecialization", CommandType.StoredProcedure, ExecuteReaderOrNonQuery.executeNonQuery);
     MessageBox.Show("تم إضافة تخصص طبي");
     Txt_AddSpecialization.Clear();
 }
Пример #2
0
 private void But_AddDocDegree_Click(object sender, EventArgs e)
 {
     ConnectionClass.Parameters(new SqlParameter("@ScientificDegreeName", Txt_AddDocDegree.Text));
     ConnectionClass.SQLCommand("Cproc_DocDegrees", CommandType.StoredProcedure, ExecuteReaderOrNonQuery.executeNonQuery);
     MessageBox.Show("تم اضافة تخصص طبي بنجاح");
     Txt_AddDocDegree.Clear();
 }
Пример #3
0
        private void But_AddDrugUnits_Click(object sender, EventArgs e)
        {
            ConnectionClass.Parameters(new SqlParameter("@DtugUnitName", Txt_AddDrugUnits.Text));
            ConnectionClass.SQLCommand("Cproc_AddDrugUnits", CommandType.StoredProcedure, ExecuteReaderOrNonQuery.executeNonQuery);

            MessageBox.Show("تم إضافة وحدة الدواء بنجاح");
            Txt_AddDrugUnits.Clear();
        }
Пример #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            //Hospital.cproc_AddRooms (Com_AddRoom.ValueMember, Txt_FloorNo.Text, Txt_RoomNo.Text);

            ConnectionClass.Parameters(new SqlParameter("@RoomDegree", Com_AddRoom.SelectedValue), new SqlParameter("@Roomfloor", Txt_FloorNo.Text), new SqlParameter("@RoomNo", Txt_RoomNo.Text));
            ConnectionClass.SQLCommand("cproc_AddRooms", CommandType.StoredProcedure, ExecuteReaderOrNonQuery.executeNonQuery);
            Txt_FloorNo.Clear();
            Txt_RoomNo.Clear();
            MessageBox.Show("أضيفت غرفة بنجاح");
        }
Пример #5
0
        private void button1_Click(object sender, EventArgs e)
        {
            decimal value = 0;

            decimal.TryParse(Txt_pricePerUnit.Text, out value);
            ConnectionClass.Parameters(new SqlParameter("@DrugName", txt_Drugname.Text), new SqlParameter("@DrugUnit", Com_DrugUnit.SelectedValue), new SqlParameter("@PricePerUnit", value));
            ConnectionClass.SQLCommand("Cproc_AddDrug", CommandType.StoredProcedure, ExecuteReaderOrNonQuery.executeNonQuery);
            MessageBox.Show("تم إضافة الدواء بنجاح");
            txt_Drugname.Clear();
            Txt_pricePerUnit.Clear();
        }
Пример #6
0
        private void But_EditPatient_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(Txt_PatientName.Text) && !string.IsNullOrEmpty(Txt_Mobile.Text) && !string.IsNullOrEmpty(Txt_Address.Text))
            {
                if (radioButton1.Checked == false && radioButton2.Checked == false)
                {
                    MessageBox.Show("برجاء تحديد نوع الجنس");
                }
                else
                {
                    if (!string.IsNullOrEmpty(Txt_SoSeNo.Text))
                    {
                        if (Txt_SoSeNo.Text.Length != 14)
                        {
                            MessageBox.Show("برجاء كتابة رقم البطاقة بشكل صحيح مكونة من 14 رقم");
                        }
                        else
                        {
                            try
                            {
                                ConnectionClass.Parameters(new SqlParameter("@patientID", EditedPatient), new SqlParameter("@patientname", Txt_PatientName.Text), new SqlParameter("@gender", radioButton1.Checked), new SqlParameter("@DoB", Convert.ToDateTime(Pik_DOB.Text)), new SqlParameter("@SoSeNo", Txt_SoSeNo.Text), new SqlParameter("@BloodGroup", Convert.ToInt32(Com_BloodGroups.SelectedValue)), new SqlParameter("@phoneNumber", Txt_Mobile.Text), new SqlParameter("@address", Txt_Address.Text));
                                ConnectionClass.SQLCommand("Cproc_UpdatePatientData", CommandType.StoredProcedure, ExecuteReaderOrNonQuery.executeNonQuery);
                                MessageBox.Show("تم تحديث البيانات بنجاح");
                                this.Close();
                            }
                            catch (SqlException SQLEx)
                            {
                                if (SQLEx.Number == 2627)
                                {
                                    MessageBox.Show("هذا المريض مسجل من قبل");
                                    ConnectionClass.MyCommand.Parameters.Clear();
                                    ConnectionClass.ParameterList.Clear();
                                    ConnectionClass.MyCOnnection.Close();
                                    this.Close();
                                    this.Dispose();
                                }
                            }
                        }
                    }

                    else
                    {
                        MessageBox.Show("يرجى إدخال الرقم القومي");
                    }
                }
            }
            else
            {
                MessageBox.Show("برجاء ادخال اسم المريض ورقم تليفونه وعنوانه");
            }
        }
Пример #7
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(Txt_AddAddress.Text))
     {
         ConnectionClass.Parameters(new SqlParameter("@supplierId", GetId.Value), new SqlParameter("@supplierAddress", Txt_AddAddress.Text));
         ConnectionClass.SQLCommand("Cproc_AddSupplierAddress", CommandType.StoredProcedure, ExecuteReaderOrNonQuery.executeNonQuery);
         Txt_AddAddress.Clear();
         MessageBox.Show("تم إضافة عنوان فرع بنجاح");
         groupBox1.Visible = true;
     }
     else
     {
         MessageBox.Show("يرجى ادخال عنوان المورد");
     }
 }
Пример #8
0
 private void But_AddSuppliers_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(Txt_AddSuppliers.Text))
     {
         GetId.Direction = ParameterDirection.ReturnValue;
         ConnectionClass.Parameters(new SqlParameter("@supplierName", Txt_AddSuppliers.Text), GetId);
         ConnectionClass.SQLCommand("Cproc_AddSuppliers", CommandType.StoredProcedure, ExecuteReaderOrNonQuery.executeNonQuery);
         Txt_AddSuppliers.Enabled = false;
         But_AddSuppliers.Visible = false;
         Lbl_Address.Visible      = true;
         groupBox2.Visible        = true;
     }
     else
     {
         MessageBox.Show("يرجى ادخال اسم المورد");
     }
 }
Пример #9
0
        private void But_AddRoomDegree_Click(object sender, EventArgs e)
        {
            decimal value = 0;

            if (decimal.TryParse(Txt_AddFeesPerDay.Text, out value))
            {
                ConnectionClass.Parameters(new SqlParameter("@Name", Txt_AddNameDegree.Text), new SqlParameter("@FeesDay", value), new SqlParameter("@Discription", Txt_AddDiscription.Text));
                ConnectionClass.SQLCommand("Cproc_AddRoomsDegree", CommandType.StoredProcedure, ExecuteReaderOrNonQuery.executeNonQuery);
                Txt_AddDiscription.Clear();
                Txt_AddFeesPerDay.Clear();
                Txt_AddNameDegree.Clear();
                MessageBox.Show("تم إضافة درجة الغرفة بنجاح");
            }
            else
            {
                MessageBox.Show("يرجى إدخال رقم فقط لمصاريف الاستضافة");
            }
        }
Пример #10
0
 private void But_AddFellow_Click(object sender, EventArgs e)
 {
     if (patientId != 0)
     {
         ConnectionClass.Parameters(new SqlParameter("@Fellowname", Txt_FellowName.Text), new SqlParameter("@SoSeNo", Txt_FellowSoSeNo.Text), new SqlParameter("@phoneNumber", Txt_FellowPhone.Text), new SqlParameter("@patientId", patientId));
         ConnectionClass.SQLCommand("Cproc_AddFellow", CommandType.StoredProcedure, ExecuteReaderOrNonQuery.executeNonQuery);
         var Result = MessageBox.Show("أضيف مرافق بنجاح", "إضافة مرافق", MessageBoxButtons.YesNo);
         if (Result == System.Windows.Forms.DialogResult.No)
         {
             this.Close();
             this.Dispose();
         }
         else
         {
             this.Close();
             this.Dispose();
             // add reservation
         }
     }
 }
Пример #11
0
        private void But_AddPatient_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(Txt_PatientName.Text) && !string.IsNullOrEmpty(Txt_Mobile.Text) && !string.IsNullOrEmpty(Txt_Address.Text))
            {
                if (radioButton1.Checked == false && radioButton2.Checked == false)
                {
                    MessageBox.Show("برجاء تحديد نوع الجنس");
                }
                else
                {
                    if (!string.IsNullOrEmpty(Txt_SoSeNo.Text))
                    {
                        if (Txt_SoSeNo.Text.Length != 14)
                        {
                            MessageBox.Show("برجاء كتابة رقم البطاقة بشكل صحيح مكونة من 14 رقم");
                        }
                        else
                        {
                            try
                            { PatientId.Direction = ParameterDirection.ReturnValue;

                              ConnectionClass.Parameters(new SqlParameter("@patientName", Txt_PatientName.Text), new SqlParameter("@Gender", radioButton1.Checked), new SqlParameter("@DoB", Convert.ToDateTime(Pik_DOB.Text)), new SqlParameter("@SoSeNo", Txt_SoSeNo.Text), new SqlParameter("@BloodGroup", Convert.ToInt32(Com_BloodGroups.SelectedValue)), new SqlParameter("@phoneNumber", Txt_Mobile.Text), new SqlParameter("@address", Txt_Address.Text), PatientId);
                              ConnectionClass.SQLCommand("Cproc_AddNewPatient", CommandType.StoredProcedure, ExecuteReaderOrNonQuery.executeNonQuery);
                              x = (int)PatientId.Value;
                              var result = MessageBox.Show("هل تريد إضافة مرافق أو حجز", "تم التسجيل بنجاح", MessageBoxButtons.YesNo);
                              if (result == System.Windows.Forms.DialogResult.No)
                              {
                                  ConnectionClass.ParameterList.Clear();
                                  this.Close();
                                  this.Hide();
                                  this.Dispose();
                              }
                              else
                              {
                                  ConnectionClass.ParameterList.Clear();
                                  HelpClass.EnabledOrDisabled(false, Txt_Address, Txt_Mobile, Txt_PatientName, Txt_SoSeNo, Pik_DOB, Com_BloodGroups, radioButton1, radioButton2);

                                  But_AddPatient.Location     = new System.Drawing.Point(411, 396);
                                  But_AddPatient.Enabled      = false;
                                  But_AddFellow.Location      = new System.Drawing.Point(238, 396);
                                  But_AddFellow.Visible       = true;
                                  But_AddReservation.Location = new System.Drawing.Point(58, 396);
                                  But_AddReservation.Visible  = true;
                              } }
                            catch (SqlException SQLEx)
                            {
                                if (SQLEx.Number == 2627)
                                {
                                    MessageBox.Show("هذا المريض مسجل من قبل");
                                    ConnectionClass.MyCommand.Parameters.Clear();
                                    ConnectionClass.ParameterList.Clear();
                                    ConnectionClass.MyCOnnection.Close();
                                    this.Close();
                                    this.Dispose();
                                }
                            }
                        }
                    }


                    else
                    {
                        MessageBox.Show("يرجى إدخال الرقم القومي");
                    }
                }
            }
            else
            {
                MessageBox.Show("برجاء ادخال اسم المريض ورقم تليفونه وعنوانه");
            }
        }