public GenericResponse <CustomerContract> CustomerDelete(CustomerRequest request) { DbOperation dbOperation = new DbOperation(); SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@CustomerId", request.DataContract.CustomerId), }; try { var response = dbOperation.SpExecute("CUS.del_DeleteCustomerbyId", parameters); return(new GenericResponse <CustomerContract>() { IsSuccess = true }); } catch (Exception) { return(new GenericResponse <CustomerContract>() { IsSuccess = false, ErrorMessage = "CustomerDelete isteği başarısız." }); } }
public GenericResponse <CustomerEmailContract> EmailAdd(CustomerEmailContract emailContract) { DbOperation dbOperation = new DbOperation(); SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@CustomerId", emailContract.CustomerId), new SqlParameter("@EmailType", emailContract.EmailType), new SqlParameter("@MailAdress", emailContract.MailAdress) }; try { int id = Convert.ToInt32(dbOperation.SpExecute("CUS.ins_AddNewCustomerEmail", parameters)); return(new GenericResponse <CustomerEmailContract>() { IsSuccess = true, Value = new CustomerEmailContract() { CustomerMailId = id } }); } catch (Exception) { return(new GenericResponse <CustomerEmailContract>() { IsSuccess = false, ErrorMessage = "CustomerEmailAdd isteği başarısız." }); } }
public GenericResponse <CustomerPhoneContract> PhoneAdd(CustomerPhoneContract phoneContract) { DbOperation dbOperation = new DbOperation(); SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@CustomerId", phoneContract.CustomerId), new SqlParameter("@PhoneNumber", phoneContract.PhoneNumber), new SqlParameter("@PhoneType", phoneContract.PhoneType) }; try { int id = Convert.ToInt32(dbOperation.SpExecute("CUS.ins_AddNewCustomerPhone", parameters)); return(new GenericResponse <CustomerPhoneContract>() { IsSuccess = true, Value = new CustomerPhoneContract() { CustomerPhoneId = id } }); } catch (Exception) { return(new GenericResponse <CustomerPhoneContract>() { IsSuccess = false, ErrorMessage = "CustomerPhoneAdd isteği başarısız." }); } }