コード例 #1
0
            public override DataTable Clone()
            {
                NodeDataTable cln = ((NodeDataTable)(base.Clone()));

                cln.InitVars();
                return(cln);
            }
コード例 #2
0
 internal void InitVars()
 {
     this.tableNode = ((NodeDataTable)(this.Tables["Node"]));
     if ((this.tableNode != null))
     {
         this.tableNode.InitVars();
     }
 }
コード例 #3
0
 private void InitClass()
 {
     this.DataSetName             = "Nodes";
     this.Prefix                  = "";
     this.Namespace               = "http://tempuri.org/Nodes.xsd";
     this.EnforceConstraints      = true;
     this.SchemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema;
     this.tableNode               = new NodeDataTable();
     base.Tables.Add(this.tableNode);
 }
コード例 #4
0
 private void InitClass()
 {
     this.DataSetName        = "Nodes";
     this.Prefix             = "";
     this.Namespace          = "http://tempuri.org/Nodes.xsd";
     this.Locale             = new System.Globalization.CultureInfo("en-US");
     this.CaseSensitive      = false;
     this.EnforceConstraints = true;
     this.tableNode          = new NodeDataTable();
     this.Tables.Add(this.tableNode);
 }
コード例 #5
0
 internal void InitVars(bool initTable)
 {
     this.tableNode = ((NodeDataTable)(base.Tables["Node"]));
     if ((initTable == true))
     {
         if ((this.tableNode != null))
         {
             this.tableNode.InitVars();
         }
     }
 }
コード例 #6
0
 internal NodeRow(DataRowBuilder rb) :
     base(rb)
 {
     this.tableNode = ((NodeDataTable)(this.Table));
 }
