protected void btnAdd_Click(object sender, EventArgs e) { SYCRM.Model.Position MF = new SYCRM.Model.Position(); SYCRM.BLL.Position BF = new SYCRM.BLL.Position(); { MF.Name = tbName.Text; MF.status = 1; BF.Add(MF); tbName.Text = ""; Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "添加成功!", "<script>alert('添加成功!');window.location.href=window.location.href</script>"); } }
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>"); }
void bindddl(SYCRM.Model.Agent manauser) { DDLLayer.DataSource = GetOwnArea(manauser.AreaId); DDLLayer.DataBind(); SYCRM.BLL.Position BP = new SYCRM.BLL.Position(); string strWhere = " status=1 "; List<SYCRM.Model.Position> listPost = BP.GetModelList(strWhere); ddlPost.DataSource = listPost; ddlPost.DataBind(); }
private void BindData() { List<SYCRM.Model.Position> listMP = new List<SYCRM.Model.Position>(); SYCRM.BLL.Position BP = new SYCRM.BLL.Position(); string strWhere = " status=1 "; if (!tb_KeyWords.Text.Trim().Equals("")) { strWhere += " and [Name] like '%" + tb_KeyWords.Text.Trim() + "%'"; } listMP = BP.GetModelList(strWhere); GridViewList.DataSource = listMP; GridViewList.DataBind(); }
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; }