Example #1
0
        public XmlDocument ToXmlDoc()
        {
            XmlDocument doc   = new XmlDocument();
            XmlElement  docEl = _licUtils.CreateLicElement(doc, PragmaLicElements.PragmaLicense);

            doc.AppendChild(docEl);

            XmlElement e = _licUtils.CreateLicElement(doc, PragmaLicElements.Product);

            e.InnerText = _product.ToString();
            docEl.AppendChild(e);

            e           = _licUtils.CreateLicElement(doc, PragmaLicElements.ProductCodeName);
            e.InnerText = _productCodeName.ToString();
            docEl.AppendChild(e);

            e           = _licUtils.CreateLicElement(doc, PragmaLicElements.ActivationKey);
            e.InnerText = _activationKey;
            docEl.AppendChild(e);

            e           = _licUtils.CreateLicElement(doc, PragmaLicElements.LicType);
            e.InnerText = _licType.ToString();
            docEl.AppendChild(e);

            e           = _licUtils.CreateLicElement(doc, PragmaLicElements.PurchaseType);
            e.InnerText = _purchaseType.ToString();
            docEl.AppendChild(e);

            e           = _licUtils.CreateLicElement(doc, PragmaLicElements.ValidFrom);
            e.InnerText = !_validFrom.HasValue ? String.Empty : GetSimpleDate(_validFrom.Value);
            docEl.AppendChild(e);

            e           = _licUtils.CreateLicElement(doc, PragmaLicElements.ValidTo);
            e.InnerText = !_validTo.HasValue ? String.Empty : GetSimpleDate(_validTo.Value);
            docEl.AppendChild(e);



            e           = _licUtils.CreateLicElement(doc, PragmaLicElements.MachineKey);
            e.InnerText = _machineKey.Key;
            docEl.AppendChild(e);

            e           = _licUtils.CreateLicElement(doc, PragmaLicElements.MachineIdType);
            e.InnerText = _machineIdType.ToString();
            docEl.AppendChild(e);


            e           = _licUtils.CreateLicElement(doc, PragmaLicElements.EMail);
            e.InnerText = _email;
            docEl.AppendChild(e);

            return(doc);
        }
Example #2
0
        private bool GetLicData(oExcel.Worksheet oxlsheet)
        {
            LicType = SEFDataValidation.GetlicType(Convert.ToString(((oExcel.Range)oxlsheet.Cells[GrdRow, 3]).Text));

            //IssueDate

            ColoumName.Add("IssueDate", SEFDataValidation.RevDate(Convert.ToString(((oExcel.Range)oxlsheet.Cells[GrdRow, 2]).Text)));
            ColoumName.Add("OrderType", Convert.ToString(((oExcel.Range)oxlsheet.Cells[GrdRow, 3]).Text));
            OrderList.Add(LicType.ToString());
            OrderList.Add(Convert.ToString(((oExcel.Range)oxlsheet.Cells[GrdRow, 4]).Value2));
            //orderDate
            OrderList.Add(SEFDataValidation.RevDate(Convert.ToString(((oExcel.Range)oxlsheet.Cells[GrdRow, 5]).Text)));
            for (int x = 0; x < OrderList.Count; x++)
            {
                if (string.IsNullOrWhiteSpace(OrderList[x]) || string.IsNullOrEmpty(OrderList[x]))
                {
                    OrderList[x] = "0";
                }
            }
            return(true);
        }