コード例 #7
0
        public EntityNodeData PrepareList()
        {
            EntityNodeData  nodeDatas = new EntityNodeData();
            List <NodeData> nodes     = new List <NodeData>();
            List <NodeLink> linkNodes = new List <NodeLink>();

            if (Request.Files.Count > 0)
            {
                HttpFileCollectionBase files = Request.Files;

                string filename = Path.GetFileName(Request.Files[0].FileName);

                HttpPostedFileBase file = files[0];
                string             fname;
                if (Request.Browser.Browser.ToUpper() == "IE" || Request.Browser.Browser.ToUpper() == "INTERNETEXPLORER")
                {
                    string[] testfiles = file.FileName.Split(new char[] { '\\' });
                    fname = testfiles[testfiles.Length - 1];
                }
                else
                {
                    fname = file.FileName;
                }

                if ((file != null) && (file.ContentLength > 0) && !string.IsNullOrEmpty(file.FileName))
                {
                    string fileName        = file.FileName;
                    string fileContentType = file.ContentType;
                    byte[] fileBytes       = new byte[file.ContentLength];
                    var    data            = file.InputStream.Read(fileBytes, 0, Convert.ToInt32(file.ContentLength));

                    using (var package = new ExcelPackage(file.InputStream))
                    {
                        var    currentSheet = package.Workbook.Worksheets;
                        string sheetName    = Session["sheetName"].ToString();

                        ExcelWorksheet workSheet;
                        if (sheetName == string.Empty)
                        {
                            workSheet = currentSheet.First();
                        }
                        else
                        {
                            workSheet = currentSheet.Where(p => p.Name == sheetName).FirstOrDefault();
                        }

                        var noOfCol = workSheet.Dimension.End.Column;
                        var noOfRow = workSheet.Dimension.End.Row;

                        string tableName;
                        string columnName;
                        string lookupTable;
                        string LinkColumn;
                        string LinkType;
                        string pk;
                        string toColumn;
                        string datatype;
                        string tableExp;
                        string columnExp;
                        string uzunluk;

                        bool boolPK = false;

                        List <string> tables      = new List <string>();
                        NodeData      newNoteData = null;
                        for (int rowIterator = 2; rowIterator <= noOfRow; rowIterator++)
                        {
                            tableExp    = ((workSheet.Cells[rowIterator, 1].Value == null) ? "" : workSheet.Cells[rowIterator, 1].Value.ToString()).Trim();
                            tableName   = ((workSheet.Cells[rowIterator, 2].Value == null) ? "" : workSheet.Cells[rowIterator, 2].Value.ToString()).Trim().ToUpperInvariant();
                            columnName  = (workSheet.Cells[rowIterator, 3].Value == null) ? "" : workSheet.Cells[rowIterator, 3].Value.ToString().Trim();
                            columnExp   = (workSheet.Cells[rowIterator, 4].Value == null) ? "" : workSheet.Cells[rowIterator, 4].Value.ToString().Trim();
                            datatype    = (workSheet.Cells[rowIterator, 5].Value == null) ? "" : workSheet.Cells[rowIterator, 5].Value.ToString().Trim();
                            uzunluk     = (workSheet.Cells[rowIterator, 6].Value == null) ? "" : workSheet.Cells[rowIterator, 6].Value.ToString().Trim();
                            lookupTable = ((workSheet.Cells[rowIterator, 7].Value == null) ? "" : workSheet.Cells[rowIterator, 7].Value.ToString()).Trim().ToUpperInvariant();
                            LinkColumn  = (workSheet.Cells[rowIterator, 8].Value == null) ? "" : workSheet.Cells[rowIterator, 8].Value.ToString().Trim();
                            toColumn    = (workSheet.Cells[rowIterator, 9].Value == null) ? "" : workSheet.Cells[rowIterator, 9].Value.ToString().Trim();
                            LinkType    = (workSheet.Cells[rowIterator, 10].Value == null) ? "" : workSheet.Cells[rowIterator, 10].Value.ToString().Trim();
                            pk          = (workSheet.Cells[rowIterator, 11].Value == null) ? "" : workSheet.Cells[rowIterator, 11].Value.ToString().Trim();

                            if (toColumn == string.Empty)
                            {
                                toColumn = columnName;
                            }

                            //if (pk != string.Empty)
                            //    boolPK = bool.Parse(pk);
                            //else
                            //    boolPK = false;

                            try
                            {
                                boolPK = bool.Parse(pk);
                            }
                            catch (Exception)
                            {
                                boolPK = false;
                            }
                            //veriler excel'den alındı. İlgili tablolara atılması gerekiyor.
                            if (tableName != string.Empty && !tables.Contains(tableName))
                            {
                                newNoteData             = new NodeData();
                                newNoteData.key         = tableName;
                                newNoteData.description = tableExp;
                                newNoteData.tables      = new List <NodeDataTable>();
                                tables.Add(tableName);
                                nodes.Add(newNoteData);
                            }

                            if (columnName != string.Empty)
                            {
                                NodeDataTable newNodeDataSubItem;
                                newNodeDataSubItem = new NodeDataTable(columnName, boolPK, datatype, uzunluk, columnExp);
                                newNoteData.tables.Add(newNodeDataSubItem);
                            }

                            if (lookupTable != string.Empty && LinkColumn != string.Empty)
                            {
                                NodeLink linkNode = new NodeLink(tableName, lookupTable, LinkColumn, toColumn);
                                linkNodes.Add(linkNode);
                            }
                        } // for end
                    }     //using end

                    nodeDatas.NodeDatas = nodes;
                    nodeDatas.NodeLinks = linkNodes;
                }//if end
            }
            return(nodeDatas);
        }
コード例 #8
0
 internal NodeRow(global::System.Data.DataRowBuilder rb) :
     base(rb)
 {
     this.tableNode = ((NodeDataTable)(this.Table));
 }
コード例 #9
0
ファイル: Nodes.cs プロジェクト: fishxz/omni-bot
 internal void InitVars()
 {
     this.tableNode = ((NodeDataTable)(this.Tables["Node"]));
     if ((this.tableNode != null)) {
         this.tableNode.InitVars();
     }
 }
コード例 #10
0
ファイル: Nodes.cs プロジェクト: fishxz/omni-bot
 internal NodeRow(DataRowBuilder rb)
     : base(rb)
 {
     this.tableNode = ((NodeDataTable)(this.Table));
 }
コード例 #11
0
ファイル: Nodes.cs プロジェクト: fishxz/omni-bot
 private void InitClass()
 {
     this.DataSetName = "Nodes";
     this.Prefix = "";
     this.Namespace = "http://tempuri.org/Nodes.xsd";
     this.Locale = new System.Globalization.CultureInfo("en-US");
     this.CaseSensitive = false;
     this.EnforceConstraints = true;
     this.tableNode = new NodeDataTable();
     this.Tables.Add(this.tableNode);
 }