public void Remove(Model.IncomeExpense entity) { if (entity == null) { throw new ArgumentNullException("entity"); } Remove(entity.IncomeExpenseId); }
public void Update(Model.IncomeExpense entity) { if (entity == null) { throw new ArgumentNullException("entity"); } string update = string.Format(@"update IncomeExpense set IncomeExpenseCode= @IncomeExpenseCode,No= @No,BillNo= @BillNo,DepartmentId= @DepartmentId,StaffId= @StaffId,MoneyIn= @MoneyIn,MoneyOut= @MoneyOut,MoneyUse= @MoneyUse,MoneyBack= @MoneyBack,RegisterValue= @RegisterValue,Sign= @Sign,Content= @Content,Value= @Value,NoteId= @NoteId,Description= @Description,Note= @Note,CreateDate= @CreateDate,CreateBy= @CreateBy,ModifyDate= @ModifyDate,ModifyBy= @ModifyBy,ProjectId= @ProjectId,ApproveStatusId= @ApproveStatusId,ApproveDate= @ApproveDate,ApproveBy= @ApproveBy,PurposeSuggestionId= @PurposeSuggestionId where IncomeExpenseId = @IncomeExpenseId"); Connection.Execute(update, entity, transaction: Transaction); }
public void Add(Model.IncomeExpense entity) { if (entity == null) { throw new ArgumentNullException("entity"); } string insert = string.Format(@"insert into IncomeExpense(IncomeExpenseCode,No,BillNo,DepartmentId,StaffId,MoneyIn,MoneyOut,MoneyUse,MoneyBack,RegisterValue,Sign,Content,Value,NoteId,Description,Note,CreateDate,CreateBy,ModifyDate,ModifyBy,ProjectId,ApproveStatusId,ApproveDate,ApproveBy,PurposeSuggestionId) values (@IncomeExpenseCode,@No,@BillNo,@DepartmentId,@StaffId,@MoneyIn,@MoneyOut,@MoneyUse,@MoneyBack,@RegisterValue,@Sign,@Content,@Value,@NoteId,@Description,@Note,@CreateDate,@CreateBy,@ModifyDate,@ModifyBy,@ProjectId,@ApproveStatusId,@ApproveDate,@ApproveBy,@PurposeSuggestionId)"); Connection.Execute(insert, entity, transaction: Transaction); //Connection.Query(insert, new { @IncomeExpenseCode = entity.IncomeExpenseCode, @Type = entity.Type, @BillNo = entity.BillNo, @DepartmentId = entity.DepartmentId, @StaffId= entity.StaffId, @MoneyIn=entity.MoneyIn, @MoneyOut = entity.MoneyOut, @MoneyUse=entity.MoneyUse, @MoneyBack=entity.MoneyBack, @RegisterValue=entity.RegisterValue, @Sign=entity.Sign, @Content=entity.Content, @Value=entity.Content, @NoteId=entity.NoteId, @Description=entity.Description, @Note=entity.Note, @CreateDate=entity.CreateDate, @CreateBy=entity.CreateBy }, Transaction); }