🔒 Closed Help Help! presentation na bukas

Status
Not open for further replies.

Jr43

Enthusiast
private void btnStart_Click(object sender, EventArgs e)
{
con.dataGet("Select * from dbo.EmpAttendance Where Year = '" + cbYear.Text + "' and Month = '" + cbMonth.Text + "'");
DataTable dt = new DataTable();
con.sda.Fill(dt);
if (dt.Rows.Count > 0)
{
foreach (DataRow row in dt.Rows)
{
con.dataGet("Select ES.Salary, EA.WorkingDays, EA.PresentDays, EA.LopDays From dbo.EmpAttendance EA INNER JOIN dbo.EmpSalary ES ON EA.EmpId = ES.EmpId Where EA.Year ='" + cbYear.Text + "' AND EA.Month = '" + cbMonth.Text + "' AND EA.EmpId = '" + dt.Rows[0]["EmpId"].ToString() + "'");
DataTable dt1 = new DataTable();
con.sda.Fill(dt1);
salary = float.Parse(dt1.Rows[0]["Salary"].ToString());
WDays = float.Parse(dt1.Rows[0]["WorkingDays"].ToString());
present = float.Parse(dt1.Rows[0]["PresentDays"].ToString());
lop = float.Parse(dt1.Rows[0]["LopDays"].ToString());
perDay = (salary / 12) / WDays;
netSalary = (perDay * present) - (perDay * lop);
con.dataSend("INSERT INTO dbo.SalaryProcess (EmpId, Year, Month, NetSalary) VALUES ('" + dt1.Rows[0]["EmpId"].ToString() + "','" + cbYear.Text + "','" + cbMonth.Text + "','" + netSalary + "')");
MessageBox.Show("Salary Generated", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
LoadData();
}
}

}

eto yung method pero pag clinick ko yung start button nag dodoble doble yung salary dun sa iisang employee



ang gusto ko sana e sa lahat ng employee

Screenshot (70).webp
 
Status
Not open for further replies.

About this Thread

  • 1
    Replies
  • 513
    Views
  • 2
    Participants
Last reply from:
tata_Lino

Trending Topics

Online now

Members online
1,153
Guests online
1,026
Total visitors
2,179

Forum statistics

Threads
2,274,706
Posts
28,957,751
Members
1,233,405
Latest member
VEdge2025
Back
Top