protected void btnEdit_Click(object sender, EventArgs e) { SYCRM.Model.Position MF = new SYCRM.Model.Position(); SYCRM.BLL.Position BF = new SYCRM.BLL.Position(); { MF = BF.GetModel(new Guid(hfPid.Value.Trim())); MF.Name = tbEName.Text; BF.Update(MF); tbEName.Text = ""; hfPid.Value = ""; Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "修改成功!", "<script>alert('修改成功!');window.location.href=window.location.href</script>"); } }
protected void BtnDelete_Click(object sender, EventArgs e) { CheckBox cb; SYCRM.BLL.Position BF = new SYCRM.BLL.Position(); for (int i = 0; i < GridViewList.Rows.Count; i++) { cb = (CheckBox)GridViewList.Rows[i].FindControl("CBSelect"); if (cb.Checked) { try { SYCRM.Model.Position mf = BF.GetModel(new Guid(GridViewList.DataKeys[i].Value.ToString())); mf.status = 2; BF.Update(mf); } catch { } } } Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "职位成功删除!", "<script>alert('职位成功删除!');window.location.href=window.location.href</script>"); }
List<SYCRM.Model.Agent> handleAList(List<SYCRM.Model.Agent> listMA) { foreach (SYCRM.Model.Agent a in listMA) { SYCRM.Model.Area MArea = new SYCRM.Model.Area(); SYCRM.BLL.Area BArea = new SYCRM.BLL.Area(); MArea = BArea.GetModel(a.AreaId); if (MArea != null) { a.AreaName = MArea.Name; } else { a.AreaName = "区域已删除"; } SYCRM.Model.Position MPosition = new SYCRM.Model.Position(); SYCRM.BLL.Position BPosition = new SYCRM.BLL.Position(); MPosition = BPosition.GetModel(a.Position); if (MPosition != null) { a.PostName = MPosition.Name; } else { a.PostName = "职位已删除"; } } return listMA; }