/// <summary> /// 更新一条数据 /// </summary> public void Update(MobileSoft.Model.HSPR.Tb_HSPR_CommunityBuss model) { int rowsAffected; SqlParameter[] parameters = { new SqlParameter("@CommBussID", SqlDbType.NVarChar, 50), new SqlParameter("@BussName", SqlDbType.NVarChar, 200), new SqlParameter("@BussID", SqlDbType.BigInt, 8), new SqlParameter("@CommID", SqlDbType.BigInt, 8), new SqlParameter("@BussTypeName", SqlDbType.NVarChar, 50), new SqlParameter("@BussIndex", SqlDbType.Int, 4), new SqlParameter("@StartDate", SqlDbType.DateTime), new SqlParameter("@EndDate", SqlDbType.DateTime), new SqlParameter("@Memo", SqlDbType.NVarChar, 500), new SqlParameter("@BussType", SqlDbType.Int, 4), new SqlParameter("@IsDelete", SqlDbType.Int, 4) }; parameters[0].Value = model.CommBussID; parameters[1].Value = model.BussName; parameters[2].Value = model.BussID; parameters[3].Value = model.CommID; parameters[4].Value = model.BussTypeName; parameters[5].Value = model.BussIndex; parameters[6].Value = model.StartDate; parameters[7].Value = model.EndDate; parameters[8].Value = model.Memo; parameters[9].Value = model.BussType; parameters[10].Value = model.IsDelete; DbHelperSQL.RunProcedure("Proc_Tb_HSPR_CommunityBuss_Update", parameters, out rowsAffected); }
/// <summary> /// 得到一个对象实体 /// </summary> public MobileSoft.Model.HSPR.Tb_HSPR_CommunityBuss GetModel(string CommBussID) { SqlParameter[] parameters = { new SqlParameter("@CommBussID", SqlDbType.NVarChar, 50) }; parameters[0].Value = CommBussID; MobileSoft.Model.HSPR.Tb_HSPR_CommunityBuss model = new MobileSoft.Model.HSPR.Tb_HSPR_CommunityBuss(); DataSet ds = DbHelperSQL.RunProcedure("Proc_Tb_HSPR_CommunityBuss_GetModel", parameters, "ds"); if (ds.Tables[0].Rows.Count > 0) { model.CommBussID = ds.Tables[0].Rows[0]["CommBussID"].ToString(); model.BussName = ds.Tables[0].Rows[0]["BussName"].ToString(); if (ds.Tables[0].Rows[0]["BussID"].ToString() != "") { model.BussID = long.Parse(ds.Tables[0].Rows[0]["BussID"].ToString()); } if (ds.Tables[0].Rows[0]["CommID"].ToString() != "") { model.CommID = long.Parse(ds.Tables[0].Rows[0]["CommID"].ToString()); } model.BussTypeName = ds.Tables[0].Rows[0]["BussTypeName"].ToString(); if (ds.Tables[0].Rows[0]["BussIndex"].ToString() != "") { model.BussIndex = int.Parse(ds.Tables[0].Rows[0]["BussIndex"].ToString()); } if (ds.Tables[0].Rows[0]["StartDate"].ToString() != "") { model.StartDate = DateTime.Parse(ds.Tables[0].Rows[0]["StartDate"].ToString()); } if (ds.Tables[0].Rows[0]["EndDate"].ToString() != "") { model.EndDate = DateTime.Parse(ds.Tables[0].Rows[0]["EndDate"].ToString()); } model.Memo = ds.Tables[0].Rows[0]["Memo"].ToString(); if (ds.Tables[0].Rows[0]["BussType"].ToString() != "") { model.BussType = int.Parse(ds.Tables[0].Rows[0]["BussType"].ToString()); } if (ds.Tables[0].Rows[0]["IsDelete"].ToString() != "") { model.IsDelete = int.Parse(ds.Tables[0].Rows[0]["IsDelete"].ToString()); } return(model); } else { return(null); } }