public static void Ekle(EIsPersonel Eklemeli) { OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Veritabani\\Data.mdb;Jet OLEDB:Database Password=ayakkabi_gelisimsoft;"); if (con.State == ConnectionState.Closed) { con.Open(); } OleDbCommand VayComHaci = new OleDbCommand("insert into IsPersonel(TakipID,personelID,Ucret) values (@TID,@PID,@Ucret)", con); VayComHaci.Parameters.AddWithValue("@TID", Eklemeli.TakipID); VayComHaci.Parameters.AddWithValue("@PID", Eklemeli.personelID); VayComHaci.Parameters.AddWithValue("@Ucret", Eklemeli.Ucret); OleDbCommand VayComPersonel = new OleDbCommand("update personeller set bakiye=bakiye+@Ucret WHERE ((personeller.personelID)=@PID)", con); VayComPersonel.Parameters.AddWithValue("@Ucret", Eklemeli.Ucret); VayComPersonel.Parameters.AddWithValue("@PID", Eklemeli.personelID); try { if (VayComHaci.ExecuteNonQuery() > 0) { VayComPersonel.ExecuteNonQuery(); } } catch (Exception Ex) { MessageBox.Show(Ex.ToString(), "Hata", MessageBoxButtons.OK, MessageBoxIcon.Warning); } finally { con.Close(); } }
public static double GTP(EIsPersonel EeO) { OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Veritabani\\Data.mdb;Jet OLEDB:Database Password=ayakkabi_gelisimsoft;"); if (con.State == ConnectionState.Closed) { con.Open(); } OleDbCommand com = new OleDbCommand("select SUM(Ucret) as [Ucret] from IsPersonel WHERE ((IsPersonel.personelID)=@ID)", con); com.Parameters.AddWithValue("@ID", EeO.personelID); OleDbDataReader dr = com.ExecuteReader(); while (dr.Read()) { if (!dr.IsDBNull(0)) { gidenGTP = Convert.ToDouble(dr["Ucret"].ToString()); } else { gidenGTP = 0; } } con.Close(); return(gidenGTP); }
public static void Sil(EIsPersonel EES) { OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Veritabani\\Data.mdb;Jet OLEDB:Database Password=ayakkabi_gelisimsoft;"); if (con.State == ConnectionState.Closed) { con.Open(); } OleDbCommand com = new OleDbCommand("delete from IsPersonel WHERE ((IsPersonel.IsID)=@ID)", con); com.Parameters.AddWithValue("@ID", EES.IsID); OleDbCommand comPersonelUcret = new OleDbCommand("update personeller set bakiye=bakiye-@Ucret WHERE ((personeller.personelID)=@PID)", con); comPersonelUcret.Parameters.AddWithValue("@Ucret", EES.Ucret); comPersonelUcret.Parameters.AddWithValue("@PID", EES.personelID); try { if (com.ExecuteNonQuery() > 0) { if (comPersonelUcret.ExecuteNonQuery() > 0) { MessageBox.Show("Personel Ücret Silme İşlemi Yapılmıştır.", "Silme", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } catch (Exception Ex) { MessageBox.Show(Ex.ToString(), "Hata", MessageBoxButtons.OK, MessageBoxIcon.Warning); } finally { con.Close(); } }
private void Ekle(int ID, double ucret) { EIsPersonel IP = new EIsPersonel(); IP.TakipID = TID; IP.personelID = ID; IP.Ucret = ucret; FIsPersonel.Ekle(IP); }
public static void Guncelle(EIsPersonel EIs) { OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Veritabani\\Data.mdb;Jet OLEDB:Database Password=ayakkabi_gelisimsoft;"); if (con.State == ConnectionState.Closed) { con.Open(); } OleDbCommand comGel = new OleDbCommand("select IsPersonel.Ucret,IsPersonel.personelID from IsPersonel WHERE IsPersonel.IsID=@ID", con); comGel.Parameters.AddWithValue("@ID", EIs.IsID); OleDbDataReader dr = comGel.ExecuteReader(); while (dr.Read()) { if (dr.HasRows == true) { GeldiPara = Convert.ToDouble(dr["Ucret"].ToString()); GeldiID = Convert.ToInt32(dr["personelID"]); } } dr.Dispose(); OleDbCommand com = new OleDbCommand("update personeller set bakiye=personeller.bakiye-@Gelen WHERE ((personeller.personelID)=@PID)", con); com.Parameters.AddWithValue("@Gelen", GeldiPara); com.Parameters.AddWithValue("@PID", GeldiID); OleDbCommand comIsPersonel = new OleDbCommand("Update IsPersonel set TakipID=@TID, Ucret=@Ucret,personelID=@PID WHERE ((IsPersonel.IsID)=@ID)", con); comIsPersonel.Parameters.AddWithValue("@TID", EIs.TakipID); comIsPersonel.Parameters.AddWithValue("@Ucret", EIs.Ucret); comIsPersonel.Parameters.AddWithValue("@PID", EIs.personelID); comIsPersonel.Parameters.AddWithValue("@ID", EIs.IsID); OleDbCommand comPersonel = new OleDbCommand("update personeller set bakiye=bakiye+@Ucret WHERE ((personeller.personelID)=@PID)", con); comPersonel.Parameters.AddWithValue("@Ucret", EIs.Ucret); comPersonel.Parameters.AddWithValue("@PID", EIs.personelID); //try //{ if (com.ExecuteNonQuery() > 0) { if (comIsPersonel.ExecuteNonQuery() > 0) { if (comPersonel.ExecuteNonQuery() > 0) { MessageBox.Show("Personel Ücret Güncelleme İşlemi Yapılmıştır.", "Güncelleme", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } //} //catch (Exception Ex) //{ // MessageBox.Show(Ex.ToString(), "Hata", MessageBoxButtons.OK, MessageBoxIcon.Warning); //} //finally { } con.Close(); }
private void button1_Click(object sender, EventArgs e) { DialogResult soruyoruz = MessageBox.Show("Personel Ücretlerini Silmek İstediğinize Eminin misiniz. ?", "Silme", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (soruyoruz == DialogResult.Yes) { EIsPersonel EP = new EIsPersonel(); EP.IsID = ID; EP.personelID = PID; EP.Ucret = Convert.ToDouble(ucrettxt.Text); FIsPersonel.Sil(EP); Temizle(); Getir(); FaturaKontrol(); } }
private void button1_Click(object sender, EventArgs e) { DialogResult soruyoruz = MessageBox.Show("Personel Ücretlerini Güncellemek İstediğinize Eminin misiniz. ?", "Güncelleme", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (soruyoruz == DialogResult.Yes) { EIsPersonel Is = new EIsPersonel(); Is.IsID = ID; Is.personelID = Convert.ToInt32(prsnl1.SelectedValue); Is.TakipID = TID; Is.Ucret = double.Parse(ucrettxt.Text); FIsPersonel.Guncelle(Is); Temizle(); Getir(); FaturaKontrol(); } }
public static DataTable PEkstre(EIsPersonel EE) { OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Veritabani\\Data.mdb;Jet OLEDB:Database Password=ayakkabi_gelisimsoft;"); if (con.State == ConnectionState.Closed) { con.Open(); } OleDbCommand com = new OleDbCommand("select Ucret,(select TakipNo from IsTakipForm where IsTakipForm.TakipID=IsPersonel.TakipID)as [TakipNo],(select FisNo from IsTakipForm where IsTakipForm.TakipID=IsPersonel.TakipID) as [FisNo],(select adsoyad from personeller where personeller.personelID=IsPersonel.personelID) as [adsoyad] from IsPersonel WHERE ((IsPersonel.personelID)=@ID)", con); com.Parameters.AddWithValue("@ID", EE.personelID); OleDbDataAdapter dep = new OleDbDataAdapter(com); DataTable dt = new DataTable(); dep.Fill(dt); con.Close(); return(dt); }
private void GetirPer() { listView1.Items.Clear(); EIsPersonel s = new EIsPersonel(); s.personelID = Convert.ToInt32(pcombo.SelectedValue); DataTable det = FIsPersonel.PEkstre(s); for (int i = 0; i < det.Rows.Count; i++) { double tutarimiz = Convert.ToDouble(det.Rows[i]["ucret"].ToString()); string tutar = string.Format("{0:C}", tutarimiz); ListViewItem listecik = new ListViewItem(det.Rows[i]["TakipNo"].ToString()); listecik.SubItems.Add(det.Rows[i]["FisNo"].ToString()); listecik.SubItems.Add(det.Rows[i]["adsoyad"].ToString()); listecik.SubItems.Add(tutar); listView1.Items.Add(listecik); } }
private void GTP() { EIsPersonel Elo = new EIsPersonel(); Elo.personelID = Convert.ToInt32(pcombo.SelectedValue); FIsPersonel.GTP(Elo); object geliyo = FIsPersonel.GTP(Elo); if (geliyo == null) { textBox1.Text = ""; } else { double tutarcik = Convert.ToDouble(geliyo); string himm = string.Format("{0:C}", tutarcik); textBox1.Text = himm; } }
private void GTT() { EIsPersonel E = new EIsPersonel(); E.TakipID = Convert.ToInt32(Tcombo.SelectedValue); FIsPersonel.GTF(E); double gelen = FIsPersonel.GTF(E); if (gelen == null) { textBox1.Text = "0"; } else { double turarli = gelen; string tutarimiz = string.Format("{0:C}", turarli); textBox1.Text = tutarimiz; } }
private void button1_Click(object sender, EventArgs e) { if (prsnl.SelectedIndex == 0) { per = "- Lütfen Personel Seçimi Yapınız."; } else { per = ""; } if (takipnotxt.Text == "") { takipcix = "- Lütfen Takip No Seçiniz."; } else { takipcix = ""; } if (prsnl.SelectedIndex == 0 || takipnotxt.Text == "") { MessageBox.Show("Lütfen Aşağıdaki Hataları Kontrol Ediniz.\r" + per + "\r" + takipcix + "\r", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Hand); } else { DialogResult soruyoruz = MessageBox.Show("Personel Ücretini Kaydetmek İstediğinize Eminin misiniz. ?", "Kaydetme", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (soruyoruz == DialogResult.Yes) { EIsPersonel IP = new EIsPersonel(); IP.TakipID = TID; IP.personelID = Convert.ToInt32(prsnl.SelectedValue); IP.Ucret = Convert.ToDouble(ucretxt.Text); FIsPersonel.Ekle(IP); MessageBox.Show("Personel Ücretlendirme İşlemi Yapılmıştır.", "Ücretlendirme", MessageBoxButtons.OK, MessageBoxIcon.Information); Temizle(); Getir(); } } }