Пример #1
0
        private void btntinhluong_Click_1(object sender, EventArgs e)
        {
            cltinhluong cl = new cltinhluong();
            float       mucluong, HeSoLuong, phucap, ngaythang, ngaylam;
            float       kq = 0;

            mucluong          = cl.chuyensangso(txtmucluong.Text);
            HeSoLuong         = cl.chuyensangso(txthesoluong.Text);
            phucap            = cl.chuyensangso(txtphucap.Text);
            ngaylam           = cl.chuyensangso(txtngaylam.Text);
            ngaythang         = cl.chuyensangso(txtngaythang.Text);
            kq                = cl.tinhluong(mucluong, HeSoLuong, phucap, ngaythang, ngaylam);
            txttinhluong.Text = cl.chuyensangchuoi(kq);
            strsql            = "update tbluongnhanvien set tongtienluong='" + txttinhluong.Text + "' where manv='" + cbManv.Text + "'";
            objcmd            = new SqlCommand(strsql, objcon);

            objcmd.ExecuteNonQuery();
            Hienthi();
        }
        private void btntinhluong_Click_1(object sender, EventArgs e)
        {
            cltinhluong cl = new cltinhluong();
            float mucluong, HeSoLuong, phucap, ngaythang, ngaylam;
            float kq = 0;
            mucluong = cl.chuyensangso(txtmucluong.Text);
            HeSoLuong = cl.chuyensangso(txthesoluong.Text);
            phucap = cl.chuyensangso(txtphucap.Text);
            ngaylam = cl.chuyensangso(txtngaylam.Text);
            ngaythang = cl.chuyensangso(txtngaythang.Text);
            kq = cl.tinhluong(mucluong, HeSoLuong, phucap, ngaythang, ngaylam);
            txttinhluong.Text = cl.chuyensangchuoi(kq);
            strsql = "update tbluongnhanvien set tongtienluong='" + txttinhluong.Text + "' where manv='" + cbManv.Text + "'";
            objcmd = new SqlCommand(strsql, objcon);

            objcmd.ExecuteNonQuery();
            Hienthi();
        }