private void dataGrid_CellContentClick_1(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex >= 0)
            {
                DataGridViewRow row = this.dataGrid.Rows[e.RowIndex];

                empId        = row.Cells["EmployeeNic"].Value.ToString();
                name.Text    = row.Cells["Name"].Value.ToString();
                phone.Text   = row.Cells["Phone"].Value.ToString();
                email.Text   = row.Cells["Email"].Value.ToString();
                nic.Text     = row.Cells["EmployeeNic"].Value.ToString();
                empType.Text = row.Cells["EmployeeType"].Value.ToString();
                dob.Value    = DateTime.Parse(row.Cells["Dob"].Value.ToString());

                DBconnection connection = new DBconnection();
                //connection.getImage(empId);

                try
                {
                    SqlCommand   command1 = new SqlCommand("select Photo from [dbo].[Employee] where EmployeeNic=@param", connection.getConnection());
                    SqlParameter myparam  = command1.Parameters.Add("@param", SqlDbType.NVarChar, 30);
                    myparam.Value = empId;
                    byte[]       img = (byte[])command1.ExecuteScalar();
                    MemoryStream str = new MemoryStream();
                    str.Write(img, 0, img.Length);
                    Bitmap bit = new Bitmap(str);
                    connection.getConnection().Close();
                }
                catch (Exception ex)
                {
                    Console.WriteLine("photo error: " + ex);
                }
            }
        }
        public void displayEmployees()
        {
            DBconnection connection5 = new DBconnection();

            DataTable      dt = new DataTable();
            SqlDataAdapter da = new SqlDataAdapter(connection5.displayRegistredEmployees());

            da.Fill(dt);
            dataGrid.DataSource = dt;
            connection5.getConnection().Close();
        }
        private void availableEquipmentsAndChemicals()
        {
            DBconnection connection5 = new DBconnection();

            DataTable      dt = new DataTable();
            SqlDataAdapter da = new SqlDataAdapter(connection5.displayAvailableChemicalsAndEquipments());

            da.Fill(dt);
            dataGrid.DataSource = dt;
            connection5.getConnection().Close();
        }
Ejemplo n.º 4
0
        private void displayPriceList()
        {
            DBconnection connection5 = new DBconnection();

            DataTable      dt = new DataTable();
            SqlDataAdapter da = new SqlDataAdapter(connection5.diplayPriceList());

            da.Fill(dt);
            dataGrid.DataSource = dt;
            connection5.getConnection().Close();
        }
        private void displayAvailableReports()
        {
            try
            {
                DBconnection connection5 = new DBconnection();

                DataTable      dt = new DataTable();
                SqlDataAdapter da = new SqlDataAdapter(connection5.displayMLTAvailableReports());
                da.Fill(dt);
                dataGrid.DataSource = dt;
                connection5.getConnection().Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error in display Reports:\n" + ex, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 6
0
        private void displayAvailableReports()
        {
            try
            {
                DBconnection connection5 = new DBconnection();

                DataTable      dt = new DataTable();
                SqlDataAdapter da = new SqlDataAdapter(connection5.displayAvailableReports());
                da.Fill(dt);
                dataGrid.DataSource = dt;
                connection5.getConnection().Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error in Displaying Reports:\n" + ex, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                Console.WriteLine("Error: \n" + ex);
            }
        }
Ejemplo n.º 7
0
        public void PatientReports()
        {
            //string timestamp = DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss.fff",CultureInfo.InvariantCulture)+ primaryKey.RandomString(5);
            //MessageBox.Show("time: " + timestamp);
            try
            {
                DBconnection connection5 = new DBconnection();

                DataTable      dt = new DataTable();
                SqlDataAdapter da = new SqlDataAdapter(connection5.displayAllPatientsReports());
                da.Fill(dt);
                dataGrid.DataSource = dt;
                connection5.getConnection().Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error in Displaying: \n" + ex, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Console.WriteLine("Error:\n" + ex);
            }
        }
Ejemplo n.º 8
0
        private void guna2Button1_Click(object sender, EventArgs e)
        {
            string date1 = dateOne.ToString();
            string date2 = dateTwo.ToString();

            try
            {
                DBconnection connection5 = new DBconnection();

                DataTable      dt = new DataTable();
                SqlDataAdapter da = new SqlDataAdapter(connection5.displayReportBetweentwodays(date1, date2));
                da.Fill(dt);
                dataGrid.DataSource = dt;
                connection5.getConnection().Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error in Displaying Reports:\n" + ex, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                Console.WriteLine("Error: \n" + ex);
            }
        }