private void initializeMainTable() { MainTable = new List <List <object> >(); MainTable.Add(new List <object> { new { text = OfferType, colSpan = 4, bold = true, fontSize = 14, fillColor = "#EEE" }, new { }, new { }, new { } }); MainTable.Add(new List <object> { new { text = CompanyName, colSpan = 3, bold = true, fillColor = "#EEE" }, new { }, new { }, new { text = (BidReceivedDate == null) ? "-" : BidReceivedDate?.ToString("dd-MM-yy"), fillColor = "#EEE" } }); MainTable.Add(new List <object> { new { text = "", colSpan = 2, bold = true, fillColor = "#EEE" }, new { }, "Expiry: ", (ExpiryDate == null) ? "-" : ExpiryDate?.ToString("dd-MM-yy") }); MainTable.Add(new List <object> { new { text = "", colSpan = 2, bold = true, fillColor = "#EEE" }, new { }, "Reference Number: ", ReferenceNumber ?? "-" }); if (VendorResponse == VendorResponse.Responded) { MainTable.Add(new List <object> { new { text = "Description", bold = true }, new { text = "Quantity", bold = true }, new { text = "Unit Price", bold = true }, new { text = "Total", bold = true } }); var i = 0; foreach (var item in ScopeItems) { List <object> row = new List <object>(); row.Add((++i).ToString() + ". " + item.Description); row.Add(item.Quantity); row.Add(item.UnitPrice.ToString()); row.Add(item.TotalPrice.ToString()); MainTable.Add(row); } i = 0; } else { MainTable.Add(new List <object> { new { text = "Description", bold = true }, new { text = "Quantity", bold = true }, new { text = "Unit Price", bold = true }, new { text = "Total", bold = true } }); MainTable.Add(new List <object> { new { colSpan = 4, rowSpan = 4, alignment = "center", text = BriefDescription }, new { }, new { }, new { } }); } _mainRows = MainTable.Count; }
public override string ToString() { return(ExpiryDate.ToString()); }
public override string ToString() { return(base.ToString() + "Kortets udløbsdato: " + ExpiryDate.ToString("MM/yy") + "\n" + "Månedlig grænse: " + MonthlyLimit + "\n"); }
/// <summary> /// Overrides the ToString() method to show the info of the object /// </summary> /// <returns></returns> public override string ToString() { return(base.ToString() + $" MonthlyLimit: {MonthlyLimit}. Expiry Date: {ExpiryDate.ToString("MM/yy")}. Credit limit: {CreditLimit}. Daily limit: {DailyLimit}"); }
private bool IsFormValid() { if ((!string.IsNullOrEmpty(NameOnCard)) && (!string.IsNullOrEmpty(CardNumber)) && (!string.IsNullOrEmpty(CVC)) && (!string.IsNullOrEmpty(ExpiryDate)) && (!string.IsNullOrEmpty(ZipCode))) { Regex nameRegex = new Regex(@"^[\w\s]*$"); Regex monthRegex = new Regex(@"^(0[1-9]|1[0-2])$"); Regex yearRegex = new Regex(@"^(19|20)\d{2}$"); if (!nameRegex.IsMatch(NameOnCard)) { Message = "Name is invalid"; return(false); } if ((CardNumber.Length < 15) || (CardNumber.Length > 16)) { Message = "Credit card number length is invalid"; return(false); } if (!long.TryParse(CardNumber, out _cardNumberLong)) { Message = "Credit card number is invalid"; return(false); } if (!CVC.Length.Equals(3)) { Message = "CVC is inavlid"; return(false); } if (!Int32.TryParse(CVC, out _cvcInt)) { Message = "CVC is invalid"; return(false); } if (ExpiryDate.Contains("/")) { string month = ExpiryDate.Split('/')[0]; string year = ExpiryDate.Split('/')[1]; if ((!monthRegex.IsMatch(month)) || (!yearRegex.IsMatch(year))) { Message = "Invalid expiration date"; return(false); } else { if ((!Int32.TryParse(month, out int monthInt)) || (!Int32.TryParse(year, out int yearInt))) { Message = "Invalid expiration date"; return(false); } } } else { Message = "Invalid expiration date"; return(false); } if (!ZipCode.Length.Equals(5)) { Message = "Zip Code length is invalid"; return(false); } if (!Int32.TryParse(ZipCode, out _zipCodeInt)) { Message = "Zip Code is invalid"; return(false); } Message = string.Empty; return(true); } else { return(false); } }
public string GetProperty(string propertyName, string format, CultureInfo formatProvider, UserInfo accessingUser, Scope accessLevel, ref bool propertyNotFound) { var outputFormat = string.Empty; if (format == string.Empty) { outputFormat = "g"; } var lowerPropertyName = propertyName.ToLowerInvariant(); if (accessLevel == Scope.NoSettings) { propertyNotFound = true; return(PropertyAccess.ContentLocked); } propertyNotFound = true; var result = string.Empty; var isPublic = true; switch (lowerPropertyName) { case "url": propertyNotFound = false; result = PropertyAccess.FormatString(PortalAlias.HTTPAlias, format); break; case "fullurl": //return portal alias with protocol propertyNotFound = false; result = PropertyAccess.FormatString(Globals.AddHTTP(PortalAlias.HTTPAlias), format); break; case "passwordreminderurl": //if regsiter page defined in portal settings, then get that page url, otherwise return home page. propertyNotFound = false; var reminderUrl = Globals.AddHTTP(PortalAlias.HTTPAlias); if (RegisterTabId > Null.NullInteger) { reminderUrl = Globals.RegisterURL(string.Empty, string.Empty); } result = PropertyAccess.FormatString(reminderUrl, format); break; case "portalid": propertyNotFound = false; result = (PortalId.ToString(outputFormat, formatProvider)); break; case "portalname": propertyNotFound = false; result = PropertyAccess.FormatString(PortalName, format); break; case "homedirectory": propertyNotFound = false; result = PropertyAccess.FormatString(HomeDirectory, format); break; case "homedirectorymappath": isPublic = false; propertyNotFound = false; result = PropertyAccess.FormatString(HomeDirectoryMapPath, format); break; case "logofile": propertyNotFound = false; result = PropertyAccess.FormatString(LogoFile, format); break; case "footertext": propertyNotFound = false; var footerText = FooterText.Replace("[year]", DateTime.Now.Year.ToString()); result = PropertyAccess.FormatString(footerText, format); break; case "expirydate": isPublic = false; propertyNotFound = false; result = (ExpiryDate.ToString(outputFormat, formatProvider)); break; case "userregistration": isPublic = false; propertyNotFound = false; result = (UserRegistration.ToString(outputFormat, formatProvider)); break; case "banneradvertising": isPublic = false; propertyNotFound = false; result = (BannerAdvertising.ToString(outputFormat, formatProvider)); break; case "currency": propertyNotFound = false; result = PropertyAccess.FormatString(Currency, format); break; case "administratorid": isPublic = false; propertyNotFound = false; result = (AdministratorId.ToString(outputFormat, formatProvider)); break; case "email": propertyNotFound = false; result = PropertyAccess.FormatString(Email, format); break; case "hostfee": isPublic = false; propertyNotFound = false; result = (HostFee.ToString(outputFormat, formatProvider)); break; case "hostspace": isPublic = false; propertyNotFound = false; result = (HostSpace.ToString(outputFormat, formatProvider)); break; case "pagequota": isPublic = false; propertyNotFound = false; result = (PageQuota.ToString(outputFormat, formatProvider)); break; case "userquota": isPublic = false; propertyNotFound = false; result = (UserQuota.ToString(outputFormat, formatProvider)); break; case "administratorroleid": isPublic = false; propertyNotFound = false; result = (AdministratorRoleId.ToString(outputFormat, formatProvider)); break; case "administratorrolename": isPublic = false; propertyNotFound = false; result = PropertyAccess.FormatString(AdministratorRoleName, format); break; case "registeredroleid": isPublic = false; propertyNotFound = false; result = (RegisteredRoleId.ToString(outputFormat, formatProvider)); break; case "registeredrolename": isPublic = false; propertyNotFound = false; result = PropertyAccess.FormatString(RegisteredRoleName, format); break; case "description": propertyNotFound = false; result = PropertyAccess.FormatString(Description, format); break; case "keywords": propertyNotFound = false; result = PropertyAccess.FormatString(KeyWords, format); break; case "backgroundfile": propertyNotFound = false; result = PropertyAccess.FormatString(BackgroundFile, format); break; case "admintabid": isPublic = false; propertyNotFound = false; result = AdminTabId.ToString(outputFormat, formatProvider); break; case "supertabid": isPublic = false; propertyNotFound = false; result = SuperTabId.ToString(outputFormat, formatProvider); break; case "splashtabid": isPublic = false; propertyNotFound = false; result = SplashTabId.ToString(outputFormat, formatProvider); break; case "hometabid": isPublic = false; propertyNotFound = false; result = HomeTabId.ToString(outputFormat, formatProvider); break; case "logintabid": isPublic = false; propertyNotFound = false; result = LoginTabId.ToString(outputFormat, formatProvider); break; case "registertabid": isPublic = false; propertyNotFound = false; result = RegisterTabId.ToString(outputFormat, formatProvider); break; case "usertabid": isPublic = false; propertyNotFound = false; result = UserTabId.ToString(outputFormat, formatProvider); break; case "defaultlanguage": propertyNotFound = false; result = PropertyAccess.FormatString(DefaultLanguage, format); break; case "users": isPublic = false; propertyNotFound = false; result = Users.ToString(outputFormat, formatProvider); break; case "pages": isPublic = false; propertyNotFound = false; result = Pages.ToString(outputFormat, formatProvider); break; case "contentvisible": isPublic = false; break; case "controlpanelvisible": isPublic = false; propertyNotFound = false; result = PropertyAccess.Boolean2LocalizedYesNo(ControlPanelVisible, formatProvider); break; } if (!isPublic && accessLevel != Scope.Debug) { propertyNotFound = true; result = PropertyAccess.ContentLocked; } return(result); }
public void Ctor_AssignsValues(long ticks) { var expiryDate = new ExpiryDate(ticks); Assert.Equal(expiryDate.Ticks, ticks); }
public override BLL_Deal ToBLLModel() { BLL_Deal bLL_Deal = new BLL_Deal() { Dealnum = DealNumber, Dealname = DealName, Status = StatusCode, StatusName = Status, Contractnum = ContractNumber, Inceptdate = InceptionDate.ToDate(), Targetdt = TargetDate.ToUniversalDate(), ModelPriority = Priority, Submissiondate = SubmittedDate.ToDate(), Uw1 = PrimaryUnderwriterCode, Uw1Name = PrimaryUnderwriterName, Uw2 = SecondaryUnderwriterCode, Uw2Name = SecondaryUnderwriterName, Ta = TechnicalAssistantCode, TaName = TechnicalAssistantName, Modeller = ModellerCode, ModellerName = ModellerName, Act1 = ActuaryCode, Act1Name = ActuaryName, Expirydate = ExpiryDate.ToDate(), Broker = BrokerCode, BrokerName = BrokerName, BrokerContact = BrokerContactCode, BrokerContactName = BrokerContactName, Cedant = CedantCode, CedantName = CedantName, Continuous = Continuous, Renewal = Renewal, Dealtype = Dealtype, DealtypeName = DealtypeName, Coveragetype = Coveragetype, CoveragetypeName = CoveragetypeName, Policybasis = Policybasis, PolicybasisName = PolicybasisName, Currency = Currency, CurrencyName = CurrencyName, Domicile = Domicile, DomicileName = DomicileName, Region = Region, RegionName = RegionName, CedentLocation = CedentLocation, CedentLocationname = CedentLocationname, BrokerLocation = BrokerLocation, BrokerLocationname = BrokerLocationname, PaperName = PaperName, ExpiryEod = ExpiryEod, Exposuretype = Exposuretype, CedantGroupCode = CedantGroupCode, CedantGroupName = CedantGroupName, BrokerGroupCode = BrokerGroupCode, BrokerGroupName = BrokerGroupName, RenewalName = RenewalName, ChkPreBindProcessing = ChkPreBindProcessing, ChkUWCompliance = ChkUWCompliance, ChkModelling = ChkModelling, decreason = decreason }; return(bLL_Deal); }
public void Should_create_an_instance_if_month_and_year_are_same_of_today() { var expiryDate = ExpiryDate.Create(08, 2019, _dateProvider); expiryDate.Should().NotBeNull(); }
/// <summary> /// ExpiyDate 转换为字符串 /// </summary> /// <returns></returns> public string GetStrExpiryDate() { strExpiryDate = ExpiryDate.ToString("yyyyMMdd"); return(strExpiryDate); }
public void Should_raise_an_error_if_month_and_year_are_before_today() { Action action = () => ExpiryDate.Create(07, 2019, _dateProvider); action.Should().Throw <ValidationException>(); }
public void Should_raise_an_error_if_year_is_before_current_year() { Action action = () => ExpiryDate.Create(08, 2018, _dateProvider); action.Should().Throw <ValidationException>(); }
private void btnAlter_Click(object sender, EventArgs e) { clsUtility.ExecuteSQLQuery(" SELECT * FROM Users WHERE USER_ID = '" + clsUtility.UserID + "' AND Can_Edit = 'Y' "); if (clsUtility.sqlDT.Rows.Count > 0) { /////////////////////////////////////////// if (string.IsNullOrWhiteSpace(this.txtItemID.Text) | string.IsNullOrWhiteSpace(this.txtItemName.Text) | string.IsNullOrWhiteSpace(this.txtUnit.Text) | cmbGroup.SelectedValue == null | cmbGroup.SelectedIndex == -1 | cmbDefaultWarehouse.SelectedValue == null | cmbDefaultWarehouse.SelectedIndex == -1) { errorProvider.SetError(txtItemName, "Required"); errorProvider.SetError(txtUnit, "Required"); errorProvider.SetError(cmbGroup, "Required"); errorProvider.SetError(cmbDefaultWarehouse, "Required"); } else { /////////////////////////////// errorProvider.Clear(); string VATapplicable = null; string Expiry, ExpiryDate; if (chkExp.Checked) { ExpiryDate = dtpExpDate.Value.Date.ToString("yyyy-MM-dd"); Expiry = "Y"; } else { ExpiryDate = ""; Expiry = "N"; } if (cbVATapplicable.Checked) { VATapplicable = "Y"; } else { VATapplicable = "N"; } try { clsUtility.ExecuteSQLQuery(" UPDATE ItemInformation SET ItemName='" + txtItemName.Text + "',UnitOfMeasure='" + txtUnit.Text + "',Batch='" + txtBatch.Text + "',GROUP_ID='" + cmbGroup.SelectedValue.ToString() + "',Barcode='" + txtBarcode.Text + "',Cost='" + clsUtility.num_repl(txtPurchaseCost.Text) + "',Price='" + clsUtility.num_repl(txtSalesPrice.Text) + "',ReorderPoint='" + clsUtility.num_repl(txtReorderPoint.Text) + "',VAT_Applicable='" + VATapplicable + "', WarehouseID = '" + cmbDefaultWarehouse.SelectedValue.ToString() + "' " + " WHERE ITEM_ID ='" + ITEM_ID + "' "); clsUtility.ExecuteSQLQuery("UPDATE Stock SET Quantity='" + clsUtility.num_repl(txtOpeningStock.Text) + "', ExpiryDate='" + ExpiryDate.ToString() + "', WarehouseID='" + cmbWarehouse.SelectedValue.ToString() + "', SHELF_ID='" + clsUtility.fltr_combo(cmbShelf).ToString() + "', Expiry='" + Expiry.ToString() + "' WHERE ITEM_ID ='" + ITEM_ID + "' AND WarehouseID='" + WarehouseID + "' "); UploadImage(txtItemID.Text); btnReset.PerformClick(); txtItemID.Text = ""; clsUtility.MesgBoxShow("msgUpdate", "info"); } catch (Exception ex) { MessageBox.Show(ex.Message); } ////////////////////////////// } /////////////////////////////////////////// } else { clsUtility.MesgBoxShow("msgPermission", "err"); } }
private void btnSubmit_Click(object sender, EventArgs e) { clsUtility.ExecuteSQLQuery(" SELECT * FROM Users WHERE USER_ID = '" + clsUtility.UserID + "' AND Can_Add = 'Y' "); if (clsUtility.sqlDT.Rows.Count > 0) { /////////////////////////////////////////// if (string.IsNullOrWhiteSpace(this.txtItemName.Text) | string.IsNullOrWhiteSpace(this.txtUnit.Text) | cmbGroup.SelectedValue == null | cmbGroup.SelectedIndex == -1 | cmbDefaultWarehouse.SelectedValue == null | cmbDefaultWarehouse.SelectedIndex == -1) { errorProvider.SetError(txtItemName, "Required"); errorProvider.SetError(txtUnit, "Required"); errorProvider.SetError(cmbGroup, "Required"); errorProvider.SetError(cmbDefaultWarehouse, "Required"); } else { string Expiry, ExpiryDate; if (chkExp.Checked) { ExpiryDate = dtpExpDate.Value.Date.ToString("yyyy-MM-dd"); Expiry = "Y"; } else { ExpiryDate = ""; Expiry = "N"; } if (chkAutoBarcode.Checked) { errorProvider.Clear(); string barcode = null; string VATapplicable = null; string ITEM_ID = null; if (cbVATapplicable.Checked) { VATapplicable = "Y"; } else { VATapplicable = "N"; } try { /////////////////////////// clsUtility.ExecuteSQLQuery(" INSERT INTO ItemInformation(ItemName,UnitOfMeasure,Batch,GROUP_ID,Barcode,Cost,Price,ReorderPoint,VAT_Applicable, WarehouseID) VALUES " + " ('" + txtItemName.Text + "','" + txtUnit.Text + "','" + txtBatch.Text + "','" + cmbGroup.SelectedValue.ToString() + "','" + clsUtility.GenarateAutoBarcode(barcode) + "','" + clsUtility.num_repl(txtPurchaseCost.Text) + "','" + clsUtility.num_repl(txtSalesPrice.Text) + "','" + clsUtility.num_repl(txtReorderPoint.Text) + "','" + VATapplicable + "','" + cmbDefaultWarehouse.SelectedValue.ToString() + "') "); clsUtility.ExecuteSQLQuery("SELECT ITEM_ID FROM ItemInformation ORDER BY ITEM_ID DESC"); ITEM_ID = clsUtility.sqlDT.Rows[0]["ITEM_ID"].ToString(); clsUtility.ExecuteSQLQuery(" INSERT INTO Stock(ITEM_ID,Quantity,ExpiryDate,WarehouseID, SHELF_ID, Expiry) VALUES ('" + ITEM_ID + "','" + clsUtility.num_repl(txtOpeningStock.Text) + "','" + ExpiryDate.ToString() + "','" + cmbWarehouse.SelectedValue.ToString() + "', '" + clsUtility.fltr_combo(cmbShelf) + "', '" + Expiry + "') "); UploadImage(ITEM_ID); btnReset.PerformClick(); clsUtility.MesgBoxShow("msgSaved", "info"); /////////////////// } catch (Exception ex) { MessageBox.Show(ex.Message); } } else { if (string.IsNullOrWhiteSpace(this.txtBarcode.Text)) { errorProvider.SetError(txtBarcode, "Required"); } else { errorProvider.Clear(); string VATapplicable = null; if (cbVATapplicable.Checked) { VATapplicable = "Y"; } else { VATapplicable = "N"; } try { string ITEM_ID = null; clsUtility.ExecuteSQLQuery(" INSERT INTO ItemInformation(ItemName,UnitOfMeasure,Batch,GROUP_ID,Barcode,Cost,Price,ReorderPoint,VAT_Applicable, WarehouseID) VALUES " + " ('" + txtItemName.Text + "','" + txtUnit.Text + "','" + txtBatch.Text + "','" + cmbGroup.SelectedValue.ToString() + "','" + txtBarcode.Text + "','" + clsUtility.num_repl(txtPurchaseCost.Text) + "','" + clsUtility.num_repl(txtSalesPrice.Text) + "','" + clsUtility.num_repl(txtReorderPoint.Text) + "','" + VATapplicable + "','" + cmbDefaultWarehouse.SelectedValue.ToString() + "') "); clsUtility.ExecuteSQLQuery("SELECT ITEM_ID FROM ItemInformation ORDER BY ITEM_ID DESC"); ITEM_ID = clsUtility.sqlDT.Rows[0]["ITEM_ID"].ToString(); clsUtility.ExecuteSQLQuery(" INSERT INTO Stock(ITEM_ID,Quantity,ExpiryDate,WarehouseID, SHELF_ID, Expiry) VALUES ('" + ITEM_ID + "','" + clsUtility.num_repl(txtOpeningStock.Text) + "','" + ExpiryDate.ToString() + "','" + cmbWarehouse.SelectedValue.ToString() + "', '" + clsUtility.fltr_combo(cmbShelf) + "', '" + Expiry + "') "); UploadImage(ITEM_ID); btnReset.PerformClick(); clsUtility.MesgBoxShow("msgSaved", "info"); } catch (Exception ex) { MessageBox.Show(ex.Message); } } } } /////////////////////////////////////////// } else { clsUtility.MesgBoxShow("msgPermission", "err"); } }
void Stickers_BeforeWriting(IDatabaseObject item, IDBObjectWritingOptions writingOptions, ref bool cancel) { if (IsModified) { Description = string.Format("{0} - {2}; кол-во - {1}", Nomenclature.Description, Quantity, ExpiryDate.ToString(DATE_FORMAT)); } }