public void Insert(VotingProjectionInfo votingProjectionInfo) { String query = "INSERT INTO [dbo].[VotingProjection] " + "([ClientID] " + ",[EventID] " + ",[CreditorID] " + ",[QuestionID] " + ",[Decision] " + ",[CreditType] " + ",[CreateUser] " + ",[CreateDate] " + ",[LastModifiedUser] " + ",[LastModifiedDate] ) " + "VALUES " + "(@ClientID " + ",@EventID " + ",@CreditorID " + ",@QuestionID " + ",@Decision " + ",@CreditType " + ",@CreateUser " + ",@CreateDate " + ",@LastModifiedUser " + ",@LastModifiedDate ) "; db.Execute(query, votingProjectionInfo, transaction); }
public void SaveVotingProjectionInfo(VotingProjectionInfo votingProjectionInfo) { if (this.IsExisted(votingProjectionInfo.ClientID, votingProjectionInfo.EventID, votingProjectionInfo.CreditorID, votingProjectionInfo.CreditType, votingProjectionInfo.QuestionID)) { this.Update(votingProjectionInfo); } else { this.Insert(votingProjectionInfo); } }
public void Update(VotingProjectionInfo votingProjectionInfo) { String query = "UPDATE [dbo].[VotingProjection] " + "SET " + " [Decision] = @Decision " + ",[LastModifiedUser] = @LastModifiedUser " + ",[LastModifiedDate] = @LastModifiedDate " + "WHERE ClientID = @ClientID AND EventID = @EventID AND CreditorID = @CreditorID AND CreditType = @CreditType AND QuestionID = @QuestionID "; db.Execute(query, votingProjectionInfo, transaction); }