/// <summary> /// 选择主要负责人的会员处理 /// </summary> internal void YesSelectMainHandle(int contactid) { if (!string.IsNullOrEmpty(YesMainIDs)) { string[] memberids = YesMainIDs.Split(','); foreach (string memberid in memberids) { //取消原有的负责人 DataTable dt = BLL.ProjectTask_MemberContactMapping.Instance.GetList("CC_MCM.MemberID='" + memberid + "' AND CC_MCM.IsMain = 1"); if (dt != null && dt.Rows.Count > 0) { Entities.ProjectTask_MemberContactMapping mapping = BLL.ProjectTask_MemberContactMapping.Instance.GetModel(Convert.ToInt32(dt.Rows[0]["RecID"])); if (mapping != null) { mapping.IsMain = 0; BLL.ProjectTask_MemberContactMapping.Instance.UpdateMemberContactMapping(mapping); } } //设置新的负责人 Entities.ProjectTask_MemberContactMapping model = BLL.ProjectTask_MemberContactMapping.Instance.GetModel(memberid, contactid); if (model != null) { model.IsMain = 1; BLL.ProjectTask_MemberContactMapping.Instance.UpdateMemberContactMapping(model); } } } }
/// <summary> /// 选择主要负责人的会员处理 /// </summary> private void YesSelectMainHandle(int contactid) { if (!string.IsNullOrEmpty(YesMainIDs)) { string[] memberids = YesMainIDs.Split(','); foreach (string memberid in memberids) { //取消原有的负责人 DataTable dt = BitAuto.YanFa.Crm2009.BLL.MemberContactMapping.Instance.GetList("MCM.MemberID='" + memberid + "' AND MCM.IsMain = 1"); if (dt != null && dt.Rows.Count > 0) { MemberContactMapping mapping = BitAuto.YanFa.Crm2009.BLL.MemberContactMapping.Instance.GetModel(Convert.ToInt32(dt.Rows[0]["RecID"])); if (mapping != null) { mapping.IsMain = 0; BitAuto.YanFa.Crm2009.BLL.MemberContactMapping.Instance.UpdateMemberContactMapping(mapping); } } //设置新的负责人 MemberContactMapping model = BitAuto.YanFa.Crm2009.BLL.MemberContactMapping.Instance.GetModel(memberid, contactid); if (model != null) { model.IsMain = 1; BitAuto.YanFa.Crm2009.BLL.MemberContactMapping.Instance.UpdateMemberContactMapping(model); } } } }