/// <summary> /// 수정 /// </summary> public SupportRegistration Update(SupportRegistration model) { var sql = @" Update SupportRegistrations SET [SupportSettingId] = @SupportSettingId ,[BoardName] = @BoardName ,[BoardNum] = @BoardNum ,[BoardTitle] = @BoardTitle ,[CreationDate] = @CreationDate ,[UserId] = @UserId ,[Username] = @Username ,[NickName] = @NickName ,[Name] = @Name ,[Mobile] = @Mobile ,[Company] = @Company ,[Homepage] = @Homepage ,[SupportDate] = @SupportDate ,[Recipient] = @Recipient ,[Product] = @Product Where BoardName = @BoardName And BoardNum = @BoardNum And Username = @Username"; db.Execute(sql, model); return(model); }
/// <summary> /// 입력 /// </summary> public SupportRegistration Add(SupportRegistration model) { var sql = @" INSERT INTO [dbo].[SupportRegistrations] ([SupportSettingId] ,[BoardName] ,[BoardNum] ,[BoardTitle] ,[CreationDate] ,[UserId] ,[Username] ,[NickName] ,[Name] ,[Mobile] ,[Company] ,[Homepage] ,[SupportDate] ,[Recipient] ,[Product]) VALUES (@SupportSettingId ,@BoardName ,@BoardNum ,@BoardTitle ,@CreationDate ,@UserId ,@Username ,@NickName ,@Name ,@Mobile ,@Company ,@Homepage ,@SupportDate ,@Recipient ,@Product); " + "Select Cast(SCOPE_IDENTITY() As Int);"; var id = db.Query <int>(sql, model).Single(); model.Id = id; return(model); }