示例#1
0
        private bool KiemTraThoaDieuKien(Mode_Xem_CT_VaoRa mode, cCheckInOut_DaCC CIO)
        {
            switch (mode)
            {
            case Mode_Xem_CT_VaoRa.XemThieuChamCong:
                if (CIO.CheckVT != TrangThaiCheck.CheckDayDu)
                {
                    return(true);
                }
                break;

            case Mode_Xem_CT_VaoRa.XemVaoTreRaSom:
                if (CIO.CheckVT == TrangThaiCheck.CheckDayDu &&
                    ((CIO.ChoPhepTre == false && CIO.Tre > TimeSpan.Zero) ||
                     (CIO.ChoPhepSom == false && CIO.Som > TimeSpan.Zero))
                    )
                {
                    return(true);
                }
                break;

            case Mode_Xem_CT_VaoRa.Xem_KoNhanDienCa:
                return(false);

            case Mode_Xem_CT_VaoRa.Xem_OLaiChuaXN:
                return(false);

            case Mode_Xem_CT_VaoRa.Xem_GioBiChinhSua:
                return(false);

            case Mode_Xem_CT_VaoRa.Xem_DaXNCa:
                return(false);

            case Mode_Xem_CT_VaoRa.Xem_DaXN_LamThem:
                return(false);

            case Mode_Xem_CT_VaoRa.Xem_ChoPhepTre_Som:
                if (CIO.CheckVT == TrangThaiCheck.CheckDayDu &&
                    (CIO.ChoPhepTre || CIO.ChoPhepSom))
                {
                    return(true);
                }
                break;

            case Mode_Xem_CT_VaoRa.Xem_VaoRa_TuDo:
                if (CIO.CheckVT == TrangThaiCheck.CheckDayDu &&
                    (CIO.VaoTuDo || CIO.RaaTuDo))
                {
                    return(true);
                }
                break;

            default:
                break;
            }
            return(false);
        }
示例#2
0
        //public void

        internal void GetCIOData(DataTable tableArrayUEN, FromToDateTime KhoangTG, out List <cCheckInOut_DaCC> DS_CIO_DaCC)
        {
            DataTable tableCIO = SqlDataAccessHelper.ExecSPQuery(SPName6.CIO_GetData_V6.ToString(),
                                                                 new SqlParameter {
                ParameterName = "@Array_UserEnrollNumber", Value = tableArrayUEN, SqlDbType = SqlDbType.Structured
            },
                                                                 new SqlParameter("@From", KhoangTG.From),
                                                                 new SqlParameter("@To", KhoangTG.To));

            DS_CIO_DaCC = new List <cCheckInOut_DaCC>();
            foreach (DataRow row in tableCIO.Rows)
            {
                cCheckInOut_DaCC cio = new cCheckInOut_DaCC();
                cio.ID   = (int)row["ID"];
                cio.MaCC = (int)row["UserEnrollNumber"];
                cio.Ngay = (DateTime)row["NgayCong"];
                if (row["GioVao"] != DBNull.Value)
                {
                    cio.GioVao = (DateTime)row["GioVao"];
                }
                if (row["GioRa"] != DBNull.Value)
                {
                    cio.GioRaa = (DateTime)row["GioRa"];
                }
                cio.CheckVT  = TrangThaiCheckVT((int)row["HaveINOUT"]);
                cio.KyHieuCa = row["KyHieuCa"].ToString();                //todo ký hiệu ca
                cio.Tre_Min  = (int)row["Tre"];
                cio.Som_Min  = (int)row["Som"];
                if (row["VaoSauCa"] != DBNull.Value)
                {
                    cio.VaoSauCa = new TimeSpan(0, (int)row["VaoSauCa"], 0);
                }
                if (row["RaTruocCa"] != DBNull.Value)
                {
                    cio.RaTruocCa = new TimeSpan(0, (int)row["RaTruocCa"], 0);
                }

                cio.VaoLamTron_Min    = (int)row["Vao"];
                cio.RaaLamTron_Min    = (int)row["Ra"];
                cio.BDCa_Min          = (int)row["BDCa"];
                cio.KTCa_Min          = (int)row["KTCa"];
                cio.BD_LV_Min         = (int)row["BDLV"];
                cio.KT_LV_TrongCa_Min = (int)row["KTLVTrongCa"];
                cio.KT_LV_Min         = (int)row["KTLV"];
                cio.LunchMin          = (int)row["SoPhutNghiTrua"];
                cio.BD_LV_Ca3_Min     = (int)row["BDLVCa3"];
                cio.KT_LV_Ca3_Min     = (int)row["KTLVCa3"];
                cio.QuaDem            = (bool)row["QuaDem"];
                cio.ChoPhepTre        = (bool)row["ChoPhepTre"];
                cio.ChoPhepSom        = (bool)row["ChoPhepSom"];
                cio.VaoTuDo           = (bool)row["VaoTuDo"];
                cio.RaaTuDo           = (bool)row["RaTuDo"];
                cio.TinhCongThuCong   = (bool)row["TinhCongThuCong"];
                cio.CongTrongGio      = (float)row["CongTrongGio"];
                cio.CongNgoaiGio      = (float)row["CongNgoaiGio"];
                cio.TruCongTre        = (float)row["TruCongTre"];
                cio.TruCongSom        = (float)row["TruCongSom"];
                cio.ChamCongTay       = (float)row["ChamCongTay"];
                cio.CapNhatDinhMucCong();
                cio.CapNhatDinhTongCong();
                DS_CIO_DaCC.Add(cio);
            }
        }