Ejemplo n.º 1
0
        public void LoadMaster()
        {
            IF_Service service = new IF_Service();

            SystemConfig = service.GetSystemConfig().ToList();
        }
Ejemplo n.º 2
0
        public Form_OutPutAggregate()
        {
            InitializeComponent();

            IF_Service service = new IF_Service();

            RetHospList  = service.GetHospital().ToList();
            RetdocList   = service.GetDoctor().ToList();
            SystemConfig = service.GetSystemConfig().ToList();

            ModalityList    = new Dictionary <string, string>();
            ModalityDocList = new Dictionary <string, string>();
            HospDistMsts    = new List <HospDistMst>();

            string[] modList    = null;
            string[] modDocList = null;

            foreach (var conf in SystemConfig)
            {
                if (conf.Key == "Modality")
                {
                    modList = conf.Value.Split(',');
                }
                else if (conf.Key == "Modality_Doc")
                {
                    modDocList = conf.Value.Split(',');
                }
            }
            ModalityList = new Dictionary <string, string>();
            for (int i = 0; i < modList.Length; i++)
            {
                string[] modVal = modList[i].Split(':');

                ModalityList.Add(modVal[1], modVal[2]);
            }

            ModalityDocList = new Dictionary <string, string>();
            for (int i = 0; i < modDocList.Length; i++)
            {
                string[] modVal = modDocList[i].Split(':');

                ModalityDocList.Add(modVal[1], modVal[2]);
            }

            foreach (var hosp in RetHospList)
            {
                var         dat     = service.GetHospitalConfig(hosp.Cd);
                string[]    confs   = null;
                HospDistMst tmpData = new HospDistMst();
                tmpData.Hospital = hosp;

                for (int i = 0; i < dat.Length; i++)
                {
                    confs = null;

                    if (!String.IsNullOrEmpty(dat[i].Value))
                    {
                        switch (dat[i].Key)
                        {
                        case "Cost":
                            tmpData.Cost = dat[i].Value;
                            break;

                        case "Dist":
                            tmpData.Dist = dat[i].Value;
                            break;

                        default:
                            confs = dat[i].Value.Split('@');
                            break;
                        }
                    }

                    if (confs == null)
                    {
                        continue;
                    }

                    switch (dat[i].Key)
                    {
                    case "Hosp":
                        List <HospMst> list = new List <HospMst>();
                        foreach (var conf in confs)
                        {
                            var     datas = conf.Split(':');
                            HospMst mst   = new AggregateTool.HospMst();
                            mst.Target = datas[0];
                            var wheres = datas[1].Split(',');
                            mst.Where = wheres[0] + " " + wheres[1] + " '" + wheres[2] + "'";

                            list.Add(mst);
                        }
                        tmpData.Hosp = list.ToArray();
                        break;

                    case "Sheet":
                        List <ModarityMst> listMod = new List <ModarityMst>();
                        foreach (var conf in confs)
                        {
                            var         datas = conf.Split(':');
                            ModarityMst mst   = new ModarityMst();
                            mst.Sum    = datas[0];
                            mst.Target = datas[1];
                            var wheres = datas[2].Split(',');
                            mst.Where = wheres[0] + " " + wheres[1] + " '" + wheres[2] + "'";
                            if (datas.Length > 3)
                            {
                                mst.DocMod = datas[3];
                            }
                            listMod.Add(mst);
                        }
                        tmpData.Sheet = listMod.ToArray();
                        break;

                    case "Kaikei":
                        tmpData.Yayoi = confs;
                        break;

                    default:
                        continue;
                    }
                }

                HospDistMsts.Add(tmpData);
            }
        }