public bool DataBind(string contractTypeId) { int id; if (!int.TryParse(contractTypeId, out id)) { return(SetViewUnable()); } Model.ContractType theDataToBind = _IContractTypeFacade.GetContractTypeByPKID(id); if (theDataToBind != null) { _ItsView.ContractTypeID = theDataToBind.ContractTypeID.ToString(); _ItsView.ContractTypeName = theDataToBind.ContractTypeName; return(true); } return(SetViewUnable()); }
public void UpdateEvent() { //数据验证过程 if (!new ContractTypeVaildater(_ItsView).Vaildate()) { return; } //数据收集过程 Model.ContractType theObject = _IContractTypeFacade.GetContractTypeByPKID(Convert.ToInt32(_ItsView.ContractTypeID)); new ContractTypeDataCollector(_ItsView).CompleteTheObject(theObject); //执行事务过程 try { _IContractTypeFacade.UpdateContractType(theObject); _ItsView.ActionSuccess = true; } catch (ApplicationException ae) { _ItsView.ResultMessage = ae.Message; } }