Exemplo n.º 1
0
        private void Build()
        {
            //tlDmCbNv.KeyFieldName = "MA_CBNV";
            //tlDmCbNv.ParentFieldName = "MA_BP";
            //tlDmCbNv.Dock = DockStyle.Fill;

            //tlDmCbNv.strZone = "EMPLOYEE";
            //tlDmCbNv.BuildTreeList(this.isLookup);
            //dtEmployee = HRMCommon.GetCustomerTable("MA_KV");
            tlDmCbNv = HRMCommon.GetTreeViewCust(this.isLookup);
            this.splControl1.Visible = false;
            this.pageEmployee.Controls.Add(tlDmCbNv);

            dgvBHXH.strZone = "BHXH";
            dgvBHXH.BuildGridView();

            dgvBHYT.strZone = "BHYT";
            dgvBHYT.BuildGridView();

            dgvTroCap.strZone = "TROCAP";
            dgvTroCap.BuildGridView();

            dgvTyLe.strZone = "TYLE";
            dgvTyLe.BuildGridView();
        }
Exemplo n.º 2
0
        private void FillData(string strKey)
        {
            //dtEmployee = SQLExec.ExecuteReturnDt("EXEC Sp_GetDmCbNv");
            dtEmployee             = HRMCommon.GetCustomerTable("MA_KV", this.cboFill.Text);
            bdsEmployee.DataSource = dtEmployee;
            tlDmCbNv.DataSource    = bdsEmployee;
            //bdsEmployee.Position = 0;

            //HOPDONG
            //dtHopDong = DataTool.SQLGetDataTable("HRHOPDONG", null, strKey, "Ngay_Begin, Ngay_End");
            dtHopDong             = SQLExec.ExecuteReturnDt("SELECT * FROM HRHOPDONG");
            bdsHopDong.DataSource = dtHopDong;
            dgvHopDong.DataSource = bdsHopDong;

            //HOPDONGPL
            //dtHopDongPL = DataTool.SQLGetDataTable("HRHOPDONGPL", null, strKey, "Ngay_Begin, Ngay_End");
            dtHopDongPL             = SQLExec.ExecuteReturnDt("SELECT * FROM HRHOPDONGPL");
            bdsHopDongPL.DataSource = dtHopDongPL;
            dgvHopDongPL.DataSource = bdsHopDongPL;

            //Tham số các khoản thu nhập
            string strSQLExec =
                "SELECT T1.*, T2.Ten_Tn, T2.Dvt FROM HRPARAVALUE0 T1 LEFT JOIN HRPARALIST T2 ON T1.Ma_Tn = T2.Ma_Tn " +
                " ORDER BY Ngay_Ap";

            //Uy quyen cho lop co so tim kiem
            bdsSearch     = bdsEmployee;
            ExportControl = tlDmCbNv;

            tlDmCbNv.Expand = (bool)SQLExec.ExecuteReturnValue("SELECT Expand FROM SYSZONE WHERE ZONE = '" + tlDmCbNv.strZone + "'");
        }
Exemplo n.º 3
0
        private void Build()
        {
            //
            tlDmCbNv = HRMCommon.GetTreeViewCust(this.isLookup);

            this.splControl1.Visible = false;
            this.pageEmployee.Controls.Add(tlDmCbNv);

            dgvThue.strZone = "THUE_NV";
            dgvThue.BuildGridView();
        }
Exemplo n.º 4
0
        private void Build()
        {
            //dtEmployee = HRMCommon.GetCustomerTable("MA_KV");
            tlDmCbNv = HRMCommon.GetTreeViewCust(this.isLookup);

            this.splControl1.Visible = false;
            this.pageEmployee.Controls.Add(tlDmCbNv);

            dgvHopDong.strZone = "HOPDONGLD";
            dgvHopDong.BuildGridView();

            dgvHopDongPL.strZone = "HOPDONGLD_PL";
            dgvHopDongPL.BuildGridView();
        }
Exemplo n.º 5
0
        private void Build()
        {
            //
            tlDmCbNv = HRMCommon.GetTreeViewCust(this.isLookup);

            this.splControl1.Visible = false;
            this.pageEmployee.Controls.Add(tlDmCbNv);

            dgvNghiPhep.strZone = "NGHIPHEP";
            dgvNghiPhep.BuildGridView();

            dgvPhepNam.strZone = "PHEPNAM";
            dgvPhepNam.BuildGridView();
        }
