/// <summary> /// 获取客户类型 /// </summary> /// <param name="CustomerTypeId">客户类型Id</param> /// <returns>客户类型实体</returns> public virtual EyouSoft.Model.PoolStructure.CustomerTypeInfo GetCustomerType(int CustomerTypeId) { EyouSoft.Model.PoolStructure.CustomerTypeInfo model = new EyouSoft.Model.PoolStructure.CustomerTypeInfo(); if (CustomerTypeId <= 0) { return(model); } string strSql = Sql_CustomerType_Select + " where ID = @ID ;"; DbCommand dc = this._db.GetSqlStringCommand(strSql); this._db.AddInParameter(dc, "ID", DbType.Int32, CustomerTypeId); using (IDataReader dr = EyouSoft.Common.DAL.DbHelper.ExecuteReader(dc, this._db)) { if (dr.Read()) { if (!dr.IsDBNull(dr.GetOrdinal("ID"))) { model.TypeId = int.Parse(dr["ID"].ToString()); } model.TypeName = dr["TypeName"].ToString(); } } return(model); }
/// <summary> /// 修改客户类型 /// </summary> /// <param name="model">客户类型实体</param> /// <returns>1:成功;0:失败</returns> public int UpdateCustomerType(EyouSoft.Model.PoolStructure.CustomerTypeInfo model) { if (model == null || model.TypeId <= 0) { return(0); } return(dal.UpdateCustomerType(model)); }
/// <summary> /// 新增客户类型 /// </summary> /// <param name="model">客户类型实体</param> /// <returns>1:成功;0:失败</returns> public int AddCustomerType(EyouSoft.Model.PoolStructure.CustomerTypeInfo model) { if (model == null) { return(0); } return(dal.AddCustomerType(model)); }
/// <summary> /// 新增客户类型 /// </summary> /// <param name="model">客户类型实体</param> /// <returns>1:成功;0:失败</returns> public virtual int AddCustomerType(EyouSoft.Model.PoolStructure.CustomerTypeInfo model) { if (model == null) { return(0); } DbCommand dc = this._db.GetSqlStringCommand(Sql_CustomerType_Insert); this._db.AddInParameter(dc, "TypeName", DbType.String, model.TypeName); return(EyouSoft.Common.DAL.DbHelper.ExecuteSql(dc, this._db) > 0 ? 1 : 0); }
private void Add(string CustomerName) { //新增 string strErr = ""; if (CustomerName == "") { strErr += "客户类型名称不能为空!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } EyouSoft.Model.PoolStructure.CustomerTypeInfo ModelType = new EyouSoft.Model.PoolStructure.CustomerTypeInfo(); ModelType.TypeName = CustomerName; EyouSoft.BLL.PoolStructure.CustomerType.CreateInstance().AddCustomerType(ModelType); return; }
private void Eidt(string EidtID, string CustomerName) { string strErr = ""; if (CustomerName == "") { strErr += "客户类型名称不能为空!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } EyouSoft.Model.PoolStructure.CustomerTypeInfo ModelType = new EyouSoft.Model.PoolStructure.CustomerTypeInfo(); ModelType.TypeName = CustomerName; ModelType.TypeId = EyouSoft.Common.Utils.GetInt(EidtID); EyouSoft.BLL.PoolStructure.CustomerType.CreateInstance().UpdateCustomerType(ModelType); return; }
/// <summary> /// 获取客户类型 /// </summary> /// <returns>客户类型实体集合</returns> public virtual IList <EyouSoft.Model.PoolStructure.CustomerTypeInfo> GetCustomerTypeList() { IList <EyouSoft.Model.PoolStructure.CustomerTypeInfo> list = new List <EyouSoft.Model.PoolStructure.CustomerTypeInfo>(); DbCommand dc = this._db.GetSqlStringCommand(Sql_CustomerType_Select); using (IDataReader dr = EyouSoft.Common.DAL.DbHelper.ExecuteReader(dc, this._db)) { EyouSoft.Model.PoolStructure.CustomerTypeInfo model = null; while (dr.Read()) { model = new EyouSoft.Model.PoolStructure.CustomerTypeInfo(); if (!dr.IsDBNull(dr.GetOrdinal("ID"))) { model.TypeId = int.Parse(dr["ID"].ToString()); } model.TypeName = dr["TypeName"].ToString(); list.Add(model); } } return(list); }