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("يرجى ادخال اسم المورد"); } }
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("يرجى إدخال رقم فقط لمصاريف الاستضافة"); } }
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 } } }
private void Form1_Load(object sender, EventArgs e) { ConnectionClass.Connection(@"Data Source=.;Initial Catalog=hospital;Integrated Security=True"); hospitalEntities Hospital = new hospitalEntities(); }
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("برجاء ادخال اسم المريض ورقم تليفونه وعنوانه"); } }