public string Action(string action, Player player) { if (!Found) { if (action.ToLower().Contains("pickup") == true) { //pick up sword Found = true; player.Inventory.Add("Sword"); Console.WriteLine("Picked up the sword"); return("You picked up the sword"); } } return(ConstantStrings.GetMissingSword()); }
public async Task <ApiResponse <string> > Update(int productId, ProductImageRequest request) { var productFromDb = await _db.Products.FindAsync(productId); if (productFromDb == null) { return(new ApiErrorResponse <string>(ConstantStrings.FindByIdError(productId))); } var productImageFromDb = await _db.ProductImages.Where(x => x.ProductId == productId).ToListAsync(); if (productImageFromDb.Count == 0) { return(new ApiErrorResponse <string>(ConstantStrings.FindByIdError(productId))); } if (request.ProductImages == null) { return(new ApiErrorResponse <string>(ConstantStrings.imgIsEmptyOrNull)); } var images = request.ProductImages.ToList(); for (int i = 0; i < images.Count; i++) { foreach (var item in productImageFromDb) { if (images[i].Name == item.Caption) { var deleteResult = await DeleteImage(item.PublicId); if (deleteResult.Error != null) { return(new ApiErrorResponse <string>(deleteResult.Error.ToString())); } var uploadResult = await UploadImage(images[i]); if (uploadResult.Error != null) { return(new ApiErrorResponse <string>(uploadResult.Error.ToString())); } item.ImageUrl = uploadResult.SecureUrl.ToString(); item.PublicId = uploadResult.PublicId; break; } } } await _db.SaveChangesAsync(); return(new ApiSuccessResponse <string>(ConstantStrings.editSuccessfully)); }
protected void CreateUser_Click(object sender, EventArgs e) { try { Page.Validate(); if (Page.IsValid) { IMyLog log = MyLog.GetLogger("Register"); LogForEmailSend log4Email = new LogForEmailSend(MyLog.GetLogger("Email")); MessageProcessing_API api = new MessageProcessing_API(null); bool fileArleadyUsed; api.Process_Registration( NiceSystemInfo.DEFAULT, out fileArleadyUsed, true, UserName.Text, Tel1.Text + Tel2.Text + Tel3.Text + Tel4.Text + Tel5.Text, Email.Text, Password.Text, GetIPAddress(), WhereHeard.Text, log, log4Email); if (fileArleadyUsed) { SessionData sd = ConstantStrings.GetSessionData(Session); sd.QuickMessage = "Your registratin failed. Please try again later."; sd.QuickMessageGood = false; Response.Redirect("~/Register.aspx"); } else { // ok SessionData sd = ConstantStrings.GetSessionData(Session); sd.QuickMessage = "Verify your email: We sent a verification email to " + Email.Text + " .Click the link in the email to get started!"; sd.QuickMessageGood = true; Response.Redirect("~/Login.aspx"); } } } catch (DataUnavailableException) { DSSwitch.OnDataUnavailableException(this); } }
public async Task <ApiResponse <string> > Update(int productId, ProductRequest request) { var productFromDb = await _db.Products.FindAsync(productId); if (productFromDb == null) { return(new ApiErrorResponse <string>(ConstantStrings.FindByIdError(productId))); } if (string.IsNullOrEmpty(request.Name)) { return(new ApiErrorResponse <string>(ConstantStrings.emptyNameFieldError)); } _mapper.Map <ProductRequest, Product>(request, productFromDb); await _db.SaveChangesAsync(); return(new ApiSuccessResponse <string>(ConstantStrings.editSuccessfully)); }
public async Task <ApiResponse <string> > Update(int vendorId, VendorRequest request) { var vendorFromDb = await _db.Vendors.FindAsync(vendorId); if (vendorFromDb == null) { return(new ApiErrorResponse <string>(ConstantStrings.FindByIdError(vendorId))); } if (string.IsNullOrEmpty(request.Name)) { return(new ApiErrorResponse <string>(ConstantStrings.emptyNameFieldError)); } _mapper.Map <VendorRequest, Vendor>(request, vendorFromDb); await _db.SaveChangesAsync(); return(new ApiSuccessResponse <string>(ConstantStrings.editSuccessfully)); }
public async Task <ApiResponse <string> > Update(int demandId, DemandRequest request) { var demandFromDb = await _db.Demands.FindAsync(demandId); if (demandFromDb == null) { return(new ApiErrorResponse <string>(ConstantStrings.FindByIdError(demandId))); } if (string.IsNullOrEmpty(request.Name)) { return(new ApiErrorResponse <string>(ConstantStrings.emptyNameFieldError)); } demandFromDb.Name = request.Name; _db.Demands.Update(demandFromDb); await _db.SaveChangesAsync(); return(new ApiSuccessResponse <string>(ConstantStrings.editSuccessfully)); }
public async Task <ApiResponse <string> > Create(int productId, ProductImageRequest request) { var productFromDb = await _db.Products.FindAsync(productId); if (productFromDb == null) { return(new ApiErrorResponse <string>(ConstantStrings.FindByIdError(productId))); } var productImageFromDb = await _db.ProductImages.Where(x => x.ProductId == productFromDb.Id) .OrderByDescending(x => x.SortOrder).ToListAsync(); if (productFromDb == null) { return(new ApiErrorResponse <string>(ConstantStrings.FindByIdError(productId))); } if (request.ProductImages == null) { return(new ApiErrorResponse <string>(ConstantStrings.imgIsEmptyOrNull)); } var images = request.ProductImages.ToList(); for (int i = 0; i < images.Count; i++) { var uploadResult = await UploadImage(images[i]); if (uploadResult.Error != null) { return(new ApiErrorResponse <string>(uploadResult.Error.ToString())); } var productImage = new ProductImage() { ImageUrl = uploadResult.SecureUrl.ToString(), PublicId = uploadResult.PublicId, Caption = SystemFunctions.ProductImageCaption(productFromDb.Name, productImageFromDb.FirstOrDefault().SortOrder + i + 1), ProductId = productFromDb.Id, SortOrder = productImageFromDb.FirstOrDefault().SortOrder + i + 1 }; _db.ProductImages.Add(productImage); } _db.ProductImages.Remove(productImageFromDb.Where(x => x.PublicId == ConstantStrings.blankProductImagePublicId).FirstOrDefault()); await _db.SaveChangesAsync(); return(new ApiSuccessResponse <string>(ConstantStrings.addSuccessfully)); }
protected void Page_Load(object sender, EventArgs e) { // This come from an anonymous browser try { Page.MetaKeywords = "Register, Send Whatsapp message, Free"; Page.MetaDescription = "Register to use the service."; NiceASP.KeywordLoader.Load(this, NiceASP.KeywordLoader.Which.Register); string query = Request.QueryString["ApiGuId"]; IMyLog log = MyLog.GetLogger("Register"); LogForEmailSend log4Email = new LogForEmailSend(MyLog.GetLogger("Email")); if (query != null) { // email validation callback query = EMail.Base64_URLDecoding(query); MessageProcessing_API api = new MessageProcessing_API(query); bool good; api.Process_Registration_JustVerified(NiceSystemInfo.DEFAULT, out good, false, true, log, log4Email); if (good) { // good, SessionData sd = ConstantStrings.GetSessionData(Session); sd.QuickMessage = "Your email is now verified. Please wait 48 hour for your account to become active."; sd.QuickMessageGood = true; Response.Redirect("~/Login.aspx"); } else { // bad SessionData sd = ConstantStrings.GetSessionData(Session); sd.QuickMessage = "This token is expired."; sd.QuickMessageGood = false; Response.Redirect("~/"); } } } catch (DataUnavailableException) { DSSwitch.OnDataUnavailableException(this); } }
public async Task <ApiResponse <string> > Delete(int productImageId) { var productImage = await _db.ProductImages.FindAsync(productImageId); if (productImage == null) { return(new ApiErrorResponse <string>(ConstantStrings.FindByIdError(productImageId))); } var deleteResult = await DeleteImage(productImage.PublicId); if (deleteResult.Error != null) { return(new ApiErrorResponse <string>(deleteResult.Error.ToString())); } _db.ProductImages.Remove(productImage); await _db.SaveChangesAsync(); return(new ApiSuccessResponse <string>(ConstantStrings.deleteSuccessfully)); }
public async Task <ApiResponse <string> > Delete(int trademarkId) { var trademarkFromDb = await _db.Trademarks.FindAsync(trademarkId); if (trademarkFromDb == null) { return(new ApiErrorResponse <string>(ConstantStrings.FindByIdError(trademarkId))); } var result = await DeleteImage(trademarkFromDb.PublicId); if (result.Error != null) { return(new ApiErrorResponse <string>(ConstantStrings.cloudDeleteFailed)); } _db.Trademarks.Remove(trademarkFromDb); await _db.SaveChangesAsync(); return(new ApiSuccessResponse <string>(ConstantStrings.deleteSuccessfully)); }
public async Task <ApiResponse <string> > Update(int categoryId, CategoryRequest request) { if (string.IsNullOrEmpty(request.Name)) { return(new ApiErrorResponse <string>(ConstantStrings.emptyNameFieldError)); } var categoryFromDb = await _db.Categories.FindAsync(categoryId); if (categoryFromDb == null) { return(new ApiErrorResponse <string>(ConstantStrings.FindByIdError(categoryId))); } categoryFromDb.Name = request.Name; categoryFromDb.Description = request.Description; _db.Categories.Update(categoryFromDb); await _db.SaveChangesAsync(); return(new ApiSuccessResponse <string>(ConstantStrings.editSuccessfully)); }
public IActionResult Create(int contractID, int groupID) { //string userLogin = GetLogin(); PopulateViewBag(contractID); if (groupID > 0) { try { // id is the LineItemGroup.GroupID var group = _context.LineItemGroups.Where(lig => lig.GroupID == groupID).SingleOrDefault(); if (group == null) { // if it is zero or does not exist, create a new LineItemGroup and set id = its GroupID LineItemGroup newGroup = new LineItemGroup(ViewBag.Contract, ViewBag.CurrentUser) { CurrentStatus = ConstantStrings.Draft, LastEditedUserID = ViewBag.CurrentUser.UserID, OriginatorUserID = ViewBag.CurrentUser.UserID }; _context.LineItemGroups.Add(newGroup); _context.SaveChanges(); group = newGroup; } ViewBag.lineItemGroup = group; ViewBag.contractID = ViewBag.Contract.ContractID; // also the View does not use this to populate a selection list yet. //ViewData["FlairLineIDs"] = GetAmendmentsList(contractID); } catch (Exception e) { _logger.LogError("LineItemsController.Create Error:" + e.GetBaseException()); Log.Error("LineItemsController.Create Error:" + e.GetBaseException() + "\n" + e.StackTrace); } } ViewBag.LineItemTypes = ConstantStrings.GetLineItemTypeList(); ViewBag.currentFiscalYear = PermissionsUtils.GetCurrentFiscalYear(); ViewData["Categories"] = _context.Categories.OrderBy(v => v.CategoryCode); ViewData["StatePrograms"] = _context.StatePrograms.OrderBy(v => v.ProgramCode); return(View()); }
protected void Page_Load(object sender, EventArgs e) { // This comes from a logged in user NiceASP.SessionData.LoggedOnOrRedirectToLogin(Session, Response, Request); sd = ConstantStrings.GetSessionData(Session); if (!IsPostBack) { // check if a committed request exists, if so display it Data_AppUserWallet existingWallet = DSSwitch.appWallet().RetrieveOne( sd.LoggedOnUserEmail, MyLog.GetVoidLogger()); Data_AppUserFile user = DSSwitch.appUser().RetrieveOne(sd.LoggedOnUserEmail, MyLog.GetVoidLogger()); if ((user != null) && (user.AccountStatus != Data_AppUserFile.eUserStatus.free_account)) { MainSection_Normal.Visible = false; TitleId.Text = "Upgrade Request"; string niceName = Data_AppUserFile.GetNiceStatusText(user.AccountStatus); Literal1.Text = "You currently hold a " + niceName + " account. Please contact us to do the upgrade."; } else if ((existingWallet != null) && (existingWallet.HasUpgradeRequest())) { // display existing request showStoredData(existingWallet); } else { // no commit yet UpdateInfo priceInfo = getHardcodedPriceInfoOrGoBackToPricePage(); TitleId.Text = priceInfo.Title + " - Upgrade Request"; userName.Text = sd.LoggedOnUserName; InfoText.Text = new UpgradeTextList(priceInfo.Info).GetAsHTML; alterStep1DivVisibility(true, priceInfo, 0, 0, 0, 0); CalculateButton.Focus(); } } }
protected void Page_Load(object sender, EventArgs e) { // This comes from a logged in user try { NiceASP.SessionData.LoggedOnOrRedirectToLogin(Session, Response, Request); if (!IsPostBack) { SessionData sd = ConstantStrings.GetSessionData(Session); // refresh from file IMyLog log = MyLog.GetLogger("Details"); Data_AppUserFile user = DSSwitch.appUser().RetrieveOne(sd.LoggedOnUserEmail, log); UserName.Text = user.UserName; UserEmail.Text = user.Email; if (user.MobileNumbersCount() > 5) { Tel1.Text = Tel2.Text = Tel3.Text = Tel4.Text = Tel5.Text = "Many"; } else { Tel1.Text = user.MobileNumberX(0); Tel2.Text = user.MobileNumberX(1); Tel3.Text = user.MobileNumberX(2); Tel4.Text = user.MobileNumberX(3); Tel5.Text = user.MobileNumberX(4); } ApiGuId.Text = user.ApiGuId; Status.Text = Data_AppUserFile.GetNiceStatusText(user.AccountStatus); } } catch (DataUnavailableException) { DSSwitch.OnDataUnavailableException(this); } }
public void TestInitialization() { LaunchBrowser(ConstantStrings.GetUrl()); }
public override void NavigateToPage(string parameter = "") { this.driver.Navigate().GoToUrl(ConstantStrings.GetUrl()); }
public string Action(string action, Player player) { //no action required return(ConstantStrings.GetPitOfDoomWarningString()); }
protected void UpdateData_Click(object sender, EventArgs e) { try { DSSwitch.appUser().Update_General(I_UserEmail.Text, delegate(Data_AppUserFile user, Object args) { UpdateIfChanged(L_UserName_Store, L_UserName, ref user.UserName); UpdateIfChanged(L_UserEmail_Store, L_UserEmail, ref user.Email); UpdateIfChanged(L_UserEmail_Store, L_ApiGuId, ref user.ApiGuId); UpdateIfChanged(L_UserPassword_Store, L_UserPassword, ref user.Password); UpdateIfChanged_Mob(L_AllTelNumbers_Store, L_AllTelNumbers, ref user.MobileNumbers_AllConfirmed__); UpdateIfChanged_Mob(L_AllUnconfTelNumbers_Store, L_AllUnconfTelNumbers, ref user.MobileNumbers_AllUnConfirmed__); UpdateIfChanged(L_CreationIp_Store, L_CreationIp, ref user.CreationIp); UpdateIfChanged_Stat(L_Status_Store, L_Status, ref user.AccountStatus); UpdateIfChanged(L_Comment_Store, L_Comment, ref user.Comment); UpdateIfChanged_Bol(L_DeleteOnFailed_Store, L_DeleteOnFailed, ref user.DeleteOnFailed); UpdateIfChanged_Bol(L_AddNumberAllowedWithAPI_Store, L_AddNumberAllowedWithAPI, ref user.AddNumber_AllowedWithAPI); UpdateIfChanged_Bol(L_AddNumberActivateOnSyncRequest_Store, L_AddNumberActivateOnSyncRequest, ref user.AddNumber_ActivateOnSyncRequest); UpdateIfChanged_I64(Lf_MsgSent_Store, Lf_MsgSent, ref user.FreeAccount.free_MsgSent); UpdateIfChanged_I64(Lf_MsgLeft_Store, Lf_MsgLeft, ref user.FreeAccount.free_MsgLeft); UpdateIfChanged_I32(Lf_MinDelayInSeconds_Store, Lf_MinDelayInSeconds, ref user.FreeAccount.free_MinDelayInSeconds); UpdateIfChanged_Bol(Lf_SendFooter_Store, Lf_SendFooter, ref user.FreeAccount.free_SendFooter); UpdateIfChanged_I16(Lf_WelcomeCounter_Store, Lf_WelcomeCounter, ref user.FreeAccount.free_WelcomeCounter); UpdateIfChanged_I64(Lf_MsgQueued_Store, Lf_MsgQueued, ref user.FreeAccount.free_MsgQueued); UpdateIfChanged_I64(Lm_MsgSent_Store, Lm_MsgSent, ref user.MonthlyAccount.monthly_MsgSent); UpdateIfChanged_Dt(Lm_PaidUntil_Store, Lm_PaidUntil, ref user.MonthlyAccount.monthly_PaidUntil); UpdateIfChanged_I32(Lm_MinDelayInSeconds_Store, Lm_MinDelayInSeconds, ref user.MonthlyAccount.monthly_MinDelayInSeconds); UpdateIfChanged_mon(Lm_CostPerNumber_Store, Lm_CostPerNumber, ref user.MonthlyAccount.monthly_CostPerNumber); UpdateIfChanged_mon(Lm_CurrentCredit_Store, Lm_CurrentCredit, ref user.MonthlyAccount.monthly_CurrentCredit); UpdateIfChanged_I64(Lm2_TotalMsgSent_Store, Lm2_TotalMsgSent, ref user.MonthlyDifPriceAccount.monthlyDifPrice_TotalMsgSent); UpdateIfChanged_I64(Lm2_ThisMonthMsgSent_Store, Lm2_ThisMonthMsgSent, ref user.MonthlyDifPriceAccount.monthlyDifPrice_ThisMonthMsgSent); UpdateIfChanged_Dt(Lm2_PeriodeStart_Store, Lm2_PeriodeStart, ref user.MonthlyDifPriceAccount.monthlDifPricey_PeriodeStart); UpdateIfChanged_I32(Lm2_PeriodeDurationInDays_Store, Lm2_PeriodeDurationInDays, ref user.MonthlyDifPriceAccount.monthlyDifPrice_PeriodeDurationInDays); UpdateIfChanged_I32(Lm2_MinDelayInSeconds_Store, Lm2_MinDelayInSeconds, ref user.MonthlyDifPriceAccount.monthlyDifPrice_MinDelayInSeconds); UpdateIfChanged_mon(Lm2_CostPerNumber_Store, Lm2_CostPerNumber, ref user.MonthlyDifPriceAccount.monthlyDifPrice_CostPerNumber); UpdateIfChanged_mon(Lm2_CurrentCredit_Store, Lm2_CurrentCredit, ref user.MonthlyDifPriceAccount.monthlyDifPrice_CurrentCredit); UpdateIfChanged(Lm2_LevelDefinitions_Store, Lm2_LevelDefinitions, ref user.MonthlyDifPriceAccount.monthlyDifPrice_LevelDefinitions); UpdateIfChanged_I32(Lm2_Level_Store, Lm2_Level, ref user.MonthlyDifPriceAccount.monthlyDifPrice_Level); UpdateIfChanged_Bol(Lm2_AutoInceremntLevel_Store, Lm2_AutoInceremntLevel, ref user.MonthlyDifPriceAccount.monthlyDifPrice_AutoInceremntLevel); UpdateIfChanged_Bol(Lm2_AutoRenewMonthPayment_Store, Lm2_AutoRenewMonthPayment, ref user.MonthlyDifPriceAccount.monthlyDifPrice_AutoRenewMonthPayment); UpdateIfChanged_I64(Lp_MsgSent_Store, Lp_MsgSent, ref user.PayAsSentAccount.payAsSent_MsgSent); UpdateIfChanged_I32(Lp_MinDelayInSeconds_Store, Lp_MinDelayInSeconds, ref user.PayAsSentAccount.payAsSent_MinDelayInSeconds); UpdateIfChanged_mon(Lp_CostPerNumber_Store, Lp_CostPerNumber, ref user.PayAsSentAccount.payAsSent_CostPerNumber); UpdateIfChanged_mon(Lp_CostPerMessage_Store, Lp_CostPerMessage, ref user.PayAsSentAccount.payAsSent_CostPerMessage); UpdateIfChanged_mon(Lp_CurrentCredit_Store, Lp_CurrentCredit, ref user.PayAsSentAccount.payAsSent_CurrentCredit); UpdateIfChanged_I64(Ld_MsgSent_Store, Ld_MsgSent, ref user.SystemDuplicationAccount.systemDuplication_MsgSent); UpdateIfChanged_Dt(Ld_PaidUntil_Store, Ld_PaidUntil, ref user.SystemDuplicationAccount.systemDuplication_PaidUntil); }, null, null, MyLog.GetLogger("DataAll")); SessionData sd = ConstantStrings.GetSessionData(Session); sd.QuickMessage = I_UserEmail.Text + " updated"; sd.QuickMessageGood = true; Response.Redirect(HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority) + ResolveUrl("~/")); } catch (DataUnavailableException) { DSSwitch.OnDataUnavailableException(this); } catch (Exception) { } }
public string Action(string action, Player player) { player.Health = 0; return(ConstantStrings.GetPitOfDoomString()); }
protected void Page_Load(object sender, EventArgs e) { // This comes from a logged in user try { NiceASP.SessionData.LoggedOnOrRedirectToLogin(Session, Response, Request); if (!IsPostBack) { SessionData sd = ConstantStrings.GetSessionData(Session); // refresh from file Data_AppUserFile user = DSSwitch.appUser().RetrieveOne(sd.LoggedOnUserEmail, MyLog.GetLogger("Counters")); if (user != null) { switch (user.AccountStatus) { case Data_AppUserFile.eUserStatus.free_account: sectionFree.Visible = true; F_Tel1.Text = user.MobileNumbers_AllConfirmed__.MobileNumberX(0); F_Tel2.Text = user.MobileNumbers_AllConfirmed__.MobileNumberX(1); F_Tel3.Text = user.MobileNumbers_AllConfirmed__.MobileNumberX(2); F_Tel4.Text = user.MobileNumbers_AllConfirmed__.MobileNumberX(3); F_Tel5.Text = user.MobileNumbers_AllConfirmed__.MobileNumberX(4); F_LastMsgQueued.Text = user.FreeAccount.free_LastMsgQueued.ToUkTime(false); F_MsgSent.Text = (user.FreeAccount.free_MsgQueued + user.FreeAccount.free_MsgSent).ToString(); F_MsgLeft.Text = user.FreeAccount.free_MsgLeft.ToString(); F_MinDelayInSeconds.Text = user.FreeAccount.free_MinDelayInSeconds.ToString() + " seconds"; break; case Data_AppUserFile.eUserStatus.commercial_monthly: sectionMonthly.Visible = true; M_Tels.Text = user.MobileNumbers_AllConfirmed__.getVal; M_ActiveUntil.Text = user.MonthlyAccount.monthly_PaidUntil.ToUkTime(false); if (user.MonthlyAccount.monthly_PaidUntil < DateTime.UtcNow.Ticks) { M_ActiveUntil.BackColor = System.Drawing.Color.Red; } M_LastQueued.Text = user.MonthlyAccount.monthly_LastMsgQueued.ToUkTime(false); M_CurrentCredit.Text = user.MonthlyAccount.monthly_CurrentCredit.ToString(); M_CostPerNumber.Text = user.MonthlyAccount.monthly_CostPerNumber.ToString(); M_MsgSent.Text = user.MonthlyAccount.monthly_MsgSent.ToString(); M_MinDelayInSeconds.Text = user.MonthlyAccount.monthly_MinDelayInSeconds.ToString() + " seconds"; break; case Data_AppUserFile.eUserStatus.commercial_monthlyDifPrice: sectionMonthlyDifPrice.Visible = true; M2_Tels.Text = user.MobileNumbers_AllConfirmed__.getVal; M2_ActiveUntil.Text = user.MonthlyDifPriceAccount.PaidUntil().Ticks.ToUkTime(true); if (user.MonthlyDifPriceAccount.PaidUntil() < DateTime.UtcNow) { M2_ActiveUntil.BackColor = System.Drawing.Color.Red; } M2_LastQueued.Text = user.MonthlyDifPriceAccount.monthlyDifPrice_LastMsgQueued.ToUkTime(false); M2_CurrentCredit.Text = user.MonthlyDifPriceAccount.monthlyDifPrice_CurrentCredit.ToString(); M2_CostPerNumber.Text = user.MonthlyDifPriceAccount.monthlyDifPrice_CostPerNumber.ToString(); M2_TotalMsgSent.Text = user.MonthlyDifPriceAccount.monthlyDifPrice_TotalMsgSent.ToString(); M2_MsgSentThisPeriod.Text = user.MonthlyDifPriceAccount.monthlyDifPrice_ThisMonthMsgSent.ToString(); break; case Data_AppUserFile.eUserStatus.commercial_payassent: sectionPayAsSent.Visible = true; P_Tels.Text = user.MobileNumbers_AllConfirmed__.getVal; P_CurrentCredit.Text = user.PayAsSentAccount.payAsSent_CurrentCredit.ToString(); P_CostPerNumber.Text = user.PayAsSentAccount.payAsSent_CostPerNumber.ToString(); P_CostPerMessage.Text = user.PayAsSentAccount.payAsSent_CostPerMessage.ToString(); P_LastQueued.Text = user.PayAsSentAccount.payAsSent_LastMsgQueued.ToUkTime(false); P_MsgSent.Text = user.PayAsSentAccount.payAsSent_MsgSent.ToString(); P_MinDelayInSeconds.Text = user.PayAsSentAccount.payAsSent_MinDelayInSeconds.ToString() + " seconds"; break; case Data_AppUserFile.eUserStatus.commercial_systemDuplication: sectionSystemDuplication.Visible = true; D_ActiveUntil.Text = user.SystemDuplicationAccount.systemDuplication_PaidUntil.ToUkTime(false); if (user.SystemDuplicationAccount.systemDuplication_PaidUntil < DateTime.UtcNow.Ticks) { D_ActiveUntil.BackColor = System.Drawing.Color.Red; } D_LastQueued.Text = user.SystemDuplicationAccount.systemDuplication_LastMsgQueued.ToUkTime(false); D_MsgSent.Text = user.SystemDuplicationAccount.systemDuplication_MsgSent.ToString(); break; default: sectionWrong.Visible = true; X_Status.Text = Data_AppUserFile.GetNiceStatusText(user.AccountStatus); break; } } } } catch (DataUnavailableException) { DSSwitch.OnDataUnavailableException(this); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { // first page load SessionData sd = ConstantStrings.GetSessionData(Session); string root = HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority) + ResolveUrl("~/"); if (sd.LoggonOnUserIsAdmin) { // admin User_Admin.Text = User_Admin.Text .Replace("{_TheUserName_}", sd.LoggedOnUserName) .Replace("{_root_}", root); User_LoggedIn.Visible = false; User_Unknown.Visible = false; User_Admin.Visible = true; TheHeader.Style.Add(HtmlTextWriterStyle.BackgroundColor, "red"); } else if (sd.LoggedOnUserEmail != null) { // user is logged on User_LoggedIn.Text = User_LoggedIn.Text .Replace("{_TheUserName_}", sd.LoggedOnUserName) .Replace("{_root_}", root); User_LoggedIn.Visible = true; User_Unknown.Visible = false; User_Admin.Visible = false; } else { // no user logged on User_Unknown.Text = User_Unknown.Text.Replace("{_root_}", root); User_LoggedIn.Visible = false; User_Unknown.Visible = true; User_Admin.Visible = false; } // myMessage if (!String.IsNullOrEmpty(sd.QuickMessage)) { // message exists if (sd.QuickMessageGood) { XmlHelper xh = new XmlHelper(); xh.AddRootElemet("br", "", ""); xh.AddRootElemet("div", "class", "text-primary").InnerXml = "<h3>" + sd.QuickMessage + "</h3>"; myMessage.Text = xh.ToString(); myMessage.Visible = true; } else { XmlHelper xh = new XmlHelper(); xh.AddRootElemet("br", "", ""); xh.AddRootElemet("div", "class", "text-danger").InnerXml = "<h3>" + sd.QuickMessage + "</h3>"; myMessage.Text = xh.ToString(); myMessage.Visible = true; } sd.QuickMessage = null; } else { // No quick message myMessage.Text = ""; myMessage.Visible = false; } } }