Ejemplo n.º 1
0
        private void InitObject()
        {
            oHopdong     = new Business.HDQD.CNVC_HopDong();
            oLoaihopdong = new Business.HDQD.LoaiHopDong();
            oChucdanh    = new ChucDanh();
            oChucvu      = new ChucVu();
            oDonvi       = new DonVi();
            oFTP         = new Business.FTP();
            oFile        = new Business.CNVC.CNVC_File();
            oBacHeSo     = new Business.Luong.BacHeSo();
            dtBacHeSo    = new DataTable();

            oLoaiPC     = new Business.HDQD.LoaiPhuCap();
            dtPhuCap    = new DataTable();
            dtLoaiPC    = new DataTable();
            dtDonVi     = new DataTable();
            oCNVCPhuCap = new Business.HDQD.CNVC_PhuCap();

            dtLoaiPC = oLoaiPC.GetList_Cbo();

            PreapreDataSource();
            Prepare_Data_BacHeSo();
            PrepareDataTablePhuCap();
        }
Ejemplo n.º 2
0
        private void DisplayInfo(string cnvc_ho, string cnvc_ten)
        {
            thongTinCNVC1.txt_MaNV.Text = oHopdong.Ma_NV;
            thongTinCNVC1.txt_Ho.Text   = cnvc_ho;
            thongTinCNVC1.txt_Ten.Text  = cnvc_ten;

            thongTinQuyetDinh1.txt_MaQD.Text  = oHopdong.Ma_Tuyen_Dung.Substring(0, oHopdong.Ma_Tuyen_Dung.Length - 9);
            thongTinQuyetDinh1.txt_TenQD.Text = oHopdong.Ten_Quyet_Dinh;
            thongTinQuyetDinh1.rTB_MoTa.Text  = oHopdong.MoTa_QD;
            if (oHopdong.Ngay_Ky != null)
            {
                thongTinQuyetDinh1.dTP_NgayKy.Value = oHopdong.Ngay_Ky.Value;
            }
            if (oHopdong.Ngay_Hieu_Luc != null)
            {
                thongTinQuyetDinh1.dTP_NgayHieuLuc.Value = oHopdong.Ngay_Hieu_Luc.Value;
            }
            if (oHopdong.Ngay_Het_Han != null)
            {
                thongTinQuyetDinh1.dTP_NgayHetHan.Checked = true;
                thongTinQuyetDinh1.dTP_NgayHetHan.Value   = oHopdong.Ngay_Het_Han.Value;
            }
            if (oHopdong.Loai_QD_ID != null)
            {
                thongTinQuyetDinh1.comB_Loai.SelectedValue = oHopdong.Loai_QD_ID;
            }

            //Xử lý combo box
            if (oHopdong.Chuc_Danh_ID != null)
            {
                comB_ChucDanh.SelectedValue = oHopdong.Chuc_Danh_ID;
            }
            if (oHopdong.Chuc_Vu_ID != null)
            {
                comB_ChucVu.SelectedValue = oHopdong.Chuc_Vu_ID;
            }
            if (oHopdong.Don_Vi_ID != null)
            {
                comB_DonVi.SelectedValue = oHopdong.Don_Vi_ID;
            }

            try
            {
                cb_ThamNienNB.Checked = oHopdong.Tham_nien_nang_bac;
                cb_ThamNienNG.Checked = oHopdong.Tham_nien_nha_giao;
            }
            catch { }

            #region Luong Info
            txt_Tien.Text      = oHopdong.Luong_Khoan.ToString();
            nup_PhanTram.Value = Convert.ToDecimal(oHopdong.PhanTramHuong.Value);
            if (oHopdong.Khoan_or_HeSo == true)
            {
                comb_Luong.Text = "Hệ số";
            }
            else
            {
                comb_Luong.Text = "Khoán";
            }

            if (oHopdong.BacHeSo_ID != null)
            {
                var result = (from c in dtBacHeSo.AsEnumerable()
                              where c.Field <int>("id") == oHopdong.BacHeSo_ID && c.Field <bool>("tinh_trang") == true
                              select c.Field <string>("ma_ngach")
                              );

                string ma_ngach = result.ElementAt(0).ToString();

                comb_Ngach.SelectedValue = ma_ngach;
                comb_Bac.SelectedValue   = oHopdong.BacHeSo_ID;

                var result1 = (from c in dtBacHeSo.AsEnumerable()
                               where c.Field <int>("id") == oHopdong.BacHeSo_ID
                               select c.Field <double>("he_so"));

                double m_he_so = result1.ElementAt <double>(0);

                txt_HeSo.Text = m_he_so.ToString();
            }
            #endregion

            #region Phu Cap Info
            cb_CoPhuCap.Checked = !oHopdong.Co_Phu_Cap;

            if (oHopdong.Co_Phu_Cap == true)
            {
                Business.HDQD.CNVC_PhuCap oCNVCPhuCap = new Business.HDQD.CNVC_PhuCap();
                dtPhuCap = oCNVCPhuCap.GetList_PhuCap_byCNVC(oHopdong.Ma_Tuyen_Dung, oHopdong.Ma_NV);
                PrepareDTGVSource(dtPhuCap);
            }
            #endregion
        }