Ejemplo n.º 1
0
        private void button8_Click(object sender, EventArgs e)
        {
            try
            {
                if (/*dataGrid1.VisibleRowCount > 0 && */ dataGrid2.CurrentRowIndex >= 0 /*&& !dataGrid1.IsSelected(dataGrid1.CurrentRowIndex)*/)
                {
                    int       row    = dataGrid2.CurrentRowIndex;
                    DataTable source = (DataTable)dataGrid2.DataSource;
                    SecilenPersonel       = new SPersonel();
                    SecilenPersonel.KOD   = source.Rows[row]["KOD"].ToString();
                    SecilenPersonel.AD    = source.Rows[row]["AD"].ToString();
                    SecilenPersonel.SOYAD = source.Rows[row]["SOYAD"].ToString();

                    if (!string.IsNullOrEmpty(SecilenPersonel.KOD))
                    {
                        label1Personel.Text   = string.Format("[{0}] {1} {2}", SecilenPersonel.KOD, SecilenPersonel.AD, SecilenPersonel.SOYAD);
                        labelPersonel.Text    = SecilenPersonel.KOD;
                        panelPersAta.Location = new Point(0, 0);
                        panelPersAta.Visible  = true;
                        panelPersAta.BringToFront();
                    }
                    else
                    {
                        labelIstasyonKod.Text = "";
                        labelIstasyonAd.Text  = "";
                        SecilenIstasyon.Dispose();
                        return;
                    }
                }
            }
            catch (Exception exc)
            {
                Utility.Hata("Genel Hata:" + exc.Message, "HATA!");
            }
        }
Ejemplo n.º 2
0
        private void button10_Click(object sender, EventArgs e)
        {
            try
            {
                if (labelPersonel.Text == "" || labelPersonel.Text.Equals("____________________"))
                {
                    Utility.Hata("Personel seçilmedi!");
                    return;
                }

                if (SecilenIstasyon == false)
                {
                    Utility.Hata("İstasyon seçin!");
                    return;
                }

                DataTable dtx = new DataTable();
                if (Utility.Engine.dat.TableDoldur(string.Format("EXEC dbo.PersAta N'{0}', N'{1}'",
                                                                 SecilenPersonel.KOD, SecilenIstasyon.IstasyonKodu), ref dtx) && dtx != null && dtx.Rows.Count > 0)
                {
                    if (Convert.ToInt32(dtx.Rows[0][0]) < 1)
                    {
                        Utility.Hata("Sunucu hata bildirdi:" + dtx.Rows[0][1].ToString());
                    }
                }
                else
                {
                    Utility.Hata("Sunucu yanıt vermedi!" + Utility.Engine.dat.Fault);
                }

                labelPersonel.Text   = "";
                label1Personel.Text  = "";
                SecilenPersonel      = new SPersonel();
                panelPersAta.Visible = false;
                Personeller();
            }
            catch (Exception exc)
            {
                Utility.Hata("İş emri ataması sırasında hata:" + exc.Message);
            }
        }