/// /// 添加一条活动信息 /// /// /// public int ChannelActiveAdd(BioErpCrmChannelActivity active) { SqlParameter[] pars = new SqlParameter[]{ new SqlParameter("@ChannelID",active.ChannelID), new SqlParameter("@ActiveName",active.ActiveName), new SqlParameter("@ActivityTime",active.ActivityTime), new SqlParameter("@ActivityAddress",active.ActivityAddress), new SqlParameter("@Principal",active.Principal), new SqlParameter("@ActivityDesc",active.ActivityDesc), }; return DAL.DataBaseHelper.ExcuteSqlReturnInt("BioErpCrmChannelActivity_ADD",CommandType.StoredProcedure,pars); } /// /// 修改一条活动信息 /// /// /// public int ChannelActiveUpdate(BioErpCrmChannelActivity active) { SqlParameter[] pars = new SqlParameter[]{ new SqlParameter("@ActivityID",active.ActivityID), new SqlParameter("@ChannelID",active.ChannelID), new SqlParameter("@ActiveName",active.ActiveName), new SqlParameter("@ActivityTime",active.ActivityTime), new SqlParameter("@ActivityAddress",active.ActivityAddress), new SqlParameter("@Principal",active.Principal), new SqlParameter("@ActivityDesc",active.ActivityDesc), }; return DAL.DataBaseHelper.ExcuteSqlReturnInt("BioErpCrmChannelActivity_Update", CommandType.StoredProcedure, pars); } /// /// 根据活动编号返回活动的视图对象 /// /// id /// ViewCRMChannelActivity public ViewCRMChannelActivity getViewActiveityByActivityID(string id) { SqlDataReader reader= SqlComm.GetDataReaderByCondition("View_CRMChannelActivity", "*", " id=" + id); ViewCRMChannelActivity active = null; while (reader.Read()) { active = new ViewCRMChannelActivity() { ActiveName = reader["ActiveName"].ToString(), ActivityAddress = reader["ActivityAddress"].ToString(), ActivityDesc = reader["ActivityDesc"].ToString(), ActivityID =int.Parse( reader["ActivityID"].ToString()), ActivityTime = Convert.ToDateTime(reader["ActivityTime"].ToString()), ChannelID = int.Parse(reader["ChannelID"].ToString()), ChannelName = reader["ChannelName"].ToString(), DeleteState =Convert.ToBoolean( reader["DeleteState"].ToString()), Principal = reader["Principal"].ToString() }; } reader.Close(); return active; }