Beispiel #1
0
        private void dgvZimmetListesi_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            var DemirbasKodu = dgvZimmetListesi.SelectedRows[0].Cells[3].Value;
            var Baslangıc    = dgvZimmetListesi.SelectedRows[0].Cells[4].Value;

            con.Open();
            SqlCommand cmd = new SqlCommand("select SicilNo,BaşlangıcTarihi,BitisTarihi from DemirbasZimmetleme where DemirbasKodu =@p1 and BaşlangıcTarihi = @p2", con);

            cmd.Parameters.AddWithValue("@p1", DemirbasKodu);
            cmd.Parameters.AddWithValue("@p2", Baslangıc);
            SqlDataReader dr     = cmd.ExecuteReader();
            Zimmet        zimmet = new Zimmet();

            dr.Read();

            DateTime bitis = DateTime.Now;

            if (dr[2] is DateTime)
            {
                bitis = (DateTime)dr[2];
            }
            zimmet = new Zimmet()
            {
                SicilNo         = (int)dr[0],
                BaslangicTarihi = (DateTime)dr[1],
                BitisTarihi     = bitis,
                DemirbasKodu    = DemirbasKodu.ToString()
            };
            con.Close();
            dr.Close();
            var frm = new ZimmetDüzenleSil(zimmet);

            frm.ShowDialog();
            ZimmetDataGridView();
        }
Beispiel #2
0
 public ZimmetDüzenleSil(Zimmet zimmet)
 {
     InitializeComponent();
     secilenZimmet            = zimmet;
     txtSicilNo.Text          = zimmet.SicilNo.ToString();
     dtpBaslangic.Value       = Convert.ToDateTime(zimmet.BaslangicTarihi);
     dtpBitis.Value           = Convert.ToDateTime(zimmet.BitisTarihi);
     mtxtSicilNo.Text         = zimmet.SicilNo.ToString();
     dtpBaslangıcTarihi.Value = Convert.ToDateTime(zimmet.BaslangicTarihi);
     dtpBitisTarihi.Value     = Convert.ToDateTime(zimmet.BitisTarihi);
     dtpBaslangic.Enabled     = false;
     dtpBitis.Enabled         = false;
 }