Example #1
0
    public void TuDongTinhNgayTien()
    {
        SoNgayNghi          = (dfNgayKetThuc1.SelectedDate - dfNgayBatDau1.SelectedDate).Days + 1;
        txtSoNgayNghi1.Text = SoNgayNghi.ToString();
        DAL.BHBANGTINHCHEDOBAOHIEM btcdbh = new BangTinhCheDoBaoHiemController().GetByPrKey(int.Parse("0" + hdfDieuKienHuong.Text));

        if (SoNgayNghi + int.Parse(txtLuyKe1.Text) > btcdbh.DKThoiGianToiDaHuongCheDo)
        {
            txtSoNgayNghi1.StyleSpec = "color:red";
            Dialog.ShowNotification("Nhân viên có thời gian nghỉ lớn hơn thời gian cho phép");
        }
        else
        {
            txtSoNgayNghi1.StyleSpec = "color:black";
        }
        int congchuan = 24;// int.Parse("0" + new HeThongController().GetValueByName("CONG_CHUAN", Session["MaDonVi"].ToString()));
        //if (congchuan == 0) DateTime.DaysInMonth(dfNgayBatDau1.SelectedDate.Year, dfNgayBatDau1.SelectedDate.Month);
        string congthucdathay = "";

        new BHCHEDOBAOHIEMController().TinhChiTieu(dfNgayBatDau1.SelectedDate, int.Parse("0" + hdfIDNhanVienBaoHiem.Text), out LuongDongBHThangLienKe, out LuongToiThieuChung, out LuongBHBQ6Thang);
        switch (int.Parse(cbbCheDo1.Value.ToString()))
        {
        case 23:
        case 24:
        case 76:
            txtChiTieuLuong1.FieldLabel = "Lương đóng BH tháng liền kề";
            txtChiTieuLuong1.Text       = LuongDongBHThangLienKe.ToString("n0");
            break;

        case 20:
        case 21:
        case 22:
            txtChiTieuLuong1.FieldLabel = "Lương tối thiểu chung";
            txtChiTieuLuong1.Text       = LuongToiThieuChung.ToString("n0");
            break;

        case 26:
        case 27:
        case 28:
        case 29:
        case 75:
            txtChiTieuLuong1.FieldLabel = "Lương đóng BH bình quân 6 tháng";
            txtChiTieuLuong1.Text       = LuongBHBQ6Thang.ToString("n0");
            break;
        }

        decimal sotien = new BHCHEDOBAOHIEMController().XuLyCongThuc(btcdbh.CongThuc, LuongToiThieuChung, LuongDongBHThangLienKe, LuongBHBQ6Thang, SoNgayNghi, congchuan, out congthucdathay);

        txtSoTienDeNghi1.Text = ((long)sotien / 1000 * 1000).ToString("0");
        tipSoTienDeNghi.Html  = btcdbh.CongThuc + "\n =" + congthucdathay;
    }
Example #2
0
    public void cbbCheDo1_Selected()
    {
        cbbDieuKienHuong1.Reset();
        txtLuyKe1.Text = new CheDoBaoHiemController().TinhSoNgayNghiNhanVien(int.Parse("0" + hdfIDNhanVienBaoHiem.Text), int.Parse("0" + hdfIDCheDoBaoHiem.Text)).ToString();
        DateTime date;

        if (!Util.GetInstance().IsDateNull(dfNgayBatDau1.SelectedDate))
        {
            date = dfNgayBatDau1.SelectedDate;
        }
        else
        {
            date = DateTime.Now;
        }
        new BHCHEDOBAOHIEMController().TinhChiTieu(date, int.Parse("0" + hdfIDNhanVienBaoHiem.Text), out LuongDongBHThangLienKe, out LuongToiThieuChung, out LuongBHBQ6Thang);
        switch (int.Parse(cbbCheDo1.Value.ToString()))
        {
        case 23:
        case 24:
        case 76:
            txtChiTieuLuong1.FieldLabel = "Lương đóng BH tháng liền kề";
            txtChiTieuLuong1.Text       = LuongDongBHThangLienKe.ToString("n0");
            break;

        case 20:
        case 21:
        case 22:
            txtChiTieuLuong1.FieldLabel = "Lương tối thiểu chung";
            txtChiTieuLuong1.Text       = LuongToiThieuChung.ToString("n0");
            break;

        case 26:
        case 27:
        case 28:
        case 29:
        case 75:
            txtChiTieuLuong1.FieldLabel = "Lương đóng BH bình quân 6 tháng";
            txtChiTieuLuong1.Text       = LuongBHBQ6Thang.ToString("n0");
            break;
        }
    }