public static int AddCustomerAddress(AddressDetails address) { using (SqlConnection con = new SqlConnection(connString, credentials)) { try { int retVal = -1; Dictionary <string, object> inParams = new Dictionary <string, object> { { "@CustomerId", address.CustomerId }, { "@Road", address.Road }, { "@Number", address.Number }, { "@City", address.City }, { "@PostalCode", address.PostalCode }, { "@Region", address.Region }, { "@state", address.State }, { "@Country", address.Country } }; Dictionary <string, object> outParams = new Dictionary <string, object> { { "@NewId", -1 } }; con.Open(); retVal = (int)DBActions.ExecNonReaderWithReturnSP(con, "addCustomerAddress", inParams, outParams); return(retVal); } catch (Exception ex) { MessageBox.Show(ex.Message); return(-1); } finally { con.Close(); } } }
public AddressVM() { addressDetails = new AddressDetails(); }