Exemplo n.º 6
0
        private void Build()
        {
            //tlDmCbNv.KeyFieldName = "MA_CBNV";
            //tlDmCbNv.ParentFieldName = "MA_TH";
            //tlDmCbNv.Dock = DockStyle.Fill;

            tlDmCbNv.strZone = "EMPLOYEE";
            //tlDmCbNv.BuildTreeList(this.isLookup);

            tlDmCbNv = HRMCommon.GetTreeViewCust(this.isLookup);

            this.splControl1.Visible = false;
            this.pageEmployee.Controls.Add(tlDmCbNv);

            dgvGiaDinh.strZone = "GIADINH";
            dgvGiaDinh.BuildGridView();

            dgvCongTac.strZone = "CONGTAC";
            dgvCongTac.BuildGridView();

            dgvBangCap.strZone = "DAOTAO";
            dgvBangCap.BuildGridView();

            dgvKhenThuong.strZone = "KHENTHUONG";
            dgvKhenThuong.BuildGridView();

            dgvNghiPhep.strZone = "NGHIPHEP";
            dgvNghiPhep.BuildGridView();

            dgvPhucLoi.strZone = "PHUCLOI";
            dgvPhucLoi.BuildGridView();

            dgvDanhGia.strZone = "DANHGIA";
            dgvDanhGia.BuildGridView();

            dgvKinhNghiem.strZone = "KINHNGHIEM";
            dgvKinhNghiem.BuildGridView();

            dgvKyNang.strZone = "KYNANG";
            dgvKyNang.BuildGridView();


            dgvLamViec.strZone = "LAMVIEC";
            dgvLamViec.BuildGridView();

            dgvQUALIFY.strZone = "HRQUALIFY";
            dgvQUALIFY.BuildGridView();
        }
Exemplo n.º 7
0
        void EditEmployee(enuEdit enuNew_Edit)
        {
            if (bdsEmployee.Position < 0 && enuNew_Edit == enuEdit.Edit)
            {
                return;
            }

            //Copy hang hien tai
            if (bdsEmployee.Position >= 0)
            {
                Common.CopyDataRow(((DataRowView)bdsEmployee.Current).Row, ref drCurrent);
            }
            else
            {
                drCurrent = dtEmployee.NewRow();
            }

            frmEmployee_Edit frmEdit = new frmEmployee_Edit();

            frmEdit.Load(enuNew_Edit, drCurrent);

            //Accept
            if (frmEdit.isAccept)
            {
                if (enuNew_Edit == enuEdit.New)
                {
                    if (bdsEmployee.Position >= 0)
                    {
                        dtEmployee.ImportRow(drCurrent);
                    }
                    else
                    {
                        dtEmployee.Rows.Add(drCurrent);
                    }
                    dtEmployee             = HRMCommon.GetCustomerTable("MA_KV");
                    bdsEmployee.DataSource = dtEmployee;
                    tlDmCbNv.DataSource    = bdsEmployee;
                    bdsEmployee.Position   = bdsEmployee.Find("MA_CBNV", drCurrent["MA_CBNV"]);
                }
                else
                {
                    Common.CopyDataRow(drCurrent, ((DataRowView)bdsEmployee.Current).Row);
                }

                dtEmployee.AcceptChanges();
            }
        }
