/// <summary> /// 删除状态 /// </summary> /// <param name="en">状态</param> /// <returns></returns> public int delete(CustomerState en) { string strSql = "delete from CustomerState where id=@id"; SqlParameter[] param = new SqlParameter[] { new SqlParameter("@id", en.id) }; int result = SqlHelper.ExecuteNonQuery(BaseHelper.DBConnStr, CommandType.Text, strSql, param); return result; }
/// <summary> /// 添加状态 /// </summary> /// <param name="en">状态</param> /// <returns></returns> public int add(CustomerState en) { string strSql = "insert into CustomerState (state, memo) values (@state, @memo)"; SqlParameter[] param = new SqlParameter[] { new SqlParameter("@state", en.state), new SqlParameter("@memo", en.memo) }; int result = SqlHelper.ExecuteNonQuery(BaseHelper.DBConnStr, CommandType.Text, strSql, param); return result; }
/// <summary> /// 修改状态 /// </summary> /// <param name="en">状态</param> /// <returns></returns> public int update(CustomerState en) { string strSql = "update CustomerState set state=@state, memo=@memo where id=@id"; SqlParameter[] param = new SqlParameter[] { new SqlParameter("@id", en.id), new SqlParameter("@state", en.state), new SqlParameter("@memo", en.memo) }; int result = SqlHelper.ExecuteNonQuery(BaseHelper.DBConnStr, CommandType.Text, strSql, param); return result; }
/// <summary> /// 删除客户状态 /// </summary> /// <param name="id"></param> /// <returns></returns> public JsonResult CustomerState_remove(string id) { CustomerState en = new CustomerState(); en.id = Convert.ToInt32(id); DaCustomerState dal = new DaCustomerState(); var result = new CustomJsonResult(); result.Data = dal.delete(en); return result; }
public JsonResult CustomerState_edit(string id, string state, string memo) { CustomerState en = new CustomerState(); en.id = Convert.ToInt32(id); en.state = state; en.memo = memo; DaCustomerState dal = new DaCustomerState(); var result = new CustomJsonResult(); result.Data = dal.update(en); return result; }
public JsonResult CustomerState_add(string state, string memo) { CustomerState en = new CustomerState(); en.state = state; en.memo = memo; DaCustomerState dal = new DaCustomerState(); var result = new CustomJsonResult(); result.Data = dal.add(en); return result; }