Exemplo n.º 1
0
        public Atributo RelacionAtributo()
        {
            if (atrib.DirIndice == -1)
            {
                return(null);
            }
            string[] arch = Fullname.Split('\\');
            string   dicc = base.Fullname.Substring(0, Fullname.LastIndexOf('\\')) + '\\' + arch[arch.Length - 2] + ".dd";

            using (BinaryReader reader = new BinaryReader(File.Open(dicc, FileMode.Open)))
            {
                reader.BaseStream.Seek(atrib.DirIndice, SeekOrigin.Begin);
                string nomb = "";
                char[] name = reader.ReadChars(30);
                foreach (char c in name)
                {
                    nomb += c;
                }
                long dir = reader.ReadInt64();
                char tipo;
                long dirIn, dirsig;
                int  l, tipoI;

                tipo   = reader.ReadChar();
                l      = reader.ReadInt32();
                tipoI  = reader.ReadInt32();
                dirIn  = reader.ReadInt64();
                dirsig = reader.ReadInt64();

                Console.WriteLine("{0}, {1}, {2}, {3}, {4}, {5}, {6}", nomb, dir, tipo, l, tipoI, dirIn, dirsig);
                return(new Atributo(nomb, dir, tipo, l, tipoI, dirIn, dirsig));
            }
        }
Exemplo n.º 2
0
        private string getNamevCard()
        {
            string[] name = Fullname.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
            string   res  = "N:";

            switch (name.Length)
            {
            case 1:
                res += name[0] + ";;;;";
                break;

            case 2:
                res += name[1] + ";" + name[0] + ";;;";
                break;

            case 3:
                res += name[2] + ";" + name[0] + ";" + name[1] + ";;";
                break;

            case 4:
                res += name[3] + ";" + name[1] + ";" + name[2] + ";" + name[0] + ";";
                break;

            case 5:
                res += name[3] + ";" + name[1] + ";" + name[2] + ";" + name[0] + ";" + name[4];
                break;
            }
            return(res);
        }
Exemplo n.º 3
0
        public Employee ToEmployee()
        {
            var    split = Fullname.Split(" ");
            string name;

            try
            {
                name = split[0];
            }
            catch (IndexOutOfRangeException)
            {
                name = "";
            }
            return(new Employee
            {
                Id = Id,
                Fullname = Fullname,
                Name = name,
                // TBD
                DepartmentId = 2,
                PositionId = Post.Id,

                IsActive = DismissedDate == null,
            });
        }