private void AddFaceTo() { int id = (int)ViewState["ID"]; List <string> PositionList, OrganizeCityList; GetListItem(out PositionList, out OrganizeCityList); if (PositionList != null) { PN_ToPositionBLL p_toPositionbll = new PN_ToPositionBLL(); foreach (string child in PositionList) { if (PN_ToPositionBLL.GetModelList(string.Format("NoticeID={0} AND Position={1}", id, child)).Count == 0) { p_toPositionbll.Model.NoticeID = id; p_toPositionbll.Model.Position = int.Parse(child); p_toPositionbll.Add(); } } } if (OrganizeCityList != null) { PN_ToOrganizeCityBLL p_toOrganizeCitybll = new PN_ToOrganizeCityBLL(); foreach (string child in OrganizeCityList) { if (PN_ToOrganizeCityBLL.GetModelList(string.Format("NoticeID={0} AND OrganizeCity={1}", id, child)).Count == 0) { p_toOrganizeCitybll.Model.NoticeID = id; p_toOrganizeCitybll.Model.OrganizeCity = int.Parse(child); p_toOrganizeCitybll.Add(); } } } }
private void UpdateFaceTo() { foreach (int id in PN_ToPositionBLL.GetPositionByNoticeID((int)ViewState["ID"])) { if (lb_PositionChild.Items.FindByValue(id.ToString()) == null) { PN_ToPositionBLL.DeletePosition((int)ViewState["ID"], id); } } foreach (int id in PN_ToOrganizeCityBLL.GetOrganizeCityByNoticeID((int)ViewState["ID"])) { if (lb_CityChild.Items.FindByValue(id.ToString()) == null) { PN_ToOrganizeCityBLL.DeleteOrganizeCity((int)ViewState["ID"], id); } } AddFaceTo(); }
private void BindData() { PN_NoticeBLL bll = new PN_NoticeBLL((int)ViewState["ID"]); UC_Notice.BindData(bll.Model); if (bll.Model["Catalog"] != "") { ViewState["Catalog"] = int.Parse(bll.Model["Catalog"]); } if (bll.Model.ApproveFlag == 1) { bt_Approve.Visible = false; bt_OK.Visible = false; bt_Clear1.Visible = false; bt_Detele1.Visible = false; bt_Insert1.Visible = false; bt_Clear2.Visible = false; bt_Detele2.Visible = false; bt_Insert2.Visible = false; bt_PreView.Visible = false; UploadFile1.CanDelete = false; UploadFile1.CanUpload = false; } tab_PNToPosition.Visible = bll.Model.ToAllStaff == "N"; tab_PNToOrganizeCity.Visible = bll.Model.ToAllOrganizeCity == "N"; UploadFile1.RelateID = (int)ViewState["ID"]; UploadFile1.BindGrid(); #region 显示所属职位,片区 if (tab_PNToPosition.Visible) { List <int> List = new List <int>(); List = PN_ToPositionBLL.GetPositionByNoticeID((int)ViewState["ID"]); lb_PositionChild.Items.Clear(); if (List != null) { foreach (int id in List) { Org_PositionBLL positionbll = new Org_PositionBLL(id); lb_PositionChild.Items.Add(new ListItem(positionbll.Model.Name, id.ToString())); } } } if (tab_PNToOrganizeCity.Visible) { List <int> List = new List <int>(); List = PN_ToOrganizeCityBLL.GetOrganizeCityByNoticeID((int)ViewState["ID"]); lb_CityChild.Items.Clear(); if (List != null) { foreach (int id in List) { Addr_OrganizeCityBLL organizeCitybll = new Addr_OrganizeCityBLL(id); lb_CityChild.Items.Add(new ListItem(organizeCitybll.Model.Name, id.ToString())); } } } #endregion ckedit_content.Text = bll.Model.Content; }
private void AddFaceTo() { int id = (int)ViewState["ID"]; List<string> PositionList, OrganizeCityList; GetListItem(out PositionList, out OrganizeCityList); if (PositionList != null) { PN_ToPositionBLL p_toPositionbll = new PN_ToPositionBLL(); foreach (string child in PositionList) { if (PN_ToPositionBLL.GetModelList(string.Format("NoticeID={0} AND Position={1}", id, child)).Count == 0) { p_toPositionbll.Model.NoticeID = id; p_toPositionbll.Model.Position = int.Parse(child); p_toPositionbll.Add(); } } } if (OrganizeCityList != null) { PN_ToOrganizeCityBLL p_toOrganizeCitybll = new PN_ToOrganizeCityBLL(); foreach (string child in OrganizeCityList) { if (PN_ToOrganizeCityBLL.GetModelList(string.Format("NoticeID={0} AND OrganizeCity={1}", id, child)).Count == 0) { p_toOrganizeCitybll.Model.NoticeID = id; p_toOrganizeCitybll.Model.OrganizeCity = int.Parse(child); p_toOrganizeCitybll.Add(); } } } }