Example #1
0
        public void DeleteWrongRow()
        {
            ACAD    food = new CADType("GebatDataConnectionString");
            DataRow del  = food.GetVoidRow;

            del["Name"] = new ENType("taca");
            food.Delete(del);
        }
Example #2
0
 protected void deleteType(object sender, EventArgs e)
 {
     typeSelected.Delete();
     typeSelected           = null;
     buttonDelete.Sensitive = false;
     entrySearch.Text       = "";
     FillTree();
 }
Example #3
0
        public void ReadDelete()
        {
            List <int> ids = new List <int>();

            ids.Add(2);
            ENType food = (ENType) new ENType("").Read(ids);

            food.Delete();
        }
Example #4
0
        public void ReadSave()
        {
            List <int> ids = new List <int>();

            ids.Add(4);
            ENType food = (ENType) new ENType("").Read(ids);

            food.Save();
        }
Example #5
0
        protected void InsQuant(object sender, EventArgs e)
        {
            ENType tipo = new ENType(entryType.Text);

            tipo.Save();
            FillTree();
            entryType.Text    = "";
            entryType.IsFocus = true;
        }
Example #6
0
        protected void quantityChanged(object sender, EventArgs e)
        {
            ComboBox combo = sender as ComboBox;
            TreeIter iter;

            if (combo.GetActiveIter(out iter))
            {
                seleccionado = combo.Model.GetValue(iter, 0) as ENType;
            }
        }
Example #7
0
        private void FillTree()
        {
            quantityStore.Clear();
            List <AEN> tipos = new ENType("").ReadAll();

            foreach (AEN tipo in tipos)
            {
                ENType untipo = (ENType)tipo;
                quantityStore.AppendValues(untipo);
            }
            treeviewquantities.Model = quantityStore;
        }
Example #8
0
        protected void treeTypeSelected(object sender, EventArgs e)
        {
            TreeSelection selection = (sender as TreeView).Selection;
            TreeModel     model;
            TreeIter      iter;

            if (selection.GetSelected(out model, out iter))
            {
                var value = model.GetValue(iter, 0);
                typeSelected           = (ENType)value;
                buttonDelete.Sensitive = true;
            }
        }
Example #9
0
        private void fillCombo()
        {
            quantityStore.Clear();

            List <AEN> tipos = new ENType("").ReadAll();

            foreach (AEN t in tipos)
            {
                ENType ins = (ENType)t;
                quantityStore.AppendValues(ins);
            }
            comboboxType.Model = quantityStore;
        }
