Esempio n. 1
0
        private void SaveRecord()
        {
            long   lngProductGroupID    = long.Parse(cboProductGroup.SelectedItem.Value);
            long   lngProductSubGroupID = long.Parse(cboProductSubGroup.SelectedItem.Value);
            long   lngProductID         = long.Parse(cboProductCode.SelectedItem.Value);
            long   lngVariationID       = long.Parse(cboVariationType.SelectedItem.Value);
            string javaScript           = "";

            if (lngVariationID == 0)
            {
                javaScript = "window.alert('Please select at least one variation to add.')";
                System.Web.UI.ScriptManager.RegisterClientScriptBlock(this.updSave, this.updSave.GetType(), "openwindow", javaScript, true);
            }
            else
            {
                ProductVariations clsProductVariation = new ProductVariations();
                clsProductVariation.AddEasyVariation(lngProductGroupID, lngProductSubGroupID, lngProductID, lngVariationID, Convert.ToString(Session["Name"]));
                clsProductVariation.CommitAndDispose();

                javaScript = "window.alert('Variation has been saved.')";
                System.Web.UI.ScriptManager.RegisterClientScriptBlock(this.updSave, this.updSave.GetType(), "openwindow", javaScript, true);
            }
        }