Exemplo n.º 8
0
        private void FillData(string strKey)
        {
            //dtEmployee = SQLExec.ExecuteReturnDt("EXEC Sp_GetDmCbNv");
            dtEmployee             = HRMCommon.GetCustomerTable("MA_KV", this.cboFill.Text);
            bdsEmployee.DataSource = dtEmployee;
            tlDmCbNv.DataSource    = bdsEmployee;
            //bdsEmployee.Position = 0;

            //BHXH
            dtBHXH             = DataTool.SQLGetDataTable("HRBHXH", null, strKey, "Ngay_Begin, Ngay_Tang_BH");
            bdsBHXH.DataSource = dtBHXH;
            dgvBHXH.DataSource = bdsBHXH;

            //BHYT
            dtBHYT             = DataTool.SQLGetDataTable("HRBHYT", null, strKey, "Ngay_Begin, Ngay_End");
            bdsBHYT.DataSource = dtBHYT;
            dgvBHYT.DataSource = bdsBHYT;

            //TyLe
            string strSQLExec1 =
                "SELECT T1.*, T2.Ten_Tn, T2.Dvt FROM HRPARAVALUE0 T1 LEFT JOIN HRPARALIST T2 ON T1.Ma_Tn = T2.Ma_Tn " +
                " WHERE T1.Ma_Tn LIKE 'BH%' OR T1.Ma_Tn LIKE 'KP%' ORDER BY Ngay_Ap";

            dtTyLe             = SQLExec.ExecuteReturnDt(strSQLExec1);
            bdsTyLe.DataSource = dtTyLe;
            dgvTyLe.DataSource = bdsTyLe;

            //TroCap
            string strSQLExec2 =
                "SELECT T1.*, T2.Ten_Tn, T2.Dvt FROM HRPARAVALUE0 T1 LEFT JOIN HRPARALIST T2 ON T1.Ma_Tn = T2.Ma_Tn " +
                " WHERE T1.Ma_Tn LIKE 'PHUCAP%' ORDER BY Ngay_Ap";

            dtTroCap             = SQLExec.ExecuteReturnDt(strSQLExec2);
            bdsTroCap.DataSource = dtTroCap;
            dgvTroCap.DataSource = bdsTroCap;

            //Uy quyen cho lop co so tim kiem
            bdsSearch     = bdsEmployee;
            ExportControl = tlDmCbNv;

            tlDmCbNv.Expand = (bool)SQLExec.ExecuteReturnValue("SELECT Expand FROM SYSZONE WHERE ZONE = '" + tlDmCbNv.strZone + "'");
        }
Exemplo n.º 9
0
        private void FillData(string strKey)
        {
            //dtEmployee = SQLExec.ExecuteReturnDt("EXEC Sp_GetDmCbNv");
            dtEmployee             = HRMCommon.GetCustomerTable("MA_KV", cboFill.Text);
            bdsEmployee.DataSource = dtEmployee;
            tlDmCbNv.DataSource    = bdsEmployee;

            //Tham số các khoản thu nhập
            string strSQLExec =
                "SELECT T1.*, T2.Ten_Tn, T2.Dvt FROM HRPARAVALUE0 T1 LEFT JOIN HRPARALIST T2 ON T1.Ma_Tn = T2.Ma_Tn " +
                " ORDER BY Ngay_Ap";

            dtTsTn0             = SQLExec.ExecuteReturnDt(strSQLExec);
            bdsTsTn0.DataSource = dtTsTn0;
            dgvTsTn0.DataSource = bdsTsTn0;

            //Uy quyen cho lop co so tim kiem
            bdsSearch     = bdsEmployee;
            ExportControl = tlDmCbNv;

            tlDmCbNv.Expand = (bool)SQLExec.ExecuteReturnValue("SELECT Expand FROM SYSZONE WHERE ZONE = '" + tlDmCbNv.strZone + "'");
        }
Exemplo n.º 10
0
        private void FillData(string strKey)
        {
            dtEmployee             = HRMCommon.GetCustomerTable("MA_KV");
            bdsEmployee.DataSource = dtEmployee;
            tlDmCbNv.DataSource    = bdsEmployee;
            //bdsEmployee.Position = 0;

            //THUE
            dtThue             = DataTool.SQLGetDataTable("HRTHUE", null, strKey, "Nam, Thang");
            bdsThue.DataSource = dtThue;
            dgvThue.DataSource = bdsThue;

            //Tham số các khoản thu nhập
            string strSQLExec =
                "SELECT T1.*, T2.Ten_Tn, T2.Dvt FROM HRPARAVALUE0 T1 LEFT JOIN HRPARALIST T2 ON T1.Ma_Tn = T2.Ma_Tn " +
                " ORDER BY Ngay_Ap";

            //Uy quyen cho lop co so tim kiem
            bdsSearch     = bdsEmployee;
            ExportControl = tlDmCbNv;

            tlDmCbNv.Expand = (bool)SQLExec.ExecuteReturnValue("SELECT Expand FROM SYSZONE WHERE ZONE = '" + tlDmCbNv.strZone + "'");
        }
