/// <summary> /// Returns if the ProductID is valid (must be a 6-digit and start with 10, 11, 12, or 13) /// </summary> /// <returns>true if valid</returns> public bool Validate() { string starts = ProductID.ToString().Substring(0, 2); return(ProductID.ToString().Length == 6 && (starts == "10" || starts == "11" || starts == "12" || starts == "13")); }
public void mostrarDatos() { txtCodigo.Text = ProductID.ToString(); txtNombredelProducto.Text = ProductName; txtPrecio.Text = UnitPrice.ToString(); txtStock.Text = UnitsInStock.ToString(); }
/// <summary> /// Handles the UniGrid's OnAction event. /// </summary> /// <param name="actionName">Name of item (button) that throws event</param> /// <param name="actionArgument">ID (value of Primary key) of corresponding data row</param> protected void UniGrid_OnAction(string actionName, object actionArgument) { if (actionName.ToLowerCSafe() == "edit") { string editUrl = "Product_Edit_VolumeDiscount_Edit.aspx"; editUrl = URLHelper.AddParameterToUrl(editUrl, "productID", ProductID.ToString()); editUrl = URLHelper.AddParameterToUrl(editUrl, "volumeDiscountID", Convert.ToString(actionArgument)); editUrl = URLHelper.AddParameterToUrl(editUrl, "siteId", SiteID.ToString()); editUrl = URLHelper.AddParameterToUrl(editUrl, "dialog", QueryHelper.GetString("dialog", "0")); URLHelper.Redirect(AddNodeIDParameterToUrl(editUrl)); } else if (actionName.ToLowerCSafe() == "delete") { SKUInfo sku = SKUInfoProvider.GetSKUInfo(ProductID); if (sku == null) { return; } if (CheckProductModifyAndRedirect(sku)) { // Delete VolumeDiscountInfo object from database VolumeDiscountInfoProvider.DeleteVolumeDiscountInfo(Convert.ToInt32(actionArgument)); } } }
public override string ToString() { return(string.Concat(new string[] { "SupplierID: ", SupplierID.ToString(), "ProductID: ", ProductID.ToString(), "Date First Supplied: ", DateFirstSupplied.ToString() })); }
public override string ToString() { return(String.Concat(new string[] { " ProductID:", ProductID.ToString(), " Description ", Description, " Quantity: ", QTY.ToString(), " Unit Price: ", UnitPrice.ToString(), " CategoryID: ", CategoryID.ToString() })); }
public override string ToString() { return(String.Concat("Product ID : ", ProductID.ToString(), ", Description : ", Description.ToString(), ", Quanity in Stock : ", QuantityInStock.ToString(), ", Unit Price :", UnitPrice.ToString(), ", Category Id : ", CategoryID.ToString() )); }
protected override string[] GetContent() { return(new[] { ID.ToString(), ProductNumber.ToString(), ProductID.ToString(), ContextID.ToString() }); }
public void SaveTo(XmlTextWriter xw) { xw.WriteAttributeString("type", MappedType.ToString()); xw.WriteAttributeString("source", Source.ToString()); xw.WriteAttributeString("uuid", UUID.ToString()); if (Source == SourceType.RawInput) { xw.WriteAttributeString("vid", VendorID.ToString("X")); xw.WriteAttributeString("pid", ProductID.ToString("X")); xw.WriteAttributeString("rpt_hash", ReportHash.ToString()); xw.WriteAttributeString("idx", DeviceIndex.ToString()); } else if (Source == SourceType.XInput) { xw.WriteAttributeString("idx", DeviceIndex.ToString()); } else if (Source == SourceType.MUNIA) { xw.WriteAttributeString("devicepath", DevicePath); } else if (Source == SourceType.Arduino) { xw.WriteAttributeString("arduino_port", ArduinoPort.Name); xw.WriteAttributeString("arduino_type", ArduinoSource.ToString()); } xw.WriteStartElement("buttons"); foreach (var btn in ButtonMaps) { btn.SaveTo(xw); } xw.WriteEndElement(); xw.WriteStartElement("axes"); foreach (var axis in AxisMaps) { axis.SaveTo(xw); } xw.WriteEndElement(); xw.WriteStartElement("buttons_to_axis"); foreach (var btn in ButtonToAxisMaps) { btn.SaveTo(xw); } xw.WriteEndElement(); xw.WriteStartElement("axis_to_buttons"); foreach (var axis in AxisToButtonMaps) { axis.SaveTo(xw); } xw.WriteEndElement(); }
protected void AllSize_Transferred(object sender, RadListBoxTransferredEventArgs e) { var DestinationListBox = e.DestinationListBox; string ProductID; ProductID = Request.QueryString["pi"]; var oProductOfLength = new ProductOfLength(); foreach (RadListBoxItem item in e.Items) { if (DestinationListBox.ID == "lstAllSize") { string ProSizeID; ProSizeID = item.Value.ToString(); //Update ProductFormSize Status //var dv = new Product_Size().Product_SizeSelectAll(ProductID, SizeID, "", "", "", "", "").DefaultView; var dv = oProductOfLength.ProductOfLengthSelectOne(ProSizeID).DefaultView; if (dv.Table.Rows.Count > 0) { oProductOfLength.ProductOfLengthDelete(ProSizeID); } } else if (DestinationListBox.ID == "lstChoosedSize") { //Insert ProductFormSize var selectedItem = e.DestinationListBox.FindItemByValue(item.Value); string ProductSizeID = item.Value; var dv = oProductOfLength.ProductOfLengthSelectAll("", "", "True", ProductID, ProductSizeID).DefaultView; var lblName = (Label)selectedItem.FindControl("lblName"); var txtPriority = (RadNumericTextBox)selectedItem.FindControl("txtPriority"); if (dv.Table.Rows.Count > 0) { //if (dv[0]["IsAvailable"].ToString() != "True") //{ // oProductOfLength.ProductOfLengthQuickUpdate(dv[0]["ProductOfLengthID"].ToString(), "true", ""); //} if (lblName != null) { lblName.Text = item.Text; } if (dv[0]["Priority"] != DBNull.Value) { txtPriority.Value = Convert.ToInt32(dv[0]["Priority"]); } } else { oProductOfLength.ProductOfLengthInsert("True", txtPriority.Text, ProductID.ToString(), ProductSizeID.ToString()); } } } DataBindListBoxSize(); }
public bool canFinish(object o) { if (string.IsNullOrEmpty(ProductID.ToString()) || string.IsNullOrEmpty(Quantity.ToString())) { return(false); } else { return(true); } }
public override List <string> InitTraitsList() { var list = new List <string> { ProductID.ToString(), Price.ToString(), Name, Origin }; return(list); }
private bool CheckProductIsAddedAlready(int productID) { foreach (DataGridViewRow Row in dgvSales.Rows) { if (Row.Cells["ProductID"].Value.ToString() == ProductID.ToString()) { RowIndex = Row.Index; return(true); } } return(false); }
public override List <string> InitTraitsList() { var list = new List <string>(); list.Add(ProductID.ToString()); list.Add(Price.ToString()); list.Add(Name); list.Add(Origin); list.Add(IsBowIncluded.ToString()); return(list); }
/// <summary> /// Handles the UniGrid's OnAction event. /// </summary> /// <param name="actionName">Name of item (button) that throws event</param> /// <param name="actionArgument">ID (value of Primary key) of corresponding data row</param> protected void UniGrid_OnAction(string actionName, object actionArgument) { if (actionName.ToLowerInvariant() == "edit") { string editUrl = "Product_Edit_VolumeDiscount_Edit.aspx"; editUrl = URLHelper.AddParameterToUrl(editUrl, "productID", ProductID.ToString()); editUrl = URLHelper.AddParameterToUrl(editUrl, "volumeDiscountID", Convert.ToString(actionArgument)); editUrl = URLHelper.AddParameterToUrl(editUrl, "siteId", SiteID.ToString()); editUrl = URLHelper.AddParameterToUrl(editUrl, "dialog", QueryHelper.GetString("dialog", "0")); URLHelper.Redirect(UrlResolver.ResolveUrl(AddNodeIDParameterToUrl(editUrl))); } }
protected override string[] GetContent() { return(new[] { ID.ToString(), SpotTime.ToShortDateString(), Price.ToString(), ValueContextID.ToString(), ProductID.ToString(), SupplierID.ToString(), DescriptionID.ToString() }); }
protected void Page_Load(object sender, EventArgs e) { if (Product != null) { CheckEditedObjectSiteID(Product.SKUSiteID); } if (!URLHelper.IsPostback()) { // Show confirmation message after generation of variants on generation page was successful if (QueryHelper.GetBoolean("saved", false)) { ShowConfirmation(GetString("com.variants.generated")); } } // Setup help object options = new { helpName = "lnkProductEditHelp", helpUrl = UIContextHelper.GetDocumentationTopicUrl(HELP_TOPIC_LINK) }; ScriptHelper.RegisterModule(this, "CMS/DialogContextHelpChange", options); // Setup asynchronous control SetupControl(); // Init action selection InitBulkActionDropdownLists(); string warningMessage = VariantsCanBeGenerated(); if (string.IsNullOrEmpty(warningMessage)) { string url = "~/CMSModules/Ecommerce/Pages/Tools/Products/Variant_New.aspx"; url = URLHelper.AddParameterToUrl(url, "ProductID", ProductID.ToString()); url = URLHelper.AddParameterToUrl(url, "dialog", QueryHelper.GetString("dialog", "0")); // Allow user to generate variants CurrentMaster.HeaderActions.ActionsList.Add(new HeaderAction() { Text = GetString("com.products.newvariant"), RedirectUrl = ResolveUrl(url) }); } else { ShowWarning(warningMessage); } }
public override Product ProductDisplay() { _ = new ConsoleChainer() .DisplayTextInRow(typeof(Violin).Name + "\t") .DisplayTextInRow(ProductID.ToString() + "\t") .DisplayTextInRow(Name + "\t\t") .DisplayTextInRow(Price.ToString() + "\t") .DisplayTextInRow(Origin + "\t\t") .DisplayTextInRow(IsBowIncluded.ToString() + "\t\t") .DisplayTextInRow(IsReserved.ToString() + "\t\t") .DisplayTextInRow(ReservationTime[0] + "/" + ReservationTime[1] + "/" + ReservationTime[2]) .DisplayTextInColumn(""); return(this); }
/// <summary> /// Initializes the master page elements. /// </summary> private void InitializeMasterPage() { string newUrl = "~/CMSModules/Ecommerce/Pages/Tools/Products/Product_Edit_VolumeDiscount_Edit.aspx"; newUrl = URLHelper.AddParameterToUrl(newUrl, "ProductID", ProductID.ToString()); newUrl = URLHelper.AddParameterToUrl(newUrl, "siteId", SiteID.ToString()); newUrl = URLHelper.AddParameterToUrl(newUrl, "dialog", QueryHelper.GetString("dialog", "0")); // Set new volume discount action CurrentMaster.HeaderActions.ActionsList.Add(new HeaderAction { Text = GetString("Product_Edit_VolumeDiscount_List.NewItemCaption"), RedirectUrl = AddNodeIDParameterToUrl(newUrl) }); }
public override Product ProductDisplay() { var chainer = new ConsoleChainer(); chainer .DisplayTextInRow(typeof(Guitar).Name + "\t") .DisplayTextInRow(ProductID.ToString() + "\t") .DisplayTextInRow(Name + "\t\t") .DisplayTextInRow(Price.ToString() + "\t") .DisplayTextInRow(Origin + "\t\t") .DisplayTextInRow("NaN\t\t") .DisplayTextInRow(IsReserved.ToString() + "\t\t") .DisplayTextInRow(ReservationTime[0] + "/" + ReservationTime[1] + "/" + ReservationTime[2]) .DisplayTextInColumn(""); return(this); }
public XElement Serialize() { var xel = new XElement("Joystick", new XAttribute("Name", Name), new XAttribute("Code", Code), new XAttribute("VendorID", VendorID.ToString("X4")), new XAttribute("ProductID", ProductID.ToString("X4")), new XAttribute("ReportStructure", ReportStructure ?? ""), new XAttribute("ID", ID)); foreach (var joystickControl in __Controls) { xel.Add(joystickControl.Serialize()); } return(xel); }
///<summary> ///Returns a <see cref="T:System.String"/> that represents the current <see cref="UsbDeviceDescriptor"/>. ///</summary> /// ///<param name="prefixSeperator">The field prefix string.</param> ///<param name="entitySperator">The field/value seperator string.</param> ///<param name="suffixSeperator">The value suffix string.</param> ///<returns>A formatted representation of the <see cref="UsbDeviceDescriptor"/>.</returns> public string ToString(string prefixSeperator, string entitySperator, string suffixSeperator) { Object[] values = { Length, DescriptorType, "0x" + BcdUsb.ToString("X4"), Class, "0x" + SubClass.ToString("X2"), "0x" + Protocol.ToString("X2"), MaxPacketSize0, "0x" + VendorID.ToString("X4"), "0x" + ProductID.ToString("X4"), "0x" + BcdDevice.ToString("X4"), ManufacturerStringIndex, ProductStringIndex, SerialStringIndex, ConfigurationCount }; string[] names = { "Length", "DescriptorType", "BcdUsb", "Class", "SubClass", "Protocol", "MaxPacketSize0", "VendorID", "ProductID", "BcdDevice", "ManufacturerStringIndex", "ProductStringIndex", "SerialStringIndex", "ConfigurationCount" }; return(Helper.ToString(prefixSeperator, names, entitySperator, values, suffixSeperator)); }
private void ctlAsyncLog_OnFinished(object sender, EventArgs e) { if (!String.IsNullOrEmpty(CurrentWarning)) { RedirectTo("warning", CurrentWarning); } if (!String.IsNullOrEmpty(CurrentError)) { RedirectTo("error", CurrentError); } var url = "~/CMSModules/Ecommerce/Pages/Tools/Products/Product_Edit_Variants.aspx"; url = URLHelper.AddParameterToUrl(url, "saved", "1"); url = URLHelper.AddParameterToUrl(url, "productID", ProductID.ToString()); url = URLHelper.AddParameterToUrl(url, "dialog", QueryHelper.GetString("dialog", "0")); // If generation of variant was successful redirect user to the variant listing of parent product URLHelper.Redirect(url); }
private void ugVariants_OnAction(string actionName, object actionArgument) { if (string.IsNullOrEmpty(actionName)) { return; } int variantID = ValidationHelper.GetInteger(actionArgument, 0); switch (actionName.ToLowerInvariant()) { case "edit": string url = "~/CMSModules/Ecommerce/Pages/Tools/Products/Product_Edit_Variant_Edit.aspx"; url = URLHelper.AddParameterToUrl(url, "variantid", variantID.ToString()); url = URLHelper.AddParameterToUrl(url, "productId", ProductID.ToString()); url = URLHelper.AddParameterToUrl(url, "dialog", QueryHelper.GetString("dialog", "0")); URLHelper.Redirect(url); break; case "delete": // Check modify permission for parent product CheckProductModifyAndRedirect(Product); SKUInfo variantInfo = SKUInfoProvider.GetSKUInfo(variantID); if (variantInfo == null) { break; } // Try to delete variant and display warning in case it was disabled if (!DeleteVariant(variantInfo)) { // Inform user that variant was disabled ShowWarning(GetString("com.product.edit.disableonevariant")); } break; } }
public virtual bool VisibleFor(Feed feed, object data, Guid userId) { return(WebItemSecurity.IsAvailableForUser(ProductID.ToString(), userId)); }
public override string ToString() { return(ProductNumber + " (" + ProductID.ToString() + ")"); }
public void Dispose() { _AllList.Remove(this); _AllByPrimaryKey.Remove(OrderID.ToString() + "_" + ProductID.ToString()); }
protected void editOptionCategory_OnAfterSave(object sender, EventArgs e) { if (EditedCategory == null) { EditedObject = null; return; } // New option category if (!Editing) { // For new TEXT option category create text option if (SelectedCategoryType == OptionCategoryTypeEnum.Text) { CreateTextOption(); } // Assign option category to product if (ParentProduct != null) { SKUOptionCategoryInfo.Provider.Add(EditedCategory.CategoryID, ParentProduct.SKUID); } // Redirect from new form dialog to option category edit. string query = QueryHelper.BuildQuery("saved", "1", "productid", ProductID.ToString(), "siteid", CategorySiteID.ToString()); if (ParentProduct == null) { URLHelper.Redirect(UIContextHelper.GetElementUrl(ModuleName.ECOMMERCE, "EditOptionCategory", false, EditedCategory.CategoryID, query)); } else { URLHelper.Redirect(ApplicationUrlHelper.GetElementDialogUrl(ModuleName.ECOMMERCE, "EditProductOptionCategory", EditedCategory.CategoryID, query)); } } if (Editing) { // Refresh breadcrumbs var append = EditedCategory.IsGlobal ? " " + GetString("general.global") : ""; ScriptHelper.RefreshTabHeader(Page, EditedCategory.CategoryDisplayName + append); // Category options DataSet options = SKUInfoProvider.GetSKUOptions(EditedCategory.CategoryID, false); // Option category type may be changed during editing and additional action is required switch (SelectedAdditionalAction) { case AdditionalActionEnum.DeleteOptionsAndCreateTextOption: DestroyOptions(options); CreateTextOption(); break; case AdditionalActionEnum.DeleteTextOption: DestroyOptions(options); CategoryHasOptions = false; break; case AdditionalActionEnum.ConvertAttributeToProduct: ChangeAttributeToProduct(options); break; case AdditionalActionEnum.ConvertProductToAttribute: ChangeProductToAttribute(options); break; case AdditionalActionEnum.None: break; } editOptionCategory.SubmitButton.OnClientClick = ""; } }
public override void FillCongressVotingArguments(CongressVoting voting) { voting.Argument1 = CompanyName; voting.Argument2 = RegionID.ToString(); voting.Argument3 = ProductID.ToString(); }
object categoryGrid_OnExternalDataBound(object sender, string sourceName, object parameter) { OptionCategoryInfo category; // Formatting columns switch (sourceName.ToLowerCSafe()) { case "categorydisplayname": category = OptionCategoryInfo.Provider.Get(ValidationHelper.GetInteger(parameter, 0)); return(HTMLHelper.HTMLEncode(category.CategoryFullName)); case "categorytype": return(EnumStringRepresentationExtensions.ToEnum <OptionCategoryTypeEnum>(ValidationHelper.GetString(parameter, "")).ToLocalizedString("com.optioncategorytype")); case "optionscounts": category = OptionCategoryInfo.Provider.Get(ValidationHelper.GetInteger(parameter, 0)); if (category.CategoryType != OptionCategoryTypeEnum.Text) { var tr = new ObjectTransformation("OptionsCounts", category.CategoryID) { DataProvider = countsDataProvider, Transformation = "{% if(AllowAllOptions) { GetResourceString(\"general.all\") } else { FormatString(GetResourceString(\"com.ProductOptions.availableXOfY\"), SelectedOptions, AllOptions) } %}", NoDataTransformation = "{$com.productoptions.nooptions$}", EncodeOutput = false }; return(tr); } return(""); case "edititem": category = new OptionCategoryInfo(((DataRowView)((GridViewRow)parameter).DataItem).Row); CMSGridActionButton btn = sender as CMSGridActionButton; // Disable edit button if category is global and global categories are NOT allowed if (btn != null) { if (!allowedGlobalCat && category.IsGlobal) { btn.Enabled = false; } var query = QueryHelper.BuildQuery("siteId", category.CategorySiteID.ToString(), "productId", ProductID.ToString()); string redirectUrl = ApplicationUrlHelper.GetElementDialogUrl(ModuleName.ECOMMERCE, "EditProductOptionCategory", category.CategoryID, query); btn.OnClientClick = "modalDialog('" + redirectUrl + "','categoryEdit', '1000', '800');"; } break; case "selectoptions": category = new OptionCategoryInfo(((DataRowView)((GridViewRow)parameter).DataItem).Row); CMSGridActionButton btnSelect = sender as CMSGridActionButton; if (btnSelect != null) { // Disable select button if category is type of Text if (category.CategoryType == OptionCategoryTypeEnum.Text) { btnSelect.Enabled = false; } else { var query = QueryHelper.BuildQuery("productId", ProductID.ToString()); // URL of allowed option selector pop-up string urlSelect = ApplicationUrlHelper.GetElementDialogUrl(ModuleName.ECOMMERCE, "ProductOptions.SelectOptions", category.CategoryID, query); // Open allowed options selection dialog btnSelect.OnClientClick = ScriptHelper.GetModalDialogScript(urlSelect, "selectoptions", 1000, 650); } } break; } return(parameter); }
private string CreateYaml() { StringBuilder sb = new StringBuilder(); sb.Append("product-id: ").AppendLine(ProductID.ToString()); sb.Append("media-path: ").AppendLine($"{MediaPath}/%s"); if (!string.IsNullOrWhiteSpace(Language)) { sb.Append("gme-lang: ").AppendLine(Language.ToString()); } if (!string.IsNullOrWhiteSpace(Comment)) { sb.Append("comment: ").AppendLine(Comment.ToString()); } if (!string.IsNullOrWhiteSpace(Welcome)) { sb.Append("welcome: ").AppendLine(Welcome.ToString()); } if (oIDRegisters.Count > 0) { sb.Append("init: "); foreach (var item in oIDRegisters) { sb.Append(item.Init); } sb.AppendLine(""); } sb.AppendLine("scripts: "); foreach (var item in nodeSetups.Where(x => x.Node != null && x.Node.oIDSequences.Count > 0)) { sb.AppendLine($" o_{item.Node.GetNodeCode()}"); } if (SpeakObjects.Count > 0) { sb.AppendLine("speak: "); var queryLang = from speaks in SpeakObjects group speaks by speaks.Lang into newGroup orderby newGroup.Key select newGroup; foreach (var langGroup in queryLang) { sb.AppendLine($"- language: {langGroup.Key}"); foreach (var item in langGroup) { sb.AppendLine($" sp_{item.createSpeakString()}"); } } foreach (var item in SpeakObjects.GroupBy(x => x.Lang)) { } } if (nodeSetups.Count > 0) { sb.AppendLine("scriptcodes: "); foreach (var item in nodeSetups) { sb.AppendLine($" {item.ScriptCode}"); } } return(sb.ToString()); }