private void LoadcmbSearch()
        {
            VNPT.Modules.Employees.EmployeesInfo emp = objEmployees.GetEmployeeByCode(this.UserInfo.Username);
            decimal UnitUser = 0;

            if (emp != null)
            {
                decimal EmpIdTimKiem = Convert.ToInt32(emp.unitid);// donvi user login
                if (objUnit.GetUnit(EmpIdTimKiem).parentid == 14)
                {
                    UnitUser = objUnit.GetUnit(EmpIdTimKiem).id;
                }
                else
                {
                    UnitUser = objUnit.GetUnit(objUnit.GetUnit(EmpIdTimKiem).parentid).id;
                }
                if (UserInfo.IsInRole("ToChucVTT")) // vien thong tinh
                {
                    cmbSearch.DataSource = SearchEmp(UnitUser, 0);
                    cmbSearch.DataBind();
                }
                else // don vị
                {
                    cmbSearch.DataSource = SearchEmp(UnitUser, 1);
                    cmbSearch.DataBind();
                }
            }// viễn thông tỉnh
        }
Exemple #2
0
        private void LoadThongTin(int empId)
        {
            this.employee = objEmployees.GetEmployees(empId);
            if (employee != null)
            {
                string gioiTinh      = employee.sex == true ? "Nam" : "Nữ";
                string danToc        = employee.nationalityid != 0 ? objNationlity.GetNationality(employee.nationalityid).name : "..........";
                string nguyenQuanNam = employee.nativeplace_provinceid != 0 ? objProvince.GetProvince(employee.nativeplace_provinceid).Name : "..........";
                string ngayCapCMND   = employee.dateofissue.Year != 1900 ? string.Format("{0:dd/MM/yyyy}", employee.dateofissue) : ".../.../....";
                string noiCapCMDN    = employee.provinceid != 0 ? objProvince.GetProvince(employee.provinceid).Name : "..........";
                // hop dong
                string soQD_HD = "", tuNgay_HD = "", denNgay_HD = "", loaiHD = "";
                string chucVu  = employee.positionid != 0 ? objPosition.GetPosition(employee.positionid).name : "..........";
                int    iddonvi = 0;
                unitInfo = objUnit.GetUnit(employee.unitid);
                string donVi = "";
                if (unitInfo != null)
                {
                    if (unitInfo.parentid == 305 || unitInfo.parentid == 14)
                    {
                        iddonvi = 14;
                    }
                    donVi = iddonvi == 14 ? unitInfo.name + " - " + unitInfo.name : unitInfo.name + " - " + objUnit.GetUnit(unitInfo.parentid).name;
                }


                if (objContract.GetContractsByEmployess(empId).Count > 0)
                {
                    soQD_HD   = objContract.GetContractsByEmployess(empId).OrderByDescending(o => o.datestart).ToList()[0].contractnum;
                    tuNgay_HD = "Ngày " + objContract.GetContractsByEmployess(empId).OrderByDescending(o => o.datestart).ToList()[0].datestart.Day +
                                " tháng " + objContract.GetContractsByEmployess(empId).OrderByDescending(o => o.datestart).ToList()[0].datestart.Month +
                                " năm " + objContract.GetContractsByEmployess(empId).OrderByDescending(o => o.datestart).ToList()[0].datestart.Year;
                    denNgay_HD = "Ngày " + objContract.GetContractsByEmployess(empId).OrderByDescending(o => o.datestart).ToList()[0].datestart.Day +
                                 " tháng " + objContract.GetContractsByEmployess(empId).OrderByDescending(o => o.datestart).ToList()[0].datestart.Month +
                                 " năm " + objContract.GetContractsByEmployess(empId).OrderByDescending(o => o.datestart).ToList()[0].datestart.Year;
                    loaiHD = objContract.GetContractsByEmployess(empId).OrderByDescending(o => o.datestart).ToList()[0].contracttype != 0 ? objLoaiHopDong.GetLaborContractType(objContract.GetContractsByEmployess(empId).OrderByDescending(o => o.datestart).ToList()[0].contracttype).name : "..........";
                }
                lbl_dong1.Text  = "1. Họ và tên: " + employee.fullname.Trim() + "; Giới tính: " + gioiTinh;
                lbl_dong2.Text  = "2. Ngày, tháng, năm sinh: " + string.Format("{0:dd/MM/yyyy}", employee.birthday) + "; Dân tộc: " + danToc + "; Quốc tịch: Việt Nam";
                lbl_dong3.Text  = "3. Nguyên quán: " + Xa(employee.nativeplace.ToString()) + " - " + Huyen(employee.nativeplace.ToString()) + " - " + nguyenQuanNam;
                lbl_dong4.Text  = "4. Nơi cư trú (nơi thường trú hoặc tạm trú): " + employee.placeofresidence;
                lbl_dong5.Text  = "5. Chứng minh thư số: " + employee.identitynum + "; Ngày cấp: " + ngayCapCMND + "; Nơi cấp: " + noiCapCMDN;
                lbl_dong6.Text  = "6. Hợp đồng lao động (hoặc hợp đồng làm việc) số: " + soQD_HD.Trim() + " " + tuNgay_HD + "; có hiệu lực " + denNgay_HD + "; Loại hợp đồng: " + loaiHD;
                lbl_dong7.Text  = "7. Chức vụ, chức danh nghề: " + chucVu;
                lbl_dong8.Text  = "8. Cơ quan, đơn vị: " + donVi;
                lbl_dong9.Text  = "9. Địa chỉ: " + employee.placeofresidence;
                lbl_dong10.Text = "10. Nơi đăng kí khám chữa bệnh ban đầu: " + employee.placetomedicalexam.Trim();
                lbl_dong11.Text = "11. Đối tượng hưởng BHYT mức:";
                lbl_dong12.Text = "12. Quá trình đóng, chưa hưởng BHXH một lần và BH thất nghiệp:";
            }
            var objWHist = objWorkHistory.GetWorkHistoryByEmployee(empId);

            if (objWHist.Count > 0)
            {
                gridThongKeDSBaoHiem.DataSource = GetTable(empId);
                gridThongKeDSBaoHiem.DataBind();
            }
        }
        protected void grdContract_ItemDatabound(object sender, DataGridItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                this.contract = e.Item.DataItem as VNPT.Modules.EmployeeContract.EmployeeContractInfo;
                Label lblStart = e.Item.FindControl("lblStart") as Label;
                if (lblStart != null)
                {
                    lblStart.Text = String.Format("{0:dd/MM/yyyy}", this.contract.datestart);
                }
                Label lblEnd = e.Item.FindControl("lblEnd") as Label;
                if (lblEnd != null)
                {
                    lblEnd.Text = String.Format("{0:dd/MM/yyyy}", this.contract.dateend);
                }

                ImageButton imgDelete = e.Item.FindControl("imgDelete") as ImageButton;
                if (imgDelete != null)
                {
                    imgDelete.Attributes.Add("onClick", "javascript:return confirm('Bạn có muốn xóa');");
                }
                //Label lblUnitName = e.Item.FindControl("lblUnitName") as Label;
                //if (lblUnitName != null)
                //{
                //    lblUnitName.Text =objUnit.GetUnit(this.contract.unitid).name;
                //}
                Label lblContractType = e.Item.FindControl("lblContractType") as Label;
                if (lblContractType != null)
                {
                    lblContractType.Text = objContracType.GetLaborContractType(this.contract.contracttype).name;
                }
                HyperLink hplName = e.Item.FindControl("hplName") as HyperLink;
                if (hplName != null)
                {
                    if (this.contract.employeeid != null)
                    {
                        VNPT.Modules.Employees.EmployeesInfo emp = objEmplyess.GetEmployees(Int32.Parse(this.contract.employeeid.ToString().Trim()));
                        if (emp != null)
                        {
                            hplName.Text = emp.fullname;
                        }
                    }
                }
            }
        }
        private void BindUnit()
        {
            //this.UserInfo.Username;
            VNPT.Modules.Employees.EmployeesInfo e = objEmplyess.GetEmployeeByCode(this.UserInfo.Username);
            if (e != null)
            {
                if (UserInfo.IsInRole("ToChucVTT"))
                {
                    this.ddlUnit.Items.Clear();
                    List <VNPT.Modules.Unit.UnitInfo> list = objUnit.GetParentUnits();
                    foreach (VNPT.Modules.Unit.UnitInfo u in list)
                    {
                        this.ddlUnit.Items.Add(new ListItem(u.name, u.id.ToString()));
                        List <VNPT.Modules.Unit.UnitInfo> listChild = objUnit.GetChildUnits(u.id);
                        foreach (VNPT.Modules.Unit.UnitInfo u1 in listChild)
                        {
                            this.ddlUnit.Items.Add(new ListItem(Server.HtmlDecode("&nbsp;&nbsp;&nbsp;") + u1.name, u1.id.ToString()));
                            List <VNPT.Modules.Unit.UnitInfo> listNextChild = objUnit.GetChildUnits(u1.id);
                            foreach (VNPT.Modules.Unit.UnitInfo u2 in listNextChild)
                            {
                                this.ddlUnit.Items.Add(new ListItem(Server.HtmlDecode("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;") + u2.name, u2.id.ToString()));
                            }
                        }
                    }
                }
                else
                {
                    this.ddlUnit.Items.Clear();
                    this.ddlUnit.Items.Add(new ListItem(objUnit.GetUnit(objUnit.GetUnit(e.unitid).parentid).name, objUnit.GetUnit(objUnit.GetUnit(e.unitid).parentid).id.ToString()));


                    List <VNPT.Modules.Unit.UnitInfo> listChild = objUnit.GetChildUnits(objUnit.GetUnit(objUnit.GetUnit(e.unitid).parentid).id);
                    foreach (VNPT.Modules.Unit.UnitInfo u1 in listChild)
                    {
                        this.ddlUnit.Items.Add(new ListItem(Server.HtmlDecode("&nbsp;&nbsp;&nbsp;") + u1.name, u1.id.ToString()));
                        List <VNPT.Modules.Unit.UnitInfo> listNextChild = objUnit.GetChildUnits(u1.id);
                        foreach (VNPT.Modules.Unit.UnitInfo u2 in listNextChild)
                        {
                            this.ddlUnit.Items.Add(new ListItem(Server.HtmlDecode("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;") + u2.name, u2.id.ToString()));
                        }
                    }
                }
            }
        }