Exemplo n.º 11
0
        private void FillData(string strKey)
        {
            dtEmployee             = HRMCommon.GetCustomerTable("MA_KV");
            bdsEmployee.DataSource = dtEmployee;
            tlDmCbNv.DataSource    = bdsEmployee;
            //bdsEmployee.Position = 0;

            //NGHIPHEP
            dtNghiPhep             = DataTool.SQLGetDataTable("HRNGHIPHEP", null, strKey, "Ngay_Begin, Ngay_End");
            bdsNghiPhep.DataSource = dtNghiPhep;
            dgvNghiPhep.DataSource = bdsNghiPhep;

            //PHEPNAM
            dtPhepNam             = DataTool.SQLGetDataTable("HRPHEPNAM", null, strKey, "Ma_CbNv");
            bdsPhepNam.DataSource = dtPhepNam;
            dgvPhepNam.DataSource = bdsPhepNam;

            //Uy quyen cho lop co so tim kiem
            bdsSearch     = bdsEmployee;
            ExportControl = tlDmCbNv;

            tlDmCbNv.Expand = (bool)SQLExec.ExecuteReturnValue("SELECT Expand FROM SYSZONE WHERE ZONE = '" + tlDmCbNv.strZone + "'");
        }
Exemplo n.º 12
0
        void btViewContract_Click(object sender, EventArgs e)
        {
            try
            {
                string HDLD    = Parameters.GetParaValue("HDLD").ToString();    // "HDLD20180824";
                string HDLD2   = Parameters.GetParaValue("HDLD2").ToString();   // "HDLD20180824";-- Hợp đồng không thời hạn
                string HDLD_PL = Parameters.GetParaValue("HDLDPL").ToString();  //"HDLD20180824_PL";
                string HDLD_HL = Parameters.GetParaValue("HDLDHL").ToString();  //"HDLD20180824_PL";--  -- Hợp đồng huấn luyện

                if (tabDetail.SelectedTab == pageHopDong || dgvHopDong.Focused) // View hop dong
                {
                    if (bdsHopDong.Position < 0)
                    {
                        return;
                    }

                    DataRow drCurrentHD = ((DataRowView)bdsHopDong.Current).Row;

                    string    strSQLProc  = "sp_GetHDLDInfo";
                    Hashtable htParameter = new Hashtable();
                    htParameter.Add("MA_CBNV", drCurrentHD["Ma_Cbnv"].ToString());
                    htParameter.Add("SO_HD", drCurrentHD["So_Hd"].ToString());
                    htParameter.Add("SO_PL", string.Empty);
                    DataTable dtResult = SQLExec.ExecuteReturnDt(strSQLProc, htParameter, CommandType.StoredProcedure);



                    string fileName       = DataTool.SQLGetNameByCode("SYSRESOURCES", "FILE_ID", "FILE_ID", HDLD);
                    object objFileContent = Resource.LoadResource(HDLD);
                    if (drCurrentHD["Loai_Hd"].ToString() == "5")
                    {
                        fileName       = DataTool.SQLGetNameByCode("SYSRESOURCES", "FILE_ID", "FILE_ID", HDLD_HL);
                        objFileContent = Resource.LoadResource(HDLD_HL);
                    }
                    if (drCurrentHD["Loai_Hd"].ToString() == "2")
                    {
                        fileName       = DataTool.SQLGetNameByCode("SYSRESOURCES", "FILE_ID", "FILE_ID", HDLD2);
                        objFileContent = Resource.LoadResource(HDLD2);
                    }

                    string strFileTemplate = Application.StartupPath + @"\Template\" + fileName;


                    if (objFileContent != null)
                    {
                        FileStream stream = new FileStream(strFileTemplate, FileMode.Create, FileAccess.ReadWrite);
                        stream.Write((byte[])objFileContent, 0, ((byte[])objFileContent).Length);
                        stream.Close();
                    }
                    else
                    {
                        EpointMessage.MsgOk("Tập tin rỗng");
                    }



                    HRMCommon.WriteToWordQTTC04(dtResult, strFileTemplate, fileName);
                }
                else if (tabDetail.SelectedTab == pageHopDongPL || dgvHopDongPL.Focused)//View phụ lục hợp đồng
                {
                    if (bdsHopDongPL.Position < 0)
                    {
                        return;
                    }

                    DataRow drCurrentPL = ((DataRowView)bdsHopDongPL.Current).Row;
                    if (drCurrentPL["File_Id"].ToString() != string.Empty)
                    {
                        HDLD_PL = drCurrentPL["File_Id"].ToString();
                    }

                    string fileName        = DataTool.SQLGetNameByCode("SYSRESOURCES", "FILE_ID", "FILE_ID", HDLD_PL);
                    string strFileTemplate = Application.StartupPath + @"\Template\" + fileName;

                    object objFileContent = Resource.LoadResource(HDLD_PL);
                    if (objFileContent != null)
                    {
                        FileStream stream = new FileStream(strFileTemplate, FileMode.Create, FileAccess.ReadWrite);
                        stream.Write((byte[])objFileContent, 0, ((byte[])objFileContent).Length);
                        stream.Close();
                    }
                    else
                    {
                        EpointMessage.MsgOk("Tập tin rỗng");
                    }


                    string    strSQLProc  = "sp_GetHDLDInfo";
                    Hashtable htParameter = new Hashtable();
                    htParameter.Add("MA_CBNV", drCurrentPL["Ma_Cbnv"].ToString());
                    htParameter.Add("SO_HD", string.Empty);
                    htParameter.Add("SO_PL", drCurrentPL["So_Pl"].ToString());
                    DataTable dtResult = SQLExec.ExecuteReturnDt(strSQLProc, htParameter, CommandType.StoredProcedure);
                    if (dtResult != null && dtResult.Rows.Count > 0)
                    {
                        HRMCommon.WriteToWordQTTC04(dtResult, strFileTemplate, fileName);
                    }
                    else
                    {
                        EpointMessage.MsgOk("Không xuất được báo cáo!");
                    }
                }
            }
            catch (Exception ex)
            {
                EpointMessage.MsgOk(ex.Message);
            }
        }
