/// <summary> /// 获取到合同服务并返回 /// </summary> private void GetContractService(HttpContext context) { var contractId = context.Request.QueryString["contract_id"]; if (!string.IsNullOrEmpty(contractId)) { var serList = new ctt_contract_service_dal().GetConSerList(long.Parse(contractId)); if (serList != null && serList.Count > 0) { var oppBLL = new OpportunityBLL(); StringBuilder resDepString = new StringBuilder(); var serviceList = serList.Where(_ => _.object_type == 1).ToList(); var serBagList = serList.Where(_ => _.object_type == 2).ToList(); if (serviceList != null && serviceList.Count > 0) { resDepString.Append("<option>--服务---</option>"); serviceList.ForEach(_ => { var name = oppBLL.ReturnServiceName(_.object_id); resDepString.Append($"<option value='{_.object_id}'>{name}</option>"); }); } if (serBagList != null && serBagList.Count > 0) { resDepString.Append("<option>--服务包---</option>"); serBagList.ForEach(_ => { var name = oppBLL.ReturnServiceName(_.object_id); resDepString.Append($"<option value='{_.object_id}'>{name}</option>"); }); } context.Response.Write(resDepString.ToString()); } } }
/// <summary> /// 根据合同Id获取相关信息,用横线隔开 /// </summary> public void GetSerList(HttpContext context, long contract_id) { var contract = new ctt_contract_dal().FindNoDeleteById(contract_id); if (contract != null) { var serviceList = new ctt_contract_service_dal().GetConSerList(contract.id); if (serviceList != null && serviceList.Count > 0) { StringBuilder services = new StringBuilder(); var oppBLL = new OpportunityBLL(); var serList = serviceList.Where(_ => _.object_type == 1).ToList(); var serBagList = serviceList.Where(_ => _.object_type == 2).ToList(); if (serList != null && serList.Count > 0) { foreach (var item in serList) { var name = oppBLL.ReturnServiceName(item.object_id); services.Append("<option value='" + item.id + "'>" + name + "</option>"); } if (serBagList != null && serBagList.Count > 0) { services.Append("<option>-------</option>"); } } if (serBagList != null && serBagList.Count > 0) { foreach (var item in serBagList) { var name = oppBLL.ReturnServiceName(item.object_id); services.Append("<option value='" + item.id + "'>" + name + "</option>"); } } context.Response.Write(services); } } }