public async Task <ActionResult> Edit(int id, Guid?GUID)
        {
            var templatemodel = new TemplateModel();

            templatemodel = await _templateRepo.GetTemplateByGUID(id, GUID);

            if (!string.IsNullOrEmpty(templatemodel.ScheduleDateTime))
            {
                string[] strSheduleArray = templatemodel.ScheduleDateTime.Split(' ');
                templatemodel.ScheduleDate = strSheduleArray[0];
                templatemodel.ScheduleTime = strSheduleArray[1];
            }

            templatemodel.WildCardList          = new SelectList(CommonModel.GetWildCards(templatemodel.CompanyId), "Text", "Text");
            templatemodel.ActionTypeList        = new SelectList(await CommonModel.GetActionTypes(), "Value", "Text");
            templatemodel.MessageTypeList       = new SelectList(await CommonModel.GetLookup("Gateway"), "Value", "Text");
            templatemodel.TemplateTypeList      = new SelectList(await CommonModel.GetLookup("Template"), "Value", "Text");
            templatemodel.PriorityTypeList      = new SelectList(await CommonModel.GetLookup("Priority"), "Value", "Text");
            templatemodel.EmailHeaderFooterList = new SelectList(CommonModel.GetHeaderFooter(templatemodel.CompanyId), "Value", "Text");
            templatemodel.GatewayList           = new SelectList(CommonModel.GetMailerGatewayList(templatemodel.MessageTypeId, templatemodel.CompanyId), "GatewayId", "GatewayName");
            if (CurrentUser.UserTypeName.ToLower() == "super admin")
            {
                templatemodel.IsAdmin     = true;
                templatemodel.CompanyList = new SelectList(await CommonModel.GetCompanies(), "Name", "Text");
            }
            return(View(templatemodel));
        }
        public async Task <ActionResult> Index1()
        {
            var templates = await _templateRepo.GetTemplates(new Filters.FilterModel {
                CompId = CurrentUser.CompanyId
            });

            templates.ActionTypeList  = new SelectList(await CommonModel.GetActionTypes(), "Value", "Text");
            templates.MessageTypeList = new SelectList(await CommonModel.GetLookup("Gateway"), "Value", "Text");
            return(View(templates));
        }
        public async Task <ActionResult> Create()
        {
            var wildcardmodel = new WildCardModel();

            wildcardmodel.ActionTypeList = new SelectList(await CommonModel.GetActionTypes(), "Value", "Text");
            if (CurrentUser.UserTypeName.ToLower() == "super admin")
            {
                wildcardmodel.IsAdmin     = true;
                wildcardmodel.CompanyList = new SelectList(await CommonModel.GetCompanies(), "Name", "Text");
            }
            return(View(wildcardmodel));
        }
        public async Task <ActionResult> Create()
        {
            var templatemodel = new TemplateModel();

            templatemodel.IsActive              = true;
            templatemodel.ActionTypeList        = new SelectList(await CommonModel.GetActionTypes(), "Value", "Text");
            templatemodel.MessageTypeList       = new SelectList(await CommonModel.GetLookup("Gateway"), "Value", "Text");
            templatemodel.TemplateTypeList      = new SelectList(await CommonModel.GetLookup("Template"), "Value", "Text");
            templatemodel.PriorityTypeList      = new SelectList(await CommonModel.GetLookup("Priority"), "Value", "Text");
            templatemodel.WildCardList          = new SelectList(CommonModel.GetWildCards(CurrentUser.CompanyId), "Text", "Text");
            templatemodel.EmailHeaderFooterList = new SelectList(CommonModel.GetHeaderFooter(CurrentUser.CompanyId), "Value", "Text");
            templatemodel.IsSystemDefined       = true;
            if (CurrentUser.UserTypeName.ToLower() == "super admin")
            {
                templatemodel.IsAdmin     = true;
                templatemodel.CompanyList = new SelectList(await CommonModel.GetCompanies(), "Name", "Text");
            }
            return(View(templatemodel));
        }
Пример #5
0
        public async Task <ActionResult> Index()
        {
            var emailheaderfooter = await _emailHeaderFooterRepo.GetEmailHeaderFooters(new Filters.FilterModel {
                CompId = CurrentUser.CompanyId
            });

            EmailHeaderFooterMainModel model = new EmailHeaderFooterMainModel();

            model.EmailHeaderFooter = new EmailHeaderFooterModel();
            model.mainModel         = Mapper.Map <List <EmailHeaderFooterModel> >(emailheaderfooter);
            model.EmailHeaderFooter.ActionTypeList = new SelectList(await CommonModel.GetActionTypes(), "Value", "Text");
            if (CurrentUser.UserTypeName.ToLower() == "super admin")
            {
                model.EmailHeaderFooter.IsAdmin     = true;
                model.EmailHeaderFooter.CompanyList = new SelectList(await CommonModel.GetCompanies(), "Name", "Text");
            }


            return(View(model));
        }
        public async Task <ActionResult> Edit(int id)
        {
            var wildcard = await _wildCardRepo.GetWildCardByWildCardId(id);

            var        array       = wildcard.ActionTypeIds.Split(',');
            List <int> ActionTypes = new List <int>();

            for (int i = 0; i < array.Length; i++)
            {
                ActionTypes.Add(Convert.ToInt32(array[i]));
            }
            wildcard.ActionTypeList = new SelectList(await CommonModel.GetActionTypes(), "Value", "Text");
            wildcard.actionTypes    = ActionTypes;
            if (CurrentUser.UserTypeName.ToLower() == "super admin")
            {
                wildcard.IsAdmin     = true;
                wildcard.CompanyList = new SelectList(await CommonModel.GetCompanies(), "Name", "Text");
            }
            return(View(wildcard));
        }