Exemplo n.º 13
0
        private void FillData(string strKey)
        {
            //Hashtable htPara = new Hashtable();
            //htPara.Add("USERID", Element.sysUser_Id);
            //htPara.Add("PARENTFIELDNAME", "MA_KV");
            dtEmployee = HRMCommon.GetCustomerTable("MA_KV", cboFill.Text);

            bdsEmployee.DataSource = dtEmployee;
            tlDmCbNv.DataSource    = bdsEmployee;
            //bdsEmployee.Position = 0;

            //GIADINH
            dtGiaDinh             = DataTool.SQLGetDataTable("HRGIADINH", null, strKey, "Nam_Sinh, Loai_QHGD");
            bdsGiaDinh.DataSource = dtGiaDinh;
            dgvGiaDinh.DataSource = bdsGiaDinh;

            //CONGTAC
            //dtCongTac = DataTool.SQLGetDataTable("HRCONGTAC", null, strKey, "Ngay_Begin, Ngay_End");
            dtCongTac             = SQLExec.ExecuteReturnDt("SELECT * FROM HRCONGTAC ORDER BY Ngay_Begin, Ngay_End");
            bdsCongTac.DataSource = dtCongTac;
            dgvCongTac.DataSource = bdsCongTac;

            //DAOTAO
            //dtDaoTao = DataTool.SQLGetDataTable("HRDAOTAO", null, strKey, "Ngay_Begin, Ngay_End");
            dtDaoTao              = SQLExec.ExecuteReturnDt("SELECT * FROM HRDAOTAO ORDER BY Ngay_Begin, Ngay_End");
            bdsDaoTao.DataSource  = dtDaoTao;
            dgvBangCap.DataSource = bdsDaoTao;

            //KHENTHUONG
            //dtKhenThuong = DataTool.SQLGetDataTable("HRKHENTHUONG", null, strKey, "Ngay_QD, Ngay_HL");
            dtKhenThuong             = SQLExec.ExecuteReturnDt("SELECT * FROM HRKHENTHUONG ORDER BY Ngay_QD, Ngay_HL");
            bdsKhenThuong.DataSource = dtKhenThuong;
            dgvKhenThuong.DataSource = bdsKhenThuong;

            //NGHIPHEP
            //dtNghiPhep = DataTool.SQLGetDataTable("HRNGHIPHEP", null, strKey, "Ngay_Begin, Ngay_End");
            dtNghiPhep             = SQLExec.ExecuteReturnDt("SELECT * FROM HRNGHIPHEP ORDER BY Ngay_Begin, Ngay_End");
            bdsNghiPhep.DataSource = dtNghiPhep;
            dgvNghiPhep.DataSource = bdsNghiPhep;

            //PHUCLOI
            //dtPhucLoi = DataTool.SQLGetDataTable("HRPHUCLOI", null, strKey, "Ngay_Begin, Ngay_End");
            dtPhucLoi             = SQLExec.ExecuteReturnDt("SELECT * FROM HRPHUCLOI ORDER BY Ngay_Begin, Ngay_End");
            bdsPhucLoi.DataSource = dtPhucLoi;
            dgvPhucLoi.DataSource = bdsPhucLoi;

            //DANHGIA
            //dtDanhGia = DataTool.SQLGetDataTable("HRDANHGIA", null, strKey, "Ngay_DG");
            dtDanhGia             = SQLExec.ExecuteReturnDt("SELECT * FROM HRDANHGIA ORDER BY Ngay_DG");
            bdsDanhGia.DataSource = dtDanhGia;
            dgvDanhGia.DataSource = bdsDanhGia;

            //KINHNGHIEM
            //dtKinhNghiem = DataTool.SQLGetDataTable("HRKINHNGHIEM", null, strKey, "Ngay_Begin, Ngay_End");
            dtKinhNghiem             = SQLExec.ExecuteReturnDt("SELECT * FROM HRKINHNGHIEM ORDER BY Ngay_Begin, Ngay_End");
            bdsKinhNghiem.DataSource = dtKinhNghiem;
            dgvKinhNghiem.DataSource = bdsKinhNghiem;

            //KYNANG
            //dtKyNang = DataTool.SQLGetDataTable("HRKYNANG", null, strKey, "Ky_Nang");
            dtKyNang             = SQLExec.ExecuteReturnDt("SELECT * FROM HRKYNANG ORDER BY Ky_Nang");
            bdsKyNang.DataSource = dtKyNang;
            dgvKyNang.DataSource = bdsKyNang;

            //TUYENDUNG
            //dtTuyenDung = DataTool.SQLGetDataTable("HRTUYENDUNG", null, strKey, "Ngay_Pv");
            dtTuyenDung             = SQLExec.ExecuteReturnDt("SELECT * FROM HRTUYENDUNG ORDER BY Ngay_Pv");
            bdsTuyenDung.DataSource = dtTuyenDung;


            //DAOTAO
            dtLamViec             = DataTool.SQLGetDataTable("HRLAMVIEC", null, strKey, "Ngay_Begin, Ngay_End");
            bdsLamViec.DataSource = dtLamViec;
            dgvLamViec.DataSource = bdsLamViec;

            //DAOTAO
            dtQUALIFY             = DataTool.SQLGetDataTable("HRQUALIFY", null, strKey, "Ngay_Dat");
            bdsQUALIFY.DataSource = dtQUALIFY;
            dgvQUALIFY.DataSource = bdsQUALIFY;

            //Tham số các khoản thu nhập
            string strSQLExec =
                "SELECT T1.*, T2.Ten_Tn, T2.Dvt FROM HRPARAVALUE0 T1 LEFT JOIN HRPARALIST T2 ON T1.Ma_Tn = T2.Ma_Tn " +
                " ORDER BY Ngay_Ap";

            //Uy quyen cho lop co so tim kiem
            bdsSearch     = bdsEmployee;
            ExportControl = tlDmCbNv;

            tlDmCbNv.Expand = (bool)SQLExec.ExecuteReturnValue("SELECT Expand FROM SYSZONE WHERE ZONE = '" + tlDmCbNv.strZone + "'");
        }