Example #10
0
        private bool FilterTree(TreeModel model, TreeIter iter)
        {
            ENType tipo = (ENType)model.GetValue(iter, 0);

            if (entrySearch.Text == "")
            {
                return(true);
            }

            if (tipo.Name.IndexOf(entrySearch.Text) > -1)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
 public int GenerateID(ENType t)
 {
     if (t == ENType.Address)
     {
         return(Convert.ToInt32(uow.CustomerAddressRepositories.GenerateID()));
     }
     else if (t == ENType.Profile)
     {
         return(Convert.ToInt32(uow.CustomerProfileRepositories.GenerateID()));
     }
     else if (t == ENType.Contact)
     {
         return(Convert.ToInt32(uow.CustomerContactRepositories.GenerateID()));
     }
     else
     {
         return(Convert.ToInt32(uow.CustomerLoginRepositories.GenerateID()));
     }
 }
Example #12
0
    //获取包
    Package GetPackage(string path, Package rootPackage, ENType type = ENType.enSingle)
    {
        Package p = null;

        if (AllPackageMap.ContainsKey(path))
        {
            AllPackageMap.TryGetValue(path, out p);
        }
        else
        {//是否存在依赖包里
            if (rootPackage.IsFileWithMyDepend(path))
            {
                return(null);
            }
        }
        if (p == null)
        {
            p = new Package(path, type);
            AddPackage(p);
        }
        return(p);
    }
Example #13
0
 public Package()
 {
     MyInfo = new PackageInfo();
     m_type = ENType.enNone;
     BuildPackFromXML.Singleton.PackTree.AddPackage(this);
 }
Example #14
0
        private void RenderTypeName(TreeViewColumn col, CellRenderer cell, TreeModel model, TreeIter iter)
        {
            ENType type = (ENType)model.GetValue(iter, 0);

            (cell as CellRendererText).Text = type.Name;
        }
Example #15
0
        public void Save()
        {
            AEN food = new ENType("Cajas");

            food.Save();
        }
Example #16
0
        public void SaveNullName()
        {
            AEN food = new ENType(null);

            food.Save();
        }
Example #17
0
    public Package(string path, Package dependP, ENType type, string tag = "")
    {
        MyInfo = new PackageInfo(path);
        if (dependP.Key != path || string.IsNullOrEmpty(path))
        {
            AddMyDependPackage(dependP);
        }
        m_type = type;
        switch (m_type)
        {
        case ENType.enSingle:
        {
            if (m_type == ENType.enSingle)
            {
                m_loadType = tag;
            }
        }
        break;

        case ENType.enOneFileOnePackage:
        {
            List <string> fileList = new List <string>();
            if (ResUtil.IsExistFile(path))
            {
                fileList.Add(path);
            }
            else
            {
                fileList = ArchiveUtil.NtfGetAllFiles(path, true);
            }
            foreach (var item in fileList)
            {
                if (IsPass(item))
                {
                    continue;
                }

                new Package(item, this, Package.ENType.enSingle);
            }
        }
        break;

        case ENType.enOneDependOnePackage:
        {
            AllPackageMap = new Dictionary <string, Package>();
            List <string> fileList = new List <string>();
            if (ResUtil.IsExistFile(path))
            {
                fileList.Add(path);
            }
            else
            {
                fileList = ArchiveUtil.NtfGetAllFiles(path, true);
            }
            //共享包
            Package shareP = CreateSharePackage(fileList);
            //每个子包
            foreach (var item in fileList)
            {
                if (IsPass(item))
                {
                    continue;
                }

                //加载依赖包
                if (null == LoadDependPackage(item, shareP, this))
                {
                    Debug.LogWarning("load depend package failed.path:" + path + ",file:" + item);
                }
            }
            //构建一个列表,分层
            List <Package> list = new List <Package>(DependMeMap.Values);
            m_buildPackageList = new List <List <Package> >();
            m_buildPackageList.Add(new List <Package>(list));
            while (true)
            {
                List <Package> dependList = new List <Package>();
                foreach (var item in list)
                {
                    List <Package> childList = new List <Package>(item.DependMeMap.Values);
                    foreach (var child in childList)
                    {
                        if (null == dependList.Find(p => p.PackName == child.PackName))
                        {
                            dependList.Add(child);
                        }
                    }
                }
                if (dependList.Count == 0)
                {
                    break;
                }
                list = new List <Package>(dependList);
                m_buildPackageList.Add(new List <Package>(dependList));
            }
            //删除层次靠前,并且和层次后面重叠的package
            for (int i = m_buildPackageList.Count - 1; i >= 0; --i)
            {
                List <Package> lastList = m_buildPackageList[i];
                for (int j = i - 1; j >= 0; --j)
                {
                    List <Package> curList = m_buildPackageList[j];
                    for (int k = 0; k < curList.Count;)
                    {
                        Package curP = curList[k];
                        if (null != lastList.Find(p => p.PackName == curP.PackName))
                        {
                            curList.RemoveAt(k);
                        }
                        else
                        {
                            ++k;
                        }
                    }
                }
            }
        }
        break;
        }
        BuildPackFromXML.Singleton.PackTree.AddPackage(this);
    }
Example #18
0
 public Package(string path, ENType type)
 {
     MyInfo = new PackageInfo(path);
     m_type = type;
     BuildPackFromXML.Singleton.PackTree.AddPackage(this);
 }
Example #19
0
        private void RenderTypeName(CellLayout layout, CellRenderer cell, TreeModel model, TreeIter iter)
        {
            ENType type = (ENType)model.GetValue(iter, 0);

            (cell as CellRendererText).Text = type.Name;
        }