Base solution for your next web application

Activities of "Hasan"

Question

Dear Sir,

Do you have any document for deployment of ASP.net ZERO application ?

When i try to just deploy the application to the other IIS Server and it gives me the following error ?

Any idea ?

Hello Sir,

Is it possible to have a three level navigation in theme ?

I have tried but it did not come ?

and second one is

Add the Navigation Provider is confusing when you have so many items

I have tried like below but did not come

Do you have any documentation for that ?

var menu =
                context.Manager.Menus[MenuName] = new MenuDefinition(MenuName, new FixedLocalizableString("Main Menu"));

            var tenant =
                menu.AddItem(new MenuItemDefinition(PageNames.App.Host.Tenants, L("Tenants"), url: "Mpa/Tenants",
                    icon: "icon-globe", requiredPermissionName: AppPermissions.Pages_Tenants));

            var edition =
                menu.AddItem(new MenuItemDefinition(PageNames.App.Host.Editions, L("Editions"), url: "Mpa/Editions",
                    icon: "icon-grid", requiredPermissionName: AppPermissions.Pages_Editions));

            var dashboard =
                menu.AddItem(new MenuItemDefinition(PageNames.App.Tenant.Dashboard, L("Dashboard"), url: "Mpa/Dashboard",
                    icon: "icon-home", requiredPermissionName: AppPermissions.Pages_Tenant_Dashboard));

            var connect =
                menu.AddItem(new MenuItemDefinition(PageNames.App.Tenant.Connect, L("Connect"), "fa fa-connectdevelop"));

            var master =
                connect.AddItem(new MenuItemDefinition(PageNames.App.ConnectMaster.Master, L("Master"), "fa fa-indent",
                    requiredPermissionName: AppPermissions.Pages_Tenant_Master));

            master.AddItem(new MenuItemDefinition(PageNames.App.ConnectMaster.Restaurant, L("Restaurant"),
                url: "Mpa/Restaurant", icon: "fa fa-cutlery",
                requiredPermissionName: AppPermissions.Pages_Tenant_Master_Restaurant));

            master.AddItem(new MenuItemDefinition(PageNames.App.ConnectMaster.PaymentType, L("PaymentType"),
                url: "Mpa/PaymentType", icon: "fa fa-money",
                requiredPermissionName: AppPermissions.Pages_Tenant_Master_PaymentType));

            master.AddItem(new MenuItemDefinition(PageNames.App.ConnectMaster.TransactionType, L("TransactionType"),
                url: "Mpa/TransactionType", icon: "fa fa-database",
                requiredPermissionName: AppPermissions.Pages_Tenant_Master_TransactionType));

            var cmenu =
                connect.AddItem(new MenuItemDefinition(PageNames.App.ConnectMaster.Menu, L("Menu"), "fa fa-bullseye",
                    requiredPermissionName: AppPermissions.Pages_Tenant_Menu));

            cmenu.AddItem(new MenuItemDefinition(PageNames.App.ConnectMaster.Category, L("Category"),
                url: "Mpa/Category",
                icon: "fa fa-futbol-o", requiredPermissionName: AppPermissions.Pages_Tenant_Master_Category));

            cmenu.AddItem(new MenuItemDefinition(PageNames.App.ConnectMaster.MenuItem, L("MenuItem"),
                url: "Mpa/MenuItem", icon: "fa fa-bars",
                requiredPermissionName: AppPermissions.Pages_Tenant_Menu_MenuItem
                ));

            var creports =
                connect.AddItem(new MenuItemDefinition(PageNames.App.ConnectMaster.Ticket, L("Report"), "fa fa-flag",
                    requiredPermissionName: AppPermissions.Pages_Tenant_Ticket));

            creports.AddItem(new MenuItemDefinition(PageNames.App.ConnectMaster.AllTicket, L("AllTickets"),
                url: "Mpa/Ticket", icon: "fa fa-ellipsis-v"));

            var admin =
                menu.AddItem(new MenuItemDefinition(PageNames.App.Common.Administration, L("Administration"),
                    "icon-wrench"));

            admin.AddItem(new MenuItemDefinition(PageNames.App.Common.Roles, L("Roles"), url: "Mpa/Roles",
                icon: "icon-briefcase", requiredPermissionName: AppPermissions.Pages_Administration_Roles));

            admin.AddItem(new MenuItemDefinition(PageNames.App.Common.Users, L("Users"), url: "Mpa/Users",
                icon: "icon-users", requiredPermissionName: AppPermissions.Pages_Administration_Users));

            admin.AddItem(new MenuItemDefinition(PageNames.App.Common.Languages, L("Languages"), url: "Mpa/Languages",
                icon: "icon-flag", requiredPermissionName: AppPermissions.Pages_Administration_Languages
                ));

            admin.AddItem(new MenuItemDefinition(PageNames.App.Common.AuditLogs, L("AuditLogs"), url: "Mpa/AuditLogs",
                icon: "icon-lock", requiredPermissionName: AppPermissions.Pages_Administration_AuditLogs
                ));

            admin.AddItem(new MenuItemDefinition(PageNames.App.Host.Settings, L("Settings"), url: "Mpa/HostSettings",
                icon: "icon-settings", requiredPermissionName: AppPermissions.Pages_Administration_Host_Settings
                ));
            admin.AddItem(new MenuItemDefinition(PageNames.App.Tenant.Settings, L("Settings"), url: "Mpa/Settings",
                icon: "icon-settings",
                requiredPermissionName: AppPermissions.Pages_Administration_Tenant_Settings));

