//添加
        public DataTable AddGoods(ConsumptionInfo _cinfo)
        {
            bool isexist = false;

            foreach (var item in cifo)
            {
                if (item.Goods == _cinfo.Goods)
                {
                    isexist = true;
                    break;
                }
            }
            if (isexist)
            {
                ConsumptionInfo ci = new ConsumptionInfo();
                foreach (var item in cifo)
                {
                    if (item.Goods == _cinfo.Goods)
                    {
                        ci = item;
                        cifo.Remove(item);
                        break;
                    }
                }
                _cinfo.GoodsNumber = (Convert.ToInt32(_cinfo.GoodsNumber) + Convert.ToInt32(ci.GoodsNumber)).ToString();
                _cinfo.TotalPrice  = (Convert.ToInt32(_cinfo.TotalPrice) + Convert.ToInt32(ci.TotalPrice)).ToString();
            }
            cifo.Add(_cinfo);
            return(ListToDatatableHelper.ToDataTable(cifo));
        }
Example #2
0
        /// <summary>
        /// 查看当前挂单信息
        /// </summary>
        /// <returns></returns>
        private async Task QueryOrder()
        {
            var orderlist = await gateio.api.API.OpenOrdersAsync();

            DataTable dt = ListToDatatableHelper.ToDataTable(orderlist);

            this.dataGridView1.DataSource = dt;
        }
Example #3
0
        //查询
        public DataTable SearchGoods(string name)
        {
            ReadFile();
            string    strTemp = "GoodName  like '%" + name + "%'";
            DataTable dt      = ListToDatatableHelper.ToDataTable(lgoods);

            DataRow[] dr = dt.Select(strTemp);
            return(ListToDatatableHelper.DataRowToDataTable(dr));
        }
        public void TestSaveExcel()
        {
            string             ExcelPath   = @"D:\ConceptFlower Test\Epass Stage 1 & 2 automation tool.xlsx";
            ExcelEditor        excelHandel = new ExcelEditor();
            List <WhiteListcs> wlist       = new List <WhiteListcs>();
            WhiteListcs        model       = new WhiteListcs {
                PM_AC            = "PC", Membership_No = "12345678-123456789", ERID = "21456789", Case_Number = "5454579859"
                , Name_in_AS400  = "test", Name_in_XML = "test", Name_Pass = "******", Clean_Case = "Y", Unclean_Reason = new StringBuilder("sdfasdfsfds"), Signature_Pass = "******"
                , Withdraw_NT_PM = "NT", Process_result = "Process"
            };

            wlist.Add(model);
            var       excel = excelHandel.Open(ExcelPath);
            DataTable dt    = ListToDatatableHelper.ToDataTable <WhiteListcs>(wlist);

            excel.SaveDataTableToExcel(dt, ExcelPath, "White List");
        }
Example #5
0
        public async Task GetTop()
        {
            marketlist = await gateio.api.API.GetMarketListAsync();

            marketlist = marketlist.Where(S => S.CurrB == "USDT").Where(S => S.Trend == "up").OrderByDescending(S => S.RatePercent).ThenBy(S => S.VolB).ToList();

            var dellist = marketlist.ToList();

            foreach (var item in dellist)
            {
                if (item.VolA < 100)
                {
                    marketlist.Remove(item);
                }
            }


            DataTable dt = new DataTable();

            dt = ListToDatatableHelper.ToDataTable(marketlist);

            dt.Columns.Remove("No");
            dt.Columns.Remove("NameEN");
            dt.Columns.Remove("CurrA");
            dt.Columns.Remove("CurrB");
            dt.Columns.Remove("CurrSuffix");
            dt.Columns.Remove("Supply");
            dt.Columns.Remove("Name");
            dt.Columns.Remove("Plot");


            dt.Columns["symbol"].ColumnName      = "标识";
            dt.Columns["Pair"].ColumnName        = "交易对";
            dt.Columns["Rate"].ColumnName        = "当前价格";
            dt.Columns["VolA"].ColumnName        = "被兑换交易量";
            dt.Columns["VolB"].ColumnName        = "兑换交易量";
            dt.Columns["RatePercent"].ColumnName = "涨跌";
            dt.Columns["Trend"].ColumnName       = "24小时趋势";
            dt.Columns["MarketCap"].ColumnName   = "总市值";

            this.dataGridView1.DataSource = dt;
        }
Example #6
0
        /// <summary>
        /// 获取所有会员信息
        /// </summary>
        /// <returns></returns>
        public DataTable GetAllVipInfo()
        {
            AllVIP = new List <VIPManagement>();
            string   url = Properties.Settings.Default.VIP;
            FileInfo f   = new FileInfo(url);

            if (!System.IO.Directory.Exists(f.FullName))
            {
                System.IO.Directory.CreateDirectory(f.FullName);//不存在就创建文件夹 }
            }
            DirectoryInfo root = new DirectoryInfo(f.FullName);

            FileInfo[] files = root.GetFiles();
            foreach (var item in files)
            {
                string vipinfo = File.ReadAllText(item.FullName);
                AllVIP.Add(JsonConvert.DeserializeObject <VIPManagement>(vipinfo));
            }
            //获取文件目录
            return(ListToDatatableHelper.ToDataTable(AllVIP));
        }
Example #7
0
 /// <summary>
 /// 查看历史记录
 /// </summary>
 /// <returns></returns>
 public DataTable ShowHistory()
 {
     return(ListToDatatableHelper.ToDataTable(AllBanlance));
 }