public int EditPatner(Patner patner) { int rowAffected = 0; using (IDbConnection con = new SqlConnection(configuration.GetConnectionString("DefaultConnection"))) { if (con.State == ConnectionState.Closed) { con.Open(); } DynamicParameters parameters = new DynamicParameters(); parameters.Add("@BankId", patner.BankId); parameters.Add("@PatnerId", patner.PatnerId); rowAffected = con.Execute("UpdatePatnerBank", parameters, commandType: CommandType.StoredProcedure); } return(rowAffected); }
public Patner GetPatnerById(int?id) { Patner patner = new Patner(); if (id == null) { return(patner); } using (IDbConnection con = new SqlConnection(configuration.GetConnectionString("DefaultConnection"))) { if (con.State == ConnectionState.Closed) { con.Open(); } DynamicParameters parameter = new DynamicParameters(); parameter.Add("@Id", id); patner = con.Query <Patner>("GetPatnerBankByID", parameter, commandType: CommandType.StoredProcedure).FirstOrDefault(); } return(patner); }
public IActionResult Index(Patner patner) { return(View()); }