What's new

Help Help! presentation na bukas

Jr43

Addict
Joined
Apr 8, 2018
Posts
13
Reaction
0
Points
68
Age
25
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).png
 

Attachments

Back
Top