/// <summary> /// 得到一个对象实体 /// </summary> public zlzw.Model.JobEnterpriseServiceContractModel DataRowToModel(DataRow row) { zlzw.Model.JobEnterpriseServiceContractModel model = new zlzw.Model.JobEnterpriseServiceContractModel(); if (row != null) { if (row["ServiceContractID"] != null && row["ServiceContractID"].ToString() != "") { model.ServiceContractID = int.Parse(row["ServiceContractID"].ToString()); } if (row["ServiceContractGuid"] != null && row["ServiceContractGuid"].ToString() != "") { model.ServiceContractGuid = new Guid(row["ServiceContractGuid"].ToString()); } if (row["EnterpriseServiceKey"] != null) { model.EnterpriseServiceKey = row["EnterpriseServiceKey"].ToString(); } if (row["ServiceContractStatus"] != null && row["ServiceContractStatus"].ToString() != "") { model.ServiceContractStatus = int.Parse(row["ServiceContractStatus"].ToString()); } if (row["EnterpriseKey"] != null) { model.EnterpriseKey = row["EnterpriseKey"].ToString(); } if (row["EnterpriseName"] != null) { model.EnterpriseName = row["EnterpriseName"].ToString(); } if (row["ServiceContractStartDate"] != null && row["ServiceContractStartDate"].ToString() != "") { model.ServiceContractStartDate = DateTime.Parse(row["ServiceContractStartDate"].ToString()); } if (row["ServiceContractEndDate"] != null && row["ServiceContractEndDate"].ToString() != "") { model.ServiceContractEndDate = DateTime.Parse(row["ServiceContractEndDate"].ToString()); } if (row["ServiceContractMemo"] != null) { model.ServiceContractMemo = row["ServiceContractMemo"].ToString(); } if (row["ServiceFee"] != null && row["ServiceFee"].ToString() != "") { model.ServiceFee = decimal.Parse(row["ServiceFee"].ToString()); } if (row["ServiceFeeIsPaid"] != null && row["ServiceFeeIsPaid"].ToString() != "") { model.ServiceFeeIsPaid = int.Parse(row["ServiceFeeIsPaid"].ToString()); } if (row["ServiceFeeManageUserName"] != null) { model.ServiceFeeManageUserName = row["ServiceFeeManageUserName"].ToString(); } if (row["ServiceFeeManageUserKey"] != null) { model.ServiceFeeManageUserKey = row["ServiceFeeManageUserKey"].ToString(); } if (row["CreateUserKey"] != null) { model.CreateUserKey = row["CreateUserKey"].ToString(); } if (row["CreateUserName"] != null) { model.CreateUserName = row["CreateUserName"].ToString(); } if (row["CreateDate"] != null && row["CreateDate"].ToString() != "") { model.CreateDate = DateTime.Parse(row["CreateDate"].ToString()); } if (row["CanUsable"] != null && row["CanUsable"].ToString() != "") { model.CanUsable = int.Parse(row["CanUsable"].ToString()); } if (row["PropertyNames"] != null) { model.PropertyNames = row["PropertyNames"].ToString(); } if (row["PropertyValues"] != null) { model.PropertyValues = row["PropertyValues"].ToString(); } } return model; }
/// <summary> /// 得到一个对象实体 /// </summary> public zlzw.Model.JobEnterpriseServiceContractModel GetModel(int ServiceContractID) { SqlParameter[] parameters = { new SqlParameter("@ServiceContractID", SqlDbType.Int,4) }; parameters[0].Value = ServiceContractID; zlzw.Model.JobEnterpriseServiceContractModel model = new zlzw.Model.JobEnterpriseServiceContractModel(); DataSet ds = DbHelperSQL.RunProcedure("JobEnterpriseServiceContract_GetModel", parameters, "ds"); if (ds.Tables[0].Rows.Count > 0) { return DataRowToModel(ds.Tables[0].Rows[0]); } else { return null; } }