Ejemplo n.º 1
0
        //For حجز عياده خارجيه
        private void حجزالعياداتالخارجيةToolStripMenuItem_Click(object sender, EventArgs e)
        {
            حجز_العياده f = new حجز_العياده();

            f.MdiParent = this;
            f.Show();
        }
Ejemplo n.º 2
0
        //For add patient to clinic
        private void button2_Click(object sender, EventArgs e)
        {
            //create procedure clinic_محرك_البحث_للحجز_treat_patient_insert(@fn varchar(50),@c varchar(30))
            //as
            //begin
            //declare @pid int
            //set @pid=(select patient_id from Registeration_patientRegisteration where patient_name like N'%'+@fn+'%')
            //insert into Treat_Patient(pid,c_code) values(@pid,@c)
            //end


            con1.OpenConection();
            types      = new SqlDbType[] { SqlDbType.VarChar, SqlDbType.VarChar };
            name_input = new string[] { "@fn", "@c" };
            values     = new string[] { f_name, clinic_name.ToString() };
            con1.ExecuteNonQueryProcedure("clinic_محرك_البحث_للحجز_treat_patient_insert", name_input, values, types);
            con1.CloseConnection();



            //create procedure clinic_محرك_البحث_للحجز_patient_select(@fn varchar(50))
            //as
            //begin
            //select patient_name, catogrical_code from Registeration_patientRegisteration where patient_name like N'%'+@fn+'%'
            //end
            con1.OpenConection();
            types      = new SqlDbType[] { SqlDbType.VarChar };
            name_input = new string[] { "@fn" };
            values     = new string[] { f_name };
            SqlDataReader dr = con1.ShowDataInGridViewUsingStoredProcDR("clinic_محرك_البحث_للحجز_patient_select", name_input, values, types);

            dr.Read();
            MessageBox.Show("لفد تم الادخال بنجاح");
            حجز_العياده f = new حجز_العياده();


            f.Focus();
            this.DialogResult = DialogResult.OK;

            f.Focus();
            dr.Close();
            con1.CloseConnection();
        }
Ejemplo n.º 3
0
        private void button3_Click(object sender, EventArgs e)
        {
            //    create procedure clinic_محرك_البحث_للحجز_patient_visit_insert(@pid int,@ordere int,@type nvarchar(50),@type2 nvarchar(50),@date nvarchar(100))
            //as
            //begin
            //declare @i int
            //set @i=(select count(visit_id)+1  from entranceoffice_visit where pat_id=@pid)
            //insert into entranceoffice_visit(visit_id,pat_id,ordere,type_of_visit,type_status,entrance_date) values(@i,@pid,@ordere,@type,  @type2 , @date)
            //end



            //create procedure clinic_محرك_البحث_للحجز_treat_patient_insert(@pid int,@c nvarchar(30))
            //as
            //begin
            //insert into Treat_Patient(pid,c_code) values(@pid,@c)
            //end


            //    create procedure clinic_محرك_البحث_للحجز_patient_visit_insert(@pid int,@ordere int,@type nvarchar(50),@type2 nvarchar(50),@date nvarchar(100))
            //as
            //begin
            //declare @i int
            //set @i=(select count(visit_id)+1  from entranceoffice_visit where pat_id=@pid)
            //insert into entranceoffice_visit(visit_id,pat_id,ordere,type_of_visit,Finish_Type,entrance_date) values(@i,@pid,@ordere,@type,  @type2 , @date)
            //endd



            int      order = 1000;
            string   type = "خارجي", type2 = "open";
            DateTime dt   = DateTime.Now;
            String   date = dt.ToString("yyyy-MM-dd hh:mm:ss");

            con1.OpenConection();
            types      = new SqlDbType[] { SqlDbType.Int, SqlDbType.Int, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar };
            name_input = new string[] { "@pid", "@ordere", "@type", "@type2", "@date" };
            values     = new string[] { x1, order.ToString(), type, type2, date };
            con1.ExecuteNonQueryProcedure("clinic_محرك_البحث_للحجز_patient_visit_insert", name_input, values, types);
            con1.CloseConnection();

            con1.OpenConection();
            types      = new SqlDbType[] { SqlDbType.Int, SqlDbType.VarChar };
            name_input = new string[] { "@pid", "@c" };
            values     = new string[] { x1, code.ToString() };
            con1.ExecuteNonQueryProcedure("clinic_محرك_البحث_للحجز_treat_patient_insert1", name_input, values, types);
            con1.CloseConnection();
            //create procedure clinic_محرك_البحث_للحجز_patient_select1(@pid int)
            //as
            //begin
            //select patient_name, catogrical_code from Registeration_patientRegisteration where patient_id=@pid
            //end

            con1.OpenConection();
            types      = new SqlDbType[] { SqlDbType.Int };
            name_input = new string[] { "@pid" };
            values     = new string[] { x1 };
            SqlDataReader dr = con1.ShowDataInGridViewUsingStoredProcDR("clinic_محرك_البحث_للحجز_patient_select1", name_input, values, types);

            dr.Read();
            MessageBox.Show("لفد تم الادخال بنجاح");
            حجز_العياده f = new حجز_العياده();

            name1 = dr[0].ToString() + " " + dr[1].ToString();
            //name2 = dr[2].ToString();
            f.Focus();
            this.DialogResult = DialogResult.OK;

            f.Focus();
            con1.CloseConnection();

            //insert_into_patient_visit();
            //cmd = new SqlCommand("insert into pat_clinic(patient_id,code_clinic) values(" + int.Parse(x1) + "," + code + ");", con);
            //try
            //{

            //    MessageBox.Show("لفد تم الادخال بنجاح");
            //    cmd = new SqlCommand("select fname,sname,institution from patient where patient_id=" + int.Parse(x1) + "", con);
            //     dr = cmd.ExecuteReader();
            //    dr.Read();

            //    حجز_العياده f = new حجز_العياده();

            //   name1 = dr[0].ToString() +" "+ dr[1].ToString();
            //    name2 = dr[2].ToString();
            //    f.Focus();
            //    this.DialogResult = DialogResult.OK;

            //    f.Focus();
        }