Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
 public IActionResult Index(Patner patner)
 {
     return(View());
 }