public bool InsertCustomer(InsertCustomer entity, out string error) { error = ""; try { var paras = new SqlParameter[] { new SqlParameter("@CellPhone",SqlDbType.NVarChar,20), new SqlParameter("@CustomerName", SqlDbType.NVarChar,20), new SqlParameter("@CreateUser", SqlDbType.NVarChar,20), new SqlParameter("@NewRecomendCode", SqlDbType.NVarChar,50), new SqlParameter("@ErrorMsg", SqlDbType.NVarChar,100) }; paras[0].Value = entity.CellPhone; paras[1].Value = string.IsNullOrEmpty(entity.CustomerName) ? "" : entity.CustomerName; paras[2].Value = string.IsNullOrEmpty(entity.CreateUser) ? "sysSocketApi" : entity.CreateUser; paras[3].Value = string.IsNullOrEmpty(entity.NewRecomendCode) ? "" : entity.NewRecomendCode; paras[4].Direction = ParameterDirection.Output; //插入订单 var value = helper.ExecuteCommandProc("gsp_InsertCustomerInfo", paras); if (value >= 0) { return true; } else { error = paras[4] == null ? "" : paras[4].Value == null ? "" : paras[4].Value.ToString(); return false; } } catch (Exception ex) { error = ex.Message; LogControl.WriteError("InsertCustomer插入用户信息失败|Error:" + ex.Message); return false; } }
public static bool InsertCustomer(InsertCustomer entity, out string error) { return dal.InsertCustomer(entity,out error); }