コード例 #1
0
        public static int UpdateVoucherTemplate(tVoucherTemplate templates)
        {
            int rowsAdded;

            using (IDbConnection connection = DbConnectionHelper.GetConnection())
            {
                var query = SqlQueryHelper.GetUpdateQuery<tVoucherTemplate>();

                rowsAdded = connection.Execute(query, templates);
            }

            return rowsAdded;
        }
コード例 #2
0
        public static bool UpdateVoucherTemplate(VoucherTemplateDto voucherTemplate)
        {
            try
            {
                var entity = new tVoucherTemplate
                {
                    CompanyId = voucherTemplate.CompanyId,
                    CreditAccount = voucherTemplate.CreditAccountCode,
                    DebitAccount = voucherTemplate.DebitAccountCode,
                    Narration = voucherTemplate.Narration,
                    ShortCode = voucherTemplate.ShortCode,
                };

                var result = AccountingDataProvider.UpdateVoucherTemplate(entity);

                if (result == 1)
                {
                    return true;
                }
                return false;
            }
            catch (Exception exception)
            {
                throw new Exception(exception.Message);
            }
        }