Exemple #5
0
        private void ExcelTop(int empId)
        {
            this.employee = objEmployees.GetEmployees(empId);
            if (employee != null)
            {
                report.maSo     = "Mã số: " + employee.socialinsurancenum;
                report.hoTen    = employee.fullname.Trim();
                report.nam      = employee.sex == true ? "X" : "";
                report.nu       = employee.sex == true ? "" : "X";
                report.ngaySinh = string.Format("{0:dd/MM/yyyy}", employee.birthday);
                report.danToc   = employee.nationalityid != 0 ? objNationlity.GetNationality(employee.nationalityid).name : "..........";
                string nguyenQuanNam = employee.nativeplace_provinceid != 0 ? objProvince.GetProvince(employee.nativeplace_provinceid).Name : "..........";
                report.nguyenQuan = Xa(employee.nativeplace.ToString()) + " - " + Huyen(employee.nativeplace.ToString()) + " - " + nguyenQuanNam;
                report.soCMND     = employee.identitynum.ToString();

                report.ngayCap     = employee.dateofissue.Year != 1900 ? string.Format("{0:dd/MM/yyyy}", employee.dateofissue) : ".../.../....";
                report.noicap      = employee.provinceid != 0 ? objProvince.GetProvince(employee.provinceid).Name : "..........";
                report.noiCuTru    = employee.placeofresidence;
                report.diaChi      = employee.placeofresidence;;
                report.chucVu      = employee.positionid != 0 ? objPosition.GetPosition(employee.positionid).name : "..........";
                report.donVi       = employee.unitid != 0 ? objUnit.GetUnit(employee.unitid).name + " - " + objUnit.GetUnit(objUnit.GetUnit(employee.unitid).parentid).name : ".........";
                report.noiKhamBenh = employee.placetomedicalexam.Trim();
                // hop dong
                var ojbCT = objContract.GetContractsByEmployess(empId);
                if (ojbCT.Count > 0)
                {
                    report.soHopDong = ojbCT.OrderByDescending(o => o.datestart).ToList()[0].contractnum;
                    report.ngayHD1   = ojbCT.OrderByDescending(o => o.datestart).ToList()[0].datestart.Day.ToString();
                    report.thangHD1  = ojbCT.OrderByDescending(o => o.datestart).ToList()[0].datestart.Month.ToString();
                    report.namHD1    = ojbCT.OrderByDescending(o => o.datestart).ToList()[0].datestart.Year.ToString();
                    report.ngayHD2   = ojbCT.OrderByDescending(o => o.datestart).ToList()[0].datestart.Day.ToString();
                    report.thangHD2  = ojbCT.OrderByDescending(o => o.datestart).ToList()[0].datestart.Month.ToString();
                    report.namHD2    = ojbCT.OrderByDescending(o => o.datestart).ToList()[0].datestart.Year.ToString();
                    report.loaiHD    = ojbCT.OrderByDescending(o => o.datestart).ToList()[0].contracttype != 0 ? objLoaiHopDong.GetLaborContractType(objContract.GetContractsByEmployess(empId).OrderByDescending(o => o.datestart).ToList()[0].contracttype).name : "..........";
                }
            }
        }