示例#1
0
文件: CWR.cs 项目: MateuszRac/CWR
        private Transaction updateSWR(Transaction tr)
        {
            //Controlled writers - SWR

            int           ref_number = 1;
            List <Record> revs       = _records.FindAll(o => o.GroupNo == tr.GroupNo && o.TransmissionNo == tr.TransactionNo && o.Type == "SWR");


            foreach (Record r in revs)
            {
                IPName writer = new IPName();
                writer.LastName      = r.Line.Substring(28, 45);
                writer.FirstName     = r.Line.Substring(73, 30);
                writer.IPINameNo     = r.Line.Substring(115, 11);
                writer.NaturalPerson = true;
                writer.RefNumber     = r.Line.Substring(19, 9);



                Shareholder sh = new Shareholder();
                sh.InterestedParty = writer;
                sh.Controlled      = true;
                sh.Level           = 1;
                sh.RefNo           = ref_number;
                //sh.

                sh.Role = r.Line.Substring(104, 2);
                sh.POwn = Decimal.Parse(r.Line.Substring(129, 5)) / 100;
                sh.MOwn = Decimal.Parse(r.Line.Substring(137, 5)) / 100;
                sh.SOwn = Decimal.Parse(r.Line.Substring(145, 5)) / 100;

                sh.PSoc = Int32.Parse(r.Line.Substring(126, 3));
                sh.MSoc = Int32.Parse(r.Line.Substring(134, 3));
                sh.SSoc = Int32.Parse(r.Line.Substring(142, 3));

                TIS territory_controll = new TIS();
                territory_controll.TISN    = 2136;
                territory_controll.Name    = "WORLD";
                territory_controll.Inluded = true;

                List <TIS> tisList = new List <TIS>();
                tisList.Add(territory_controll);

                tr.Work.addShareholderList(sh, tisList, this._cis_tables);

                int line = r.LineNo;
            }



            return(tr);
        }
示例#2
0
文件: CWR.cs 项目: MateuszRac/CWR
        public bool TISValid(TIS parent, TIS child)
        {
            bool valid = true;


            if (child.Inluded)
            {
                valid = valid && (this._tis_relation_database.Exists(t => t.Key.TISN == child.TISN && t.Value.TISN == parent.TISN) || parent.TISN == child.TISN);
            }
            else
            {
                valid = valid && !(this._tis_relation_database.Exists(t => t.Key.TISN == child.TISN && t.Value.TISN == parent.TISN) || parent.TISN == child.TISN);
            }

            return(valid);
        }
示例#3
0
文件: CWR.cs 项目: MateuszRac/CWR
        public Work()
        {
            _split_options = new List <RightSplitOption>();
            RightSplitOption rso = new RightSplitOption();


            //Creating +2WL split option
            TIS tis = new TIS();

            tis.TISN      = 2136;
            tis.ShortCode = "2WL";

            tis.Inluded = true;
            rso.addTIS(tis);
            _split_options.Add(rso);
        }
示例#4
0
文件: CWR.cs 项目: MateuszRac/CWR
        private void TISHierarhy(string fileName)
        {
            var lines = File.ReadLines(fileName);

            foreach (var line in lines)
            {
                string[] columns = line.Split('\t');
                TIS      parent  = _tis_names.Find(o => o.TISN == Int32.Parse(columns[0]));
                //parent.TISN = Int32.Parse(columns[0]);

                TIS child = _tis_names.Find(o => o.TISN == Int32.Parse(columns[1]));
                //child.TISN = Int32.Parse(columns[1]);

                KeyValuePair <TIS, TIS> t = new KeyValuePair <TIS, TIS>(parent, child);

                _tis_relation_database.Add(t);
            }
        }
示例#5
0
文件: CWR.cs 项目: MateuszRac/CWR
        private void TISNames(string fileName)
        {
            var lines = File.ReadLines(fileName);

            foreach (var line in lines)
            {
                string[] columns = line.Split('\t');

                TIS territory = new TIS();
                territory.TISN      = Int32.Parse(columns[0]);
                territory.Inluded   = true;
                territory.Type      = columns[1];
                territory.ShortCode = columns[2];
                territory.LongCode  = columns[3];
                territory.Name      = columns[4];
                _tis_names.Add(territory);
            }
        }
示例#6
0
文件: CWR.cs 项目: MateuszRac/CWR
        public void printWorks(TIS territory)
        {
            List <TIS> territoryList = new List <TIS>();

            territoryList.Add(territory);
            foreach (Transaction tr in _transactions.FindAll(o => o.Work.SplitOptions.Exists(t => this._cis_tables.TISValidList(t.Territories, territoryList))))
            {
                Console.WriteLine(tr.Work.Workcode + "\t" + tr.Work.Title);

                foreach (Shareholder sh in tr.Work.SplitOptions[0].Shareholders)
                {
                    Console.WriteLine(sh.InterestedParty.LastName + " " + sh.InterestedParty.FirstName + "\t" + sh.InterestedParty.IPINameNo + "\t" + sh.Role + "\t" + sh.Controlled + "\t" + sh.POwn + "\t" + sh.PCol + "\t" + sh.MOwn + "\t" + sh.MCol);
                }

                Console.WriteLine();
                Console.WriteLine();
                Console.WriteLine();
            }
        }
示例#7
0
文件: CWR.cs 项目: MateuszRac/CWR
 public void addTIS(TIS tis)
 {
     _territories.Add(tis);
 }