public static void DeleteCard(CardProp cardProp) { using (IDbConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["cn"].ConnectionString)) { connection.Open(); connection.Execute("DeleteCard", new { Card_ID = cardProp.Card_ID }, commandType: CommandType.StoredProcedure); } }
public static void InsertCard(CardProp cardProp) { using (IDbConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["cn"].ConnectionString)) { connection.Open(); DynamicParameters dp = new DynamicParameters(); dp.AddDynamicParams(new { List_ID = cardProp.List_ID, Card_Name = cardProp.Card_Name, Card_Observing = cardProp.Card_Observing, Card_Position = cardProp.Card_Position, Card_Description = cardProp.Card_Description }); connection.Execute("InsertCard", dp, commandType: CommandType.StoredProcedure); } }
public CardForm(Data.CardProp _cardProp) { InitializeComponent(); cardProp = new Data.CardProp(); cardProp = _cardProp; }