public async Task <ActionResult> Create(NotificationGatewayModel notificationgateway) { if (ModelState.IsValid) { var gatewayModel = new GatewayModel { GatewayId = notificationgateway.GatewayId, GatewayTypeId = notificationgateway.GatewayTypeId, GatewayName = notificationgateway.GatewayName, IsActive = notificationgateway.IsActive, SenderID = notificationgateway.SenderID, GoogleApikey = notificationgateway.GoogleApikey, GoogleApiURL = notificationgateway.GoogleApiUrl, GoogleProjectID = notificationgateway.GoogleProjectID, GoogleProjectName = notificationgateway.GoogleProjectName, UserId = CurrentUser.UserId, CompanyId = CurrentUser.CompanyId, }; if (CurrentUser.UserTypeName.ToLower() == "super admin") { gatewayModel.CompanyId = notificationgateway.CompanyId; } ResponseModel response = new ResponseModel(); if (gatewayModel.GatewayId != 0) { response = await _gatewayRepo.AddUpdateDeleteGateway(gatewayModel, 'U'); } else { response = await _gatewayRepo.AddUpdateDeleteGateway(gatewayModel, 'I'); } _gatewayRepo.Save(); TempData["response"] = response; TempData.Keep("response"); return(RedirectToAction("Index")); } else { return(View(notificationgateway)); } }
public async Task <ActionResult> Create() { var notificationgatewaymodel = new NotificationGatewayModel(); return(View(notificationgatewaymodel)); }