Hello Sir,

I am building a Master Child Table but it seems like it throws the error at the Javascript at ABP.

Here is my code and let me know if there is any bug in the ABP

My JavaScript as

(function () {
    $(function () {

        var _$jsTable = $('#TicketTable');
        var _appService = abp.services.app.ticket;
        var _$filterForm = $('#TicketForm');

        var _todayAsString = moment().format('YYYY-MM-DD');

        var _selectedDateRange = {
            startDate: _todayAsString,
            endDate: _todayAsString
        };

        _$filterForm.find('input.date-range-picker').daterangepicker(
            $.extend(true, app.createDateRangePickerOptions(), _selectedDateRange),
            function (start, end, label) {
                _selectedDateRange.startDate = start.format('YYYY-MM-DD');
                _selectedDateRange.endDate = end.format('YYYY-MM-DD');
            });

        _$jsTable.jtable({
            paging: true,
            sorting: true,
            pageSize: 20,
            multiSorting: true,
            title: app.localize('Tickets'),

            actions: {
                listAction: {
                    method: _appService.getTickets
                }
            },

            fields: {
                id: {
                    key: true,
                    list: false
                },
                payments: {
                    title: '',
                    width: '5%',
                    sorting: false,
                    display: function (paymentData) {
                        var $img = $('<span>Payments</span>');
                        $img.click(function () {
                            $('#TicketTable').jtable('openChildTable',
                                    $img.closest('tr'),
                                    {
                                        title: 'PAYMENTS FOR TICKET  : ' + paymentData.record.ticketNumber,
                                        actions: {
                                            listAction: {
                                                method: _appService.getPaymentForTicketId(paymentData.record.id)
                                            }
                                        },
                                        fields: {
                                            Id: {
                                                key: true,
                                                list: false
                                            },
                                            Amount: {
                                                title: app.localize('TotalAmount'),
                                                width: '25%',
                                                display: function (data) {
                                                    var $span = $('<span></span>');
                                                    $span.append(data.record.Amount + " &nbsp; ");
                                                    return $span;
                                                }
                                            }
                                        }
                                    }, function (data) { //opened handler
                                        data.childTable.jtable('load');
                                    });
                        });
                        //Return image to show on the person row
                        return $img;
                    }
                },
                ticketNumber: {
                    title: app.localize('TicketNumber'),
                    width: '25%',
                    display: function (data) {
                        var $span = $('<span></span>');
                        $span.append(data.record.ticketNumber + " &nbsp; ");
                        return $span;
                    }
                },
                totalAmount: {
                    title: app.localize('TotalAmount'),
                    width: '25%',
                    display: function (data) {
                        var $span = $('<span></span>');
                        $span.append(data.record.totalAmount + " &nbsp; ");
                        return $span;
                    }
                }
            }

        });

        function createRequestParams() {
            var prms = {};
            _$filterForm.serializeArray().map(function (x) { prms[x.name] = x.value; });
            return $.extend(prms, _selectedDateRange);
        }


        $('#ExportExcel').click(function () {
            _appService
                .getItemsToExcel({})
                .done(function (result) {
                    app.downloadTempFile(result);
                });
        });
       
        $('#GetItems').click(function (e) {
            e.preventDefault();
            getItems();
        });

        function getItems(reload) {
            if (reload) {
                _$jsTable.jtable('reload');
            } else {
                _$jsTable.jtable('load', {
                    filter: $('#InputFilter').val()
                });
            }
        }
        getItems();

        $('#RefreshAuditLogsButton').click(function (e) {
            e.preventDefault();
            getAuditLogs();
        });

        $('#ExportAuditLogsToExcelButton').click(function (e) {
            e.preventDefault();
            _appService.getAuditLogsToExcel(createRequestParams())
                .done(function (result) {
                    app.downloadTempFile(result);
                });
        });

        $('#ShowAdvancedFiltersSpan').click(function () {
            $('#ShowAdvancedFiltersSpan').hide();
            $('#HideAdvancedFiltersSpan').show();
            $('#AdvacedAuditFiltersArea').slideDown();
        });

        $('#HideAdvancedFiltersSpan').click(function () {
            $('#HideAdvancedFiltersSpan').hide();
            $('#ShowAdvancedFiltersSpan').show();
            $('#AdvacedAuditFiltersArea').slideUp();
        });

        _$filterForm.keydown(function (e) {
            if (e.which == 13) {
                e.preventDefault();
                getAuditLogs();
            }
        });
    });
})();

