예제 #1
0
        private void upload_button_Click(object sender, EventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();

            if (ofd.ShowDialog() == DialogResult.OK)
            {
                FileStream fs      = new FileStream(ofd.FileName, FileMode.Open, FileAccess.Read);
                byte[]     byteArr = new byte[fs.Length];
                fs.Read(byteArr, 0, byteArr.Length);
                fs.Close();

                List <SPR_file> sf_list = SPR_fileControl.SplitRawFile(byteArr);

                string path = ofd.FileName;
                string name = path.Substring(path.LastIndexOf('\\') + 1);

                foreach (SPR_file sf in sf_list)
                {
                    sf.FileName.Value = name;
                    MessageBox.Show(sf.CUSIP.Value + ": " + sf.Insert_to_DB());
                }

                this.RefreshData();
            }
        }
예제 #2
0
        public DataTable Get_viewDT(HssStatus status, bool all_flag = false)
        {
            this.sourceDT.Clear();

            List <SPR_file> list = SPR_fileControl.Get_SRP_fileList(status, all_flag);

            foreach (SPR_file sf in list)
            {
                DataRow row = sourceDT.Rows.Add();
                row["ID"] = sf.ID;
                if (!sf.CreateTime.IsNull_flag)
                {
                    row["CreateTime"] = sf.CreateTime.Value;
                }

                if (Utility.Is_DWRIN_admin())
                {
                    row["CreateBy"] = sf.CreateBy.Value;
                }
                else
                {
                    row["CreateBy"] = "System";
                }

                row["FileName"] = sf.FileName.Value;
                row["CUSIP"]    = sf.CUSIP.Value;
                if (!sf.RecordDate.IsNull_flag)
                {
                    row["RecordDate"] = sf.RecordDate.Value;
                }
                row["SecurityName"] = sf.SecurityName.Value;
                if (!sf.LastModifyAt.IsNull_flag)
                {
                    row["LastModifyAt"] = sf.LastModifyAt.Value;
                }
                row["LastModifyBy"]     = sf.LastModifyBy.Value;
                row["LastModifyAction"] = sf.LastModifyAction.Value;
            }

            return(this.sourceDT);
        }
예제 #3
0
 public static List <SPR_file> Get_SRP_fileList()
 {
     return(SPR_fileControl.Get_SRP_fileList(HssStatus.None, true));
 }