protected void grdEmployees_ItemDatabound(object sender, DataGridItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { this.employees = e.Item.DataItem as EmployeesInfo; Unit.UnitController objUnit = new Unit.UnitController(); ImageButton imgDelete = e.Item.FindControl("imgDelete") as ImageButton; Label lblPosition = e.Item.FindControl("lblPosition") as Label; Label lblParentUnit = e.Item.FindControl("lblParentUnit") as Label; Label lblCurrentUnit = e.Item.FindControl("lblCurrentUnit") as Label; if (imgDelete != null) { imgDelete.Attributes.Add("onClick", "javascript:return confirm('Bạn có muốn xóa');"); } //if (lblPosition != null) //{ // Position.PositionController objPosition = new Position.PositionController(); // lblPosition.Text = objPosition.GetPosition(this.employees.positionid).name; //} if (lblParentUnit != null) { lblParentUnit.Text = objUnit.GetUnit(objUnit.GetUnit(this.employees.unitid).parentid).name; } if (lblCurrentUnit != null) { lblCurrentUnit.Text = objUnit.GetUnit(this.employees.unitid).name; } } }
protected void ASPxCallbackPanel1_Callback(object source, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e) { string id = e.Parameter.ToString(); if (id.Contains("e")) { int ItemId = Int32.Parse(id.Substring(1)); Session["Id"] = ItemId; try { this.employees = objEmployees.GetEmployees(ItemId); if (this.employees != null) { this.grdLeave.Visible = true; BindGridLeave(ItemId); this.grdLeave.Caption = "Thông tin nghỉ phép đồng chí " + this.employees.fullname; Session["Visible"] = true; } } catch (Exception ex) { } } else { this.grdLeave.Visible = false; Session["Visible"] = false; } }
protected void cboUnit_Load(object sender, System.EventArgs e) { ASPxComboBox cboUnit = grid.FindEditFormTemplateControl("cboUnit") as ASPxComboBox; VNPT.Modules.Employees.EmployeesInfo em = objEmployees.GetEmployeeByCode(this.UserInfo.Username); if (em != null) { if (UserInfo.IsInRole("ToChucVTT")) // vien thong tinh { cboUnit.Items.Clear(); List <VNPT.Modules.Unit.UnitInfo> list = objUnit.GetParentUnits(); foreach (VNPT.Modules.Unit.UnitInfo u in list) { cboUnit.Items.Add(new ListEditItem(u.name, u.id.ToString())); List <VNPT.Modules.Unit.UnitInfo> listChild = objUnit.GetChildUnits(u.id); foreach (VNPT.Modules.Unit.UnitInfo u1 in listChild) { cboUnit.Items.Add(new ListEditItem(Server.HtmlDecode(" ") + u1.name, u1.id.ToString())); //cboUnit.Items.Add(new ListItem(Server.HtmlDecode(" ") + u1.name, u1.id.ToString())); List <VNPT.Modules.Unit.UnitInfo> listNextChild = objUnit.GetChildUnits(u1.id); foreach (VNPT.Modules.Unit.UnitInfo u2 in listNextChild) { cboUnit.Items.Add(new ListEditItem(Server.HtmlDecode(" ") + u2.name, u2.id.ToString())); } } } // cmbDonVi.SelectedIndex = 0; } else { cboUnit.Items.Clear(); cboUnit.Items.Add(new ListEditItem(objUnit.GetUnit(objUnit.GetUnit(em.unitid).parentid).name, objUnit.GetUnit(objUnit.GetUnit(em.unitid).parentid).id.ToString())); List <VNPT.Modules.Unit.UnitInfo> listChild = objUnit.GetChildUnits(objUnit.GetUnit(objUnit.GetUnit(em.unitid).parentid).id); foreach (VNPT.Modules.Unit.UnitInfo u1 in listChild) { cboUnit.Items.Add(new ListEditItem(Server.HtmlDecode(" ") + u1.name, u1.id.ToString())); List <VNPT.Modules.Unit.UnitInfo> listNextChild = objUnit.GetChildUnits(u1.id); foreach (VNPT.Modules.Unit.UnitInfo u2 in listNextChild) { cboUnit.Items.Add(new ListEditItem(Server.HtmlDecode(" ") + u2.name, u2.id.ToString())); } } //cmbDonVi.SelectedIndex = 0; } } if (GetText("uid") != null && GetText("uid").Trim() != "") { ListEditItem item = cboUnit.Items.FindByValue((object)GetText("uid")); if (item != null) { item.Selected = true; } else { cboUnit.SelectedIndex = 0; } } }
private string LoadCanhBao() { string sb = ""; string strConn = getConnectionString(); SqlConnection Cnn = new SqlConnection(strConn); SqlCommand Cmd; SqlCommand Cmd2; Cnn.Open(); VNPT.Modules.Employees.EmployeesInfo emp = objEmployees.GetEmployeeByCode(this.UserInfo.Username); string url = DotNetNuke.Common.Globals.ApplicationPath; string urlCTV = DotNetNuke.Common.Globals.ApplicationPath + "/HSCongTacVien/QTCongTacVien/tabid/273/Default.aspx"; if (emp != null) { int Nunitid = objUnit.GetUnit(emp.unitid).parentid; if (UserInfo.IsInRole("ToChucVTT")) // vien thong tinh { Cmd = new SqlCommand("HRM_Get_NhanVienChoCapMa", Cnn); Cmd.CommandType = CommandType.StoredProcedure; SqlParameter unitid = Cmd.Parameters.Add("@idUnit", SqlDbType.Int, 20); unitid.Value = 0; int nRecord = Convert.ToInt32(Cmd.ExecuteScalar()); int UnitId = objUnit.GetUnit(emp.unitid).parentid; Cmd2 = new SqlCommand("select COUNT(id) from hrm.dbo.CTV_CTV where TrangThai=1 and MaCTV=''", Cnn); int nRecordCTV = Convert.ToInt32(Cmd2.ExecuteScalar()); if (nRecord > 0) { sb = "<a href='" + url + "/hoso/AddEmployee/tabid/179/Default.aspx" + "'>Có " + nRecord + " nhân viên đang chờ cấp mã</a>"; } if (nRecord > 0 && nRecordCTV > 0) { sb += "</br>"; } if (nRecordCTV > 0) { sb += "<a href='" + urlCTV + "" + "'>Có " + nRecordCTV + " cộng tác viên đang chờ cấp mã</a>"; } Cmd.Dispose(); Cmd2.Dispose(); } else { Cmd = new SqlCommand("HRM_Get_NhanVienChoCapMa", Cnn); Cmd.CommandType = CommandType.StoredProcedure; SqlParameter unitid = Cmd.Parameters.Add("@idUnit", SqlDbType.Int, 20); unitid.Value = Nunitid; int nRecord = Convert.ToInt32(Cmd.ExecuteScalar()); if (nRecord > 0) { sb = "<a href='" + url + "/nhanvien/kyhopdong/tabid/154/Default.aspx" + "'>Có " + nRecord + " nhân viên chờ ký hợp đồng</a>"; } Cmd.Dispose(); } } Cnn.Close(); return(sb); }
protected void treeList_VirtualModeCreateChildren(object sender, TreeListVirtualModeCreateChildrenEventArgs e) { VNPT.Modules.Employees.EmployeesInfo emp = objEmployees.GetEmployeeByCode(this.UserInfo.Username); if (emp != null) { if (UserInfo.IsInRole("ToChucVTT")) // vien thong tinh { DataView dv = new DataView(GetTable()); //DataView dv = new DataView(GetChild(), "id=4", "sequence", DataViewRowState.CurrentRows); DataView children = null; DataRowView parent = e.NodeObject as DataRowView; if (parent == null) { children = dv; e.Children = children; } else { string id = parent["id"].ToString(); DataView dv1 = new DataView(CreateTreeList(id)); if (dv1.Count > 0) { children = dv1; e.Children = children; } } } else { DataView children = null; DataRowView parent = e.NodeObject as DataRowView; DataView dv = new DataView(GetTable_DonViCon(), "parentid=" + objUnit.GetUnit(emp.unitid).parentid + "", "Name", DataViewRowState.CurrentRows); if (parent == null) { children = dv; e.Children = children; } else { string id = parent["id"].ToString(); DataView dv1 = new DataView(CreateTreeList(id)); if (dv1.Count > 0) { children = dv1; e.Children = children; } } } } }
protected void ASPxCallbackPanel21_Callback(object source, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e) { ASPxHiddenField ASPxHiddenField1 = grid.FindEditFormTemplateControl("ASPxCallbackPanel21").FindControl("ASPxHiddenField1") as ASPxHiddenField; string id = e.Parameter.ToString(); this.employees = objEmployees.GetEmployees(Int32.Parse(id)); if (this.employees != null) { ASPxHiddenField1["value"] = this.employees.id; } }
public void GioiTinh(int idnv) { this.employees = objEmployees.GetEmployees(idnv); thaisan.InnerHtml = "<ul class=\"tabs\">"; thaisan.InnerHtml += "<li class=''><a href=\"#tab1\">Nghỉ phép</a></li>"; thaisan.InnerHtml += "<li class=''><a href=\"#tab2\">Nghỉ không lương</a></li>"; if (this.employees.sex == false) { thaisan.InnerHtml += "<li class=''><a href=\"#tab3\">Nghỉ thai sản</a></li>"; } thaisan.InnerHtml += "</ul>"; }
protected void grdEmployees_ItemCommand(object source, DataGridCommandEventArgs e) { int id = Int32.Parse(e.CommandArgument.ToString()); if (e.CommandName == "Delete") { this.employees = objEmployees.GetEmployees(id); objEmployees.DeleteEmployees(employees); this.grdEmployees.DataSource = objEmployees.GetEmployeess(); this.grdEmployees.DataBind(); } }
private void BindEmployee(int IdEmp) { this.employees = objEmployees.GetEmployees(IdEmp); hiddenIdEmp.Value = IdEmp.ToString(); lbl_TenNV.Text = employees.fullname.ToString(); lbl_maNV.Text = employees.empcode.Trim(); lbl_DonViHienTai.Text = objUnit.GetUnit(employees.unitid).name.ToString() + " -> " + objUnit.GetUnit(objUnit.GetUnit(employees.unitid).parentid).name; lbl_NgaySinh.Text = employees.birthday.Year != 1900 ? string.Format("{0:dd/MM/yyyy}", employees.birthday) : ""; lbl_NoiSinh.Text = employees.placeofbirth.ToString(); int idchucvu = objHistory.GetWorkHistoryByEmployee(IdEmp).Count > 0 ? objHistory.GetWorkHistoryByEmployee(IdEmp).OrderByDescending(whe => whe.desiciondate).ToList()[0].positionid : 155; lbl_ChucVu.Text = idchucvu == 0 ? objPosition.GetPosition(155).name : objPosition.GetPosition(idchucvu).name;; }
protected void ddlType_Load(object sender, System.EventArgs e) { ASPxComboBox ddlType = grdLeave.FindEditFormTemplateControl("ddlType") as ASPxComboBox; ddlType.Items.Clear(); VNPT.Modules.Employees.EmployeesInfo emp = objEmployees.GetEmployees(Int32.Parse(Session["Id"].ToString())); if (emp != null) { if (emp.sex == true) { ddlType.Items.Add(new ListEditItem("Nghỉ phép", "0")); } else { ddlType.Items.Add(new ListEditItem("Nghỉ phép", "0")); ddlType.Items.Add(new ListEditItem("Nghỉ sinh", "1")); } } if (GetLeaveText("leavetype") != null && GetLeaveText("leavetype").Trim() != "") { if (emp.sex == false) { if (Convert.ToBoolean(GetLeaveText("leavetype")) == false) { ddlType.SelectedIndex = 0; } else { ddlType.SelectedIndex = 1; } } else { ddlType.SelectedIndex = 0; } } else { ddlType.SelectedIndex = 0; } }
void CreateNodes() { VNPT.Modules.Employees.EmployeesInfo emp = objEmployees.GetEmployeeByCode(this.UserInfo.Username); if (emp != null) { if (UserInfo.IsInRole("ToChucVTT")) // vien thong tinh { List <VNPT.Modules.Unit.UnitInfo> list = objUnit.GetParentUnits(); foreach (VNPT.Modules.Unit.UnitInfo u in list) { string k1 = "u" + u.id; TreeListNode root = CreateNodeRoot(k1, "frontpage", "<font size='2' face='Tahoma'><b> " + u.name + "</b></font>"); root.Expanded = true; List <VNPT.Modules.Unit.UnitInfo> listChild = objUnit.GetChildUnits(u.id); foreach (VNPT.Modules.Unit.UnitInfo u1 in listChild) { string k2 = "u" + u1.id; TreeListNode root1 = CreateNodeCore(k2, "home", "<font size='2' face='Tahoma'><b> " + u1.name + "</b></font>", root, ""); } } } else { VNPT.Modules.Unit.UnitInfo u = objUnit.GetUnit(objUnit.GetUnit(emp.unitid).parentid); string k1 = "u" + u.id; TreeListNode root = CreateNodeRoot(k1, "frontpage", "<font size='2' face='Tahoma'><b> " + u.name + "</b></font>"); root.Expanded = true; List <VNPT.Modules.Unit.UnitInfo> listChild = objUnit.GetChildUnits(u.id); foreach (VNPT.Modules.Unit.UnitInfo u1 in listChild) { string k2 = "u" + u1.id; TreeListNode root1 = CreateNodeCore(k2, "home", "<font size='2' face='Tahoma'><b> " + u1.name + "</b></font>", root, ""); } } } treeList.SettingsBehavior.AllowFocusedNode = true; }
private void BindEmployee(int IdEmp) { this.employees = objEmployees.GetEmployees(IdEmp); hiddenIdEmp.Value = IdEmp.ToString(); lbl_maNV.Text = employees.empcode.Trim(); lbl_TenNV.Text = employees.fullname.ToString(); lbl_DonViHienTai.Text = objUnit.GetUnit(employees.unitid).name.ToString() + " -> " + objUnit.GetUnit(objUnit.GetUnit(employees.unitid).parentid).name; lbl_NgaySinh.Text = employees.birthday.Year != 1900 ? string.Format("{0:dd/MM/yyyy}", employees.birthday) : ""; lbl_NoiSinh.Text = employees.placeofbirth.ToString(); int idchucvu = objHistory.GetWorkHistoryByEmployee(IdEmp).Count > 0 ? objHistory.GetWorkHistoryByEmployee(IdEmp).OrderByDescending(whe => whe.desiciondate).ToList()[0].positionid : 155; lbl_ChucVu.Text = idchucvu == 0 ? objPosition.GetPosition(155).name : objPosition.GetPosition(idchucvu).name; if (objChangeSalary.GetChangeSalaryByEmployee(IdEmp).Count > 0) { lbl_bacLuong.Text = objChangeSalary.GetChangeSalaryByEmployee(Convert.ToInt32(IdEmp)).OrderByDescending(s => s.id).ToList()[0].salarylevel.IndexOf("/") != -1 ? objChangeSalary.GetChangeSalaryByEmployee(Convert.ToInt32(IdEmp)).OrderByDescending(s => s.id).ToList()[0].salarylevel : objChangeSalary.GetChangeSalaryByEmployee(Convert.ToInt32(IdEmp)).OrderByDescending(s => s.id).ToList()[0].salarylevel + "/" + Tenbacluong(objChangeSalary.GetChangeSalaryByEmployee(Convert.ToInt32(IdEmp)).OrderByDescending(s => s.id).ToList()[0].classid, false, objChangeSalary.GetChangeSalaryByEmployee(Convert.ToInt32(IdEmp)).OrderByDescending(s => s.id).ToList()[0].changedate); lbl_heSo.Text = objChangeSalary.GetChangeSalaryByEmployee(IdEmp).OrderByDescending(o => o.id).ToList()[0].salarycoefficient; } if (objLeave.GetLeaveByEmp(IdEmp).Count > 0) { lbl_phepNam.Text = objLeave.GetLeaveByEmp(IdEmp).ToList()[0].fromdate.Year == DateTime.Now.Year ? "Đã nghỉ" : "Chưa nghỉ"; } }
public abstract void DeleteEmployees(EmployeesInfo objEmployees);
public void DeleteEmployees(EmployeesInfo objEmployees) { DataProvider.Instance().DeleteEmployees(objEmployees); }
public void AddEmployees(EmployeesInfo objEmployees) { DataProvider.Instance().AddEmployees(objEmployees); }
public abstract void UpdateEmployees(EmployeesInfo objEmployees);
public abstract void AddEmployees(EmployeesInfo objEmployees);
public override void DeleteEmployees(EmployeesInfo objEmployees) { SqlHelper.ExecuteNonQuery(ConnectionString, GetFullyQualifiedName("HRM_Employees"), objEmployees.id, objEmployees.fullname, objEmployees.othername, objEmployees.specialname, objEmployees.empcode, objEmployees.unitid, objEmployees.birthday, objEmployees.sex, objEmployees.image, objEmployees.placeofbirth, objEmployees.place_provinceid, objEmployees.nativeplace, objEmployees.nativeplace_provinceid, objEmployees.provinceid, objEmployees.nationalityid, objEmployees.religionid, objEmployees.identitynum, objEmployees.dateofissue, objEmployees.placeofissue, objEmployees.cellphone, objEmployees.officephone, objEmployees.email, objEmployees.taxcode, objEmployees.forte, objEmployees.hobby, objEmployees.placeofresidence, objEmployees.placeofcurrent, objEmployees.height, objEmployees.weigh, objEmployees.bloodgroupid, objEmployees.culturalid, objEmployees.qualificationid, objEmployees.politicalconsciousnessid, objEmployees.statemanagementid, objEmployees.positionid, objEmployees.socialinsurancenum, objEmployees.healthinsurancenum, objEmployees.placetomedicalexam, objEmployees.soldiertypeid, objEmployees.socialwelfaretypeid, objEmployees.retiredate, objEmployees.startdate, objEmployees.prevunit, objEmployees.prevwork, objEmployees.note, objEmployees.mainjob, objEmployees.honourable, objEmployees.workabroad, objEmployees.goabroad, objEmployees.economy, objEmployees.family, objEmployees.daterecruit, objEmployees.asalaryid, objEmployees.bsalaryid, objEmployees.professionid, objEmployees.isactive, objEmployees.familytypeid, objEmployees.familytype_currentid, objEmployees.employeetypeid, objEmployees.workeviroment, objEmployees.datesocialinsurance, objEmployees.languageid, objEmployees.itid, objEmployees.healthid, objEmployees.partyplace, objEmployees.partydate, objEmployees.youthplace, objEmployees.youthdate, objEmployees.allowance, objEmployees.countryid, objEmployees.occupation, objEmployees.officeid, objEmployees.unitrecruit, objEmployees.partyposition, objEmployees.comunityposition, objEmployees.DVYeuCau, objEmployees.idHinhThucDaoTao, objEmployees.idLoaiHopDong, objEmployees.NgayKetNapDang, objEmployees.NgayChinhThuc, objEmployees.NoiKetNapDang, objEmployees.DangBoKetNap, objEmployees.ChiBoKetNap, objEmployees.SoThe, objEmployees.NgayCap, objEmployees.nguoiGioiThieuVaoDang, objEmployees.DBDangSinhHoat, objEmployees.CBDangSinhHoat, objEmployees.isoms, objEmployees.Passport, objEmployees.PassportDate, objEmployees.PassPortIssue, objEmployees.NgayNhapNgu, objEmployees.NgayXuatNgu, objEmployees.QuanHamCaoNhat, 2); }
private string DiaDanhDonVi() { decimal idDonvi = 0; string donvi = ""; VNPT.Modules.Employees.EmployeesInfo emp = objEmployees.GetEmployeeByCode(this.UserInfo.Username); if (emp != null) { decimal idUnit = emp.unitid; if (objUnit.GetUnit(idUnit).parentid == 14)// cap trung tam { idDonvi = idUnit; } else // cap to { idDonvi = objUnit.GetUnit(objUnit.GetUnit(idUnit).parentid).id; } switch (Convert.ToInt32(idDonvi)) { case 305: { donvi = "Tp Buôn Ma Thuột"; break; } case 115: { donvi = "Tp Buôn Ma Thuột"; break; } case 116: { donvi = "Tp Buôn Ma Thuột"; break; } case 288: { donvi = "Tp Buôn Ma Thuột"; break; } case 114: { donvi = "Tp Buôn Ma Thuột"; break; } case 105: { donvi = "Tp Buôn Ma Thuột"; break; } case 106: { donvi = "Tp Buôn Ma Thuột"; break; } case 107: { donvi = "Tp Buôn Ma Thuột"; break; } default: { donvi = objUnit.GetUnit(idDonvi).name.Replace("Trung tâm Viễn thông", ""); break; } } } return(donvi); }
public void UpdateEmployees(EmployeesInfo objEmployees) { DataProvider.Instance().UpdateEmployees(objEmployees); }