My Service as below

public async Task<PagedResultOutput<PaymentListDto>>  GetPaymentForTicketId(int ticketId)
        {
            var output = _paRepository.GetAll().Where(a => a.TicketId.Equals(ticketId));
            var categoryListDtos = output.MapTo<List<PaymentListDto>>();

            var menuItemCount = await output.CountAsync();

            return new PagedResultOutput<PaymentListDto>(
                menuItemCount,
                categoryListDtos
                );

        }
      public async Task<PagedResultOutput<TicketListDto>> GetTickets(GetTicketInput input)
        {
            var tickets = _ticketManager
                .GetAll()
                .WhereIf(
                    !input.Filter.IsNullOrEmpty(),
                    p => p.Restaurant.Name.Contains(input.Filter)
                );

            var sortTickets = await tickets
                .OrderBy(input.Sorting)
                .PageBy(input)
                .ToListAsync();

            var categoryListDtos = sortTickets.MapTo<List<TicketListDto>>();
            var menuItemCount = await tickets.CountAsync();

            return new PagedResultOutput<TicketListDto>(
                menuItemCount,
                categoryListDtos
                );
        }

The error is attached as a image below

Question

Hello Sir

I would like you to help on WEB API.

I was trying to get the Users from the link below [http://aspnetzero.com/Documents/Development-Guide#token-based-authentication])

but i am getting following error

{
  "success": false,
  "result": null,
  "error": {
    "code": 0,
    "message": "No user logged in!",
    "details": null,
    "validationErrors": null
  },
  "unAuthorizedRequest": true
}

I have already authenticated users in your previous steps and copied that authorization as well

I have added three attachments for your perusal as well.

Thanks

Question

Hello Sir

Instead of jQuery UI Theme, I would like to do a Bootstrap for jTable.

Please help me to show a link or an example.

Thanks

Hello Team

There are three questions here..

  1. In the commercial project, do we have a sample of Morris Chart data comes from controller ?. If you do not have, is it possible to put up some example ?

  2. I am unable see the Tenent Settings for the default admin user ?. How to get it enabled ? What is difference between Tenent, Host and Common folder and why we need to put Views in the Tenent Folder ?

  3. How to enable the auto migration for Entity Framework ?. If not, whenever I deploy to my customer server (Azure Website or Cloud) how can I run the migration automatically ?

Thanks

Hello Team

It could be very basic question but i have stuck with this

I have an Entity Structure like this one below

public class OrderTagGroup : Entity
    {
        public virtual string Name { get; set; }
        public virtual List<OrderTag> OrderTags { get; set; }
    }

     public class OrderTag : Entity
    {
        public virtual string Name { get; set; }
        public virtual int? OrderTagGroupId { get; set; }
    }

and Its respective DTO is

public class OrderTagGroupDto : EntityDto
{
    [Required]
    public string Name { get; set; }


    public List<OrderTagDto> OrderTags { get; set; }
}

public class OrderTagDto : EntityDto
{
    [Required]
    public string Name { get; set; }


    public int? OrderTagGroupId { get; set; }
}

I have added the Auto mapping as well like this

Mapper.CreateMap<OrderTagGroup, OrderTagGroupDto>();
            Mapper.CreateMap<OrderTagGroupDto, OrderTagGroup>();

            Mapper.CreateMap<OrderTag, OrderTagDto>();
            Mapper.CreateMap<OrderTagDto, OrderTag>();

Here is my Repository update

public void UpdateOrderTagGroup(OrderTagGroupDto OrderTagGroup)
        {
            var group = _OrderTagGroupRepo.Get(OrderTagGroup.Id);
            if (group != null && group.Id > 0)
            {
                Mapper.Map<OrderTagGroupDto, OrderTagGroup>(OrderTagGroup,group);
              
            }
        }

My Question is, whenever my OrderTagGroupDTO goes for the update, it creates a new row in the DB and previous entry is not deleted.

Could you please help me where i am wrong ?

Dear Team I am just starting this wonderful module for one of my project

How to give authorization generated to API Controllers ?

For example,

before the user calls, he has to login and get the session id before he proceeds to call other methods

Would like to achieve something like this ?

<a class="postlink" href="http://www.asp.net/web-api/overview/security/individual-accounts-in-web-api">http://www.asp.net/web-api/overview/sec ... in-web-api</a>

Showing 31 to 38 of 38 entries