using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace fromdatagridveiw
{
    public partial class kala : Form
    {
        public kala()
        {
            InitializeComponent();
        }

        //SqlConnection con = new SqlConnection("Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\shoping.mdf;Integrated Security=True");
        //SqlCommand cmd = new SqlCommand();
        //DataSet ds = new DataSet();
        

        private void kala_Load(object sender, EventArgs e)
        {
            DataTable dt1 = new DataTable();
            DataBase db1 = new DataBase();
            dt1 = db1.MySelect("select * from kala");
            dgvkala.DataSource = dt1;
       

        }

        private void dgvkala_MouseDoubleClick(object sender, MouseEventArgs e)
        {

            //factor fac = new factor();
            //fac.lblname.Text = dgvkala.CurrentRow.Cells["namekala"].Value.ToString();
            //fac.lblprice.Text = dgvkala.CurrentRow.Cells["pricekala"].Value.ToString();
            //this.Close();




            
           // //s = dgvkala.CurrentRow.Cells[0].Value.ToString();
           //new factor().dgvfactor.DataSource = 
           
           //dgvkala.CurrentRow.Cells[0].Value = new factor().dgvfactor.CurrentRow.Cells[0].Value.ToString();
           //dgvkala.CurrentRow.Cells[1].Value = new factor().dgvfactor.CurrentRow.Cells[1].Value.ToString();
           //dgvkala.CurrentRow.Cells[2].Value = new factor().dgvfactor.CurrentRow.Cells[3].Value.ToString();

            
        }

        private void dgvkala_MouseClick(object sender, MouseEventArgs e)
        {
            

            
        }

        private void dgvkala_DoubleClick(object sender, EventArgs e)
        {
            factor ffactor = (factor)Application.OpenForms["factor"];
            ffactor.GetKalaInfo(dgvkala.CurrentRow.Cells[1].Value.ToString(), dgvkala.CurrentRow.Cells[2].Value.ToString());
            this.Close();
        }

    }
}
