public string UpdateTypeState(UpdateTypeStateInPut inPut) { string strHtml = ""; var outPut = _mic_TypeAppservice.UpdateTypeState(inPut); if (outPut.state == 1) { if (inPut.status == "0") { strHtml = "<a href=\"javascript:ModifyColumnDisplayAttribute('" + inPut.Id + "', '1');\" style=\"color:Red;\" title=\"点击启用\">禁用</a>"; } else { strHtml = "<a href=\"javascript:ModifyColumnDisplayAttribute('" + inPut.Id + "', '0');\" style=\"color: #555555;\" title=\"点击禁用\">启用</a>"; } } return(strHtml); }
public UpdateTypeStateOutPut UpdateTypeState(UpdateTypeStateInPut inPut) { UpdateTypeStateOutPut outPut = new UpdateTypeStateOutPut(); outPut.state = 0; var model = _mic_TypeRepository.FirstOrDefault(inPut.Id); if (inPut.status == "0") { model.display = false; } else { model.display = true; } _mic_TypeRepository.Update(model); outPut.state = 1; return(outPut); }