public void ViewPositionsForRecruitmentManager() { var mockUserContext = GetMockContext("tester", false, true); var positions = PositionBLL.GetByStatusAndDepartment(Closed, AdminAccepted, AllowApplications, null, null, mockUserContext.Object); Assert.IsNotNull(positions); Assert.AreEqual(8, positions.Count); foreach (var position in positions) { //Make sure each position contains either the AANS unit or CHEM unit var hasProperUnit = false; foreach (var department in position.Departments) { if (department.DepartmentFIS == "APLS" || department.DepartmentFIS == "CHEM") { hasProperUnit = true; } } Assert.IsTrue(hasProperUnit, string.Format("Position {0} doesn't have APLS or CHEM", position.ID)); } }
private List <SyndicationItem> CreateFeedItems() { string departmentFis = Request.QueryString["DepartmentFIS"]; string schoolCode = Request.QueryString["SchoolCode"]; var positions = PositionBLL.GetByStatusAndDepartment(false, true, true, departmentFis, schoolCode).Take(MaxItemsInFeed); List <SyndicationItem> feedItems = new List <SyndicationItem>(); foreach (var position in positions) { var positionUrl = new Uri(GetFullyQualifiedUrl("/PositionDetails.aspx") + "?PositionID=" + position.ID.ToString()); SyndicationItem item = new SyndicationItem(); item.Title = TextSyndicationContent.CreatePlaintextContent(position.PositionTitle); item.Links.Add(SyndicationLink.CreateAlternateLink(positionUrl)); item.Summary = TextSyndicationContent.CreatePlaintextContent(position.ShortDescription); item.PublishDate = position.DatePosted; feedItems.Add(item); } return(feedItems); }
public ActionResult GetEmployee() { try { int pageIndex = Convert.ToInt32(Request.QueryString["page"]); int pageSize = Convert.ToInt32(Request.QueryString["limit"]); string branchIds = Request.QueryString["id"]; string[] _ids = branchIds.Split(','); int[] ids = Array.ConvertAll <string, int>(_ids, id => { return(int.Parse(id)); }); EmployeeBLL eBll = new EmployeeBLL(); int rows = 0; int totalPages = 0; List <Employee> list = eBll.LoadPagedEntitys(pageIndex, pageSize, out rows, out totalPages, t => ids.Contains(t.branchId), true, t => t.Id); if (list != null && list.Count > 0) { List <Branch> branchList = new BranchBLL().GetEntitys(); list.ForEach(t => { branchList.ForEach(y => { if (t.branchId == y.Id) { t.branchName = y.branchName; } }); }); List <Role> roleList = new RoleBLL().GetEntitys(); list.ForEach(t => { roleList.ForEach(y => { if (t.roleId == y.Id) { t.roleName = y.roleName; } }); }); List <Position> positionList = new PositionBLL().GetEntitys(); list.ForEach(t => { positionList.ForEach(y => { if (t.positionId == y.Id) { t.positionName = y.positionName; } }); }); } string resJson = Common.Common.JsonSerialize(list); resJson = "{total:" + rows + ",root:" + resJson + "}"; return(Content(resJson)); } catch { } return(Content("{}")); }
/// <summary> /// Set Grid Data source /// </summary> /// <param name="addRow"></param> /// <param name="deleteRow"></param>e private void BindGrid(bool addRow, bool deleteRow) { PositionBLL PositionBLLobj = new PositionBLL(); grdPosition.DataSource = PositionBLLobj.GetAllPositions(); grdPosition.DataBind(); }
public ActionResult SavePosition(Position entity) { ResponseEntity <int> response; if (entity.Id == 0) { entity.AddTime = DateTime.Now; entity.IsDelete = 0; entity.CreateBy = ""; entity.CreateTime = DateTime.Now; entity.UpdateBy = ""; entity.UpdateTime = DateTime.Now; var result = new PositionBLL().InsertPosition(entity); response = new ResponseEntity <int>(result.Success, result.Message, result.Data); new LogBLL().LogEvent(CurrenUserInfo.LoginName, GDS.Entity.Constant.ConstantDefine.ModuleBaseData, GDS.Entity.Constant.ConstantDefine.TypeAdd, GDS.Entity.Constant.ConstantDefine.ActionSavePosition, $"{result.Data}"); } else { entity.UpdateBy = ""; entity.UpdateTime = DateTime.Now; var result = new PositionBLL().UpdatePosition(entity); response = new ResponseEntity <int>(result.Success, result.Message, result.Data); new LogBLL().LogEvent(CurrenUserInfo.LoginName, GDS.Entity.Constant.ConstantDefine.ModuleBaseData, GDS.Entity.Constant.ConstantDefine.TypeUpdate, GDS.Entity.Constant.ConstantDefine.ActionUpdatePosition, $"{entity.Id}"); } return(Json(response, JsonRequestBehavior.AllowGet)); }
public MainForm() { InitializeComponent(); _employee = new Employee(); _employeeBLL = new EmployeeBLL(); _positionBLL = new PositionBLL(); }
/// <summary> /// Set edit mode for edit comand /// Delete data from the database for delete comand /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void grdPosition_RowCommand(object sender, GridViewCommandEventArgs e) { string message = string.Empty; if (e.CommandName == "EditRow") { ViewState["PositionID"] = e.CommandArgument; GetPositionByID(); SetUpdateMode(true); ScriptManager.RegisterStartupScript(this, this.GetType(), "Added", "setDirty();", true); } else if (e.CommandName == "DeleteRow") { PositionBLL PositionBLLobj = new PositionBLL(); message = PositionBLLobj.DeletePosition(Convert.ToInt32(e.CommandArgument)); if (string.IsNullOrEmpty(message) || message == "" || message == "null") { message = "Data Deleted successfully"; } Clear(); SetUpdateMode(false); BindGrid(false, true); } if (message != "") { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Added", "alert('" + message + "');", true); } }
/// <summary> /// 保存位置信息 /// </summary> /// <param name="obj"></param> private long SaveGpsInfo(GPSInfo obj, TB_Equipment equipment, string terminal, string type) { //if (!obj.Available) return -1; using (var bll = new PositionBLL()) { TB_Data_Position pos = bll.GetObject(); pos.Altitude = obj.Altitude; pos.Direction = obj.Direction; pos.Equipment = null == equipment ? (int?)null : equipment.id; pos.EW = obj.EW[0]; pos.GpsTime = obj.GPSTime; pos.Latitude = obj.Latitude; pos.Longitude = obj.Longitude; pos.NS = obj.NS[0]; pos.ReceiveTime = DateTime.Now; pos.Speed = obj.Speed; pos.StoreTimes = null == equipment ? 0 : equipment.StoreTimes; pos.Terminal = terminal; pos.Type = type; pos = bll.Add(pos); // 更新定位信息 ShowUnhandledMessage("position: " + pos.id); return(pos.id); } //HandleGpsAddress(pos); }
//获取和显示所有座位 private void GetAndBindPositions() { PositionBLL pbll = new PositionBLL(); var lstPositions = pbll.GetAllPosition(); this.FillPositions(lstPositions); }
protected void btn_Add_Click(object sender, EventArgs e) { if (txt_Name.Text.Trim() == "系统管理员") { UtilityService.Alert(this.Page, "该名称是非法名,请换一个职位名称!"); return; } Position p = new Position(); p.PosiName = txt_Name.Text.Trim(); p.FatherCode = ddl_Father.SelectedValue.ToString(); p.OrganID = (int)Session["OrganID"]; p.InputBy = Session["UserID"].ToString(); bool re = new PositionBLL().Add(p); if (re) { UtilityService.AlertAndRedirect(this, "添加成功!", "PositionMgr.aspx"); } else { UtilityService.Alert(this, "添加失败!"); } }
public override void LoadData() { base.LoadData(); //Add some applications Profile profile = ProfileBLL.GetByID(StaticProperties.ExistingProfileID); Application application = new Application(); application.AppliedPosition = PositionBLL.GetByID(StaticProperties.ExistingPositionID); application.AssociatedProfile = profile; application.Email = StaticProperties.ExistingApplicantEmail; application.LastUpdated = DateTime.Now; profile.Applications = new List <Application> { application }; using (var ts = new TransactionScope()) { ApplicationBLL.EnsurePersistent(application); ProfileBLL.EnsurePersistent(profile); ts.CommitTransaction(); } }
protected void btn_Delete_Click(object sender, ImageClickEventArgs e) { string idList = string.Empty; foreach (GridViewRow dr in GridView1.Rows) { CheckBox chk = (CheckBox)dr.FindControl("chk"); if (chk != null && chk.Checked) { string _id = "'" + dr.Cells[1].Text.Trim() + "'"; string _name = dr.Cells[2].Text.Trim(); if (_name == "系统管理员") { UtilityService.Alert(this.Page, "禁止删除系统管理员"); return; } idList += _id + ","; } } if (idList.Length > 0) { idList = idList.TrimEnd(','); bool re = new PositionBLL().DeleteList(idList); if (re) { UtilityService.AlertAndRedirect(this.Page, "删除成功!", "PositionMgr.aspx"); } else { UtilityService.Alert(this.Page, "删除失败!"); } } }
/// <summary> /// Update Database Make data as Obsoluted /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void IsObsolete_CheckedChanged(Object sender, EventArgs e) { string message = string.Empty; try { PositionBLL PositionBLLobj = new PositionBLL(); CheckBox chk = (CheckBox)sender; GridViewRow gr = (GridViewRow)chk.Parent.Parent; string positionID = ((Literal)gr.FindControl("litPositionID")).Text; message = PositionBLLobj.ObsoletePosition(Convert.ToInt32(positionID), Convert.ToString(chk.Checked)); if (string.IsNullOrEmpty(message) || message == "" || message == "null") { message = "Data updated successfully"; } Clear(); SetUpdateMode(false); BindGrid(false, true); if (message != "") { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Added", "alert('" + message + "');", true); } } catch (Exception ex) { throw ex; } }
protected void btnSearchPlanReplace_Click(object sender, EventArgs e) { Position position = currentPosition; File searchPlan = FileBLL.SavePDF(fileSearchPlanReplace, SearchPlanFileType); if (searchPlan != null) { //Delete the old file FileBLL.DeletePDF(position.SearchPlanFile); //Save the new reference using (var ts = new TransactionScope()) { position.SearchPlanFile = searchPlan; PositionBLL.EnsurePersistent(position); ts.CommitTransaction(); } } else { lblInvalidSearchPlanFileType.Text = " *Job Description Must Be a PDF File"; } }
public ActionResult Save() { Position position = new Position(); try { string stated = Request.Form["stated"]; position.Id = Convert.ToInt32(Request.Form["Id"]); position.positionName = Request.Form["positionName"]; PositionBLL pBll = new PositionBLL(); if (stated == "add") { if (pBll.AddEntity(position)) { return(Content("{'success':'ok'}")); } } else if (stated == "update") { if (pBll.ModifyEntity(position)) { return(Content("{'success':'ok'}")); } } } catch { } return(Content("{}")); }
public void CanViewPositionsFilteredBySchool() { string schoolCode = "02"; var positions = PositionBLL.GetByStatusAndDepartment(Closed, AdminAccepted, AllowApplications, null, schoolCode); //controller.ViewPositions("School", schoolCode) as ViewResult; Assert.IsNotNull(positions); Assert.AreEqual(4, positions.Count); foreach (var position in positions) { bool hasSchool = false; foreach (var dept in position.Departments) { var unit = UnitBLL.GetByID(dept.DepartmentFIS); if (unit.SchoolCode == schoolCode) { hasSchool = true; } } Assert.IsTrue(hasSchool, string.Format("Position {0} is not in school {1}", position.ID, schoolCode)); } }
/// <summary> /// Close the position and upload the final recruitment report /// </summary> protected void ClosePosition(object sender, EventArgs e) { Position position = CurrentPosition; File finalRecruitmentReport = FileBLL.SavePDF(fileFinalRecruitmentReport, FinalRecruitmentReportFileType); if (finalRecruitmentReport != null) { //Delete the old file if (position.FinalRecruitmentReportFile != null) { FileBLL.DeletePDF(position.FinalRecruitmentReportFile); } //Save the new reference using (var ts = new TransactionScope()) { position.FinalRecruitmentReportFile = finalRecruitmentReport; position.Closed = true; PositionBLL.EnsurePersistent(position); ts.CommitTransaction(); } Response.Redirect("ClosePositionSuccess.aspx"); } else { lblFileError.Text = "Uploaded File Must Be In PDF Format"; } }
/// <summary> /// 处理定期报告信息 /// </summary> /// <param name="obj"></param> /// <param name="equipment"></param> /// <param name="terminal"></param> private void Handle0x1001(TX300 obj, TB_Equipment equipment, TB_Terminal terminal) { _0x1001 x1001 = new _0x1001(); x1001.Content = obj.MsgContent; x1001.Unpackage(); HandleEquipmentRuntime(equipment, x1001.WorkTime); if (null != equipment) { using (var bll = new EquipmentBLL()) { bll.Update(f => f.id == equipment.id, act => { act.Signal = (x1001.CSQ_1 > 0 && x1001.CSQ_1 <= 31) ? x1001.CSQ_1 : ((x1001.CSQ_2 > 0 && x1001.CSQ_2 <= 31) ? x1001.CSQ_2 : byte.MinValue); // 去掉 0x1001 里面的运转时间更新 //if (x1001.WorkTime > 0) //{ act.AccumulativeRuntime = equipment.AccumulativeRuntime; act.Runtime = equipment.Runtime; //} // 更新0x1001里的定位信息 2015/09/09 23:29 if (x1001.Available_2) { act.Latitude = x1001.Latitude_2; act.Longitude = x1001.Longitude_2; } else if (x1001.Available_1) { act.Latitude = x1001.Latitude_1; act.Longitude = x1001.Longitude_1; } }); } } using (var posbll = new PositionBLL()) { var pos = GetGpsinfoFrom1001(x1001, true); if ((pos.Longitude > 0 && pos.Longitude < 180) && (pos.Latitude > 0 && pos.Latitude < 90)) { pos.Equipment = null == equipment ? (int?)null : equipment.id; pos.Terminal = obj.TerminalID; pos.StoreTimes = null == equipment ? 0 : equipment.StoreTimes; pos.Type = "Period report" + GetPackageType(obj.ProtocolType); posbll.Add(pos); } pos = GetGpsinfoFrom1001(x1001, false); if ((pos.Longitude > 0 && pos.Longitude < 180) && (pos.Latitude > 0 && pos.Latitude < 90)) { pos.Equipment = null == equipment ? (int?)null : equipment.id; pos.Terminal = obj.TerminalID; pos.StoreTimes = null == equipment ? 0 : equipment.StoreTimes; pos.Type = "Period report" + GetPackageType(obj.ProtocolType); posbll.Add(pos); } } }
protected void btnAddMember_Click(object sender, EventArgs e) { //Create the new department member DepartmentMember member = new DepartmentMember(); member.DepartmentFIS = STR_FRAC; member.FirstName = txtFName.Text; member.LastName = txtLName.Text; member.OtherDepartmentName = string.IsNullOrEmpty(txtDepartment.Text) ? "Other" : txtDepartment.Text; member.LoginID = txtLoginID.Text.ToLower().Trim(); //Create the membership object CommitteeMember committeeAccess = new CommitteeMember(); committeeAccess.AssociatedPosition = currentPosition; committeeAccess.DepartmentMember = member; switch (dlistMemberType.SelectedValue) { case "Committee": committeeAccess.MemberType = MemberTypeBLL.GetByID((int)MemberTypes.CommitteeMember); break; case "Faculty": committeeAccess.MemberType = MemberTypeBLL.GetByID((int)MemberTypes.FacultyMember); break; case "Review": committeeAccess.MemberType = MemberTypeBLL.GetByID((int)MemberTypes.Reviewer); break; } //save the department member and add to the position committee for this position using (var ts = new TransactionScope()) { DepartmentMemberBLL.EnsurePersistent(member); committeeAccess.DepartmentMember = member; currentPosition.CommitteeMembers.Add(committeeAccess); Position position = currentPosition; PositionBLL.EnsurePersistent(position); ts.CommitTransaction(); } //Display an update successful message lblCommitteeUpdated.Text = "Committee Membership Successfully Updated"; //rebind the datagrid this.bindMembers(); this.ShowUpdateAcessRegion(); }
private string AddPosition(string name, int organID, string fatherName) { if (name == "0" || name == string.Empty) { return(""); } PositionBLL pBLL = new PositionBLL(); bool _re = pBLL.Exists(name, organID); if (!_re) { string _fatherCode = pBLL.GetPosiCode(fatherName, organID); if (string.IsNullOrEmpty(_fatherCode)) { _fatherCode = "0"; } Position p = new Position(); p.PosiName = name; p.FatherCode = _fatherCode; p.OrganID = organID; p.InputBy = Session["UserID"].ToString(); bool re = pBLL.Add(p); if (re) { //添加数据组 string _groupName = name + "数据组"; try { ObjectGroup r = new ObjectGroup(); r.Name = _groupName; r.TypeCode = "T0001"; r.OrganID = organID; r.InputBy = Session["UserID"].ToString(); int reOG = new ObjectGroupBLL().Add(r); if (reOG > 0) { string _groupCode = new ObjectGroupBLL().GetObjectGroupCode(_groupName, organID); string _pCode = pBLL.GetPosiCode(name, organID); List <string> ogList = new List <string>(); ogList.Add(_groupCode); int reP2O = new PositionBLL().AddPosi2ObjectGroup(_pCode, ogList); } } catch { } } } string _Code = pBLL.GetPosiCode(name, organID); return(_Code); }
public ProjectAddForm() { InitializeComponent(); customerBLL = new CustomerBLL(); _projectBLL = new ProjectBLL(); project = new Project(); _employeeBLL = new EmployeeBLL(); _positionBLL = new PositionBLL(); _peBLL = new ProjectEmployeeBLL(); }
private void FrmPositionList_Load(object sender, EventArgs e) { positionList = PositionBLL.GetPosition(); dataGridView1.DataSource = positionList; dataGridView1.Columns[1].Visible = false; dataGridView1.Columns[4].Visible = false; dataGridView1.Columns[2].Visible = false; dataGridView1.Columns[0].HeaderText = "Department Name"; dataGridView1.Columns[3].HeaderText = "Position Name"; }
private void btnNew_Click(object sender, EventArgs e) { FrmPosition frm = new FrmPosition(); this.Hide(); frm.ShowDialog(); this.Visible = true; positionList = PositionBLL.GetPosition(); dataGridView1.DataSource = positionList; }
public ActionResult DeletePosition(int Id) { var result = new PositionBLL().DeleteDataById(Id); var response = new ResponseEntity <int>(result.Success, result.Message, result.Data); new LogBLL().LogEvent(CurrenUserInfo.LoginName, GDS.Entity.Constant.ConstantDefine.ModuleBaseData, GDS.Entity.Constant.ConstantDefine.TypeDelete, GDS.Entity.Constant.ConstantDefine.ActionDeletePosition, $"{Id}"); return(Json(response, JsonRequestBehavior.AllowGet)); }
public EmployeeAddForm() { InitializeComponent(); _posBLL = new PositionBLL(); _empList = new EmployeeListForm(); employeeBLL = new EmployeeBLL(); employee = new Employee(); }
/// <summary> /// 职位列表 /// </summary> private void GetPositionList() { PositionTO to = new PositionTO(); if (!string.IsNullOrEmpty(Request.Form["PositName"])) { to.Name = pName = Request.Form["PositName"]; } string orderBy = ""; if (!string.IsNullOrEmpty(Request.Form["hidPosit"])) { pageIndex = Convert.ToInt32(Request.Form["hidPosit"]); } else { if (!string.IsNullOrEmpty(Request.QueryString["pageIndex"])) { pageIndex = Convert.ToInt32(Request.QueryString["pageIndex"]); } } DataTable dt = new PositionBLL().GetPositionList(to, pageIndex, pageSize, orderBy, out rowCount); StringBuilder sb = new StringBuilder(); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { DataRow dr = dt.Rows[i]; if (i % 2 == 0) { sb.Append("<tr bgcolor=\"#f8f8f8\">"); } else { sb.Append("<tr>"); } sb.AppendFormat("<td height=\"40\" align=\"center\"><span class=\"line\" style=\"COLOR: #666;\">{0}</span></td>", i + 1); sb.AppendFormat("<td><span class=\"line cl_sp\" style=\"COLOR: #666;\">{0}</span><span class=\"line cl_inp\" style=\"COLOR: #666;display:none;\"><input type=\"text\" value=\"{0}\" style=\"width:120px;\"/></span></td>", dr["Name"]); sb.AppendFormat("<td><span class=\"bottom cl_block\"><a style=\"color:#3B96D3;\" href=\"javascript:void(0)\" onclick=\"UpdatePosit({0})\">修改</a>   <a style=\"color:#3B96D3;\" onclick=\"delPosition('{1}')\" href=\"javascript:void(0)\">删除</a></span> <span class=\"bottom cl_none\" style=\"display:none;\"><a style=\"color:#3B96D3;\" href=\"javascript:void(0)\" onclick=\"SavePosit({0},'{1}')\">保存</a>   <a style=\"color:#3B96D3;\" href=\"javascript:void(0)\" onclick=\"CanclePosit({0})\">取消</a></span> </td></tr>", i, dr["ID"]); } } else { sb.Append("<tr bgcolor=\"#f8f8f8\"><td colspan=\"10\"><span class=\"line\">没有相关信息!</span></td></tr>"); } positList = sb.ToString(); string url = "PositionList.aspx?pageIndex={0}"; if (!string.IsNullOrEmpty(pName)) { url += "&PositName=" + pName; } PageList = DivPage.Pager(pageSize, rowCount, pageIndex, url); }
/// <summary> /// After databound, find out if we should show the send emails button /// </summary> protected void lviewApplications_DataBound(object sender, EventArgs e) { bool applicationsExist = lviewApplications.Items.Count > 0; pnlApplicationsExist.Visible = applicationsExist; if (applicationsExist) { txtBccAddress.Text = PositionBLL.GetByID(int.Parse(dlistApplicants.SelectedValue)).HREmail; } }
private void btnDelete_Click(object sender, EventArgs e) { DialogResult result = MessageBox.Show("Are you sure?", "Warning", MessageBoxButtons.YesNo); if (result == DialogResult.Yes) { PositionBLL.DeletePosition(detail.ID); MessageBox.Show("Position was deleted"); FillGrid(); } }
private void btnDelete_Click(object sender, EventArgs e) { DialogResult result = MessageBox.Show("Are you sure?", "Warning", MessageBoxButtons.YesNo); if (result == DialogResult.Yes) { PositionBLL.DeletePosition(detail.ID); } MessageBox.Show("Position was deleted"); positionList = PositionBLL.GetPosition(); dataGridView1.DataSource = positionList; }
public void LoadService() { string code = Request.QueryString["Code"].ToString(); Position _p = new PositionBLL().GetModel(code); if (_p != null) { lab_Code.Text = _p.PosiCode; txt_Name.Text = _p.PosiName; ddl_Father.SelectedValue = _p.FatherCode; } }