예제 #1
0
        public IDictionary <string, object> BangGia_Group3Insert(Group3BangGiaDto input)
        {
            DataTable myTable = CreateTable();

            for (int i = 0; i < input.SoLuong; i++)
            {
                myTable.Rows.Add(input.Gia[i], input.ChuThau[i]);
            }
            SqlConnection connection = new SqlConnection("Data Source=DESKTOP-9BIR2H4;Initial Catalog=DbPratice;Integrated Security=True;");

            connection.Open();
            SqlCommand cmd = new SqlCommand("BangGia_Group3Insert", connection);

            cmd.CommandType = CommandType.StoredProcedure;

            //Pass table Valued parameter to Store Procedure
            SqlParameter sqlParam = cmd.Parameters.AddWithValue("@BangTam", myTable);

            sqlParam.SqlDbType = SqlDbType.Structured;
            cmd.ExecuteNonQuery();
            connection.Close();
            Console.Write("Data Save Successfully.");
            return(procedureHelper.GetData <dynamic>("BangGia_Group3Insert", input).FirstOrDefault());
        }
예제 #2
0
 public IDictionary <string, object> BangGia_Group3Insert([FromBody] Group3BangGiaDto input)
 {
     return(Group3BangGiaAppService.BangGia_Group3Insert(input));
 }