Exemple #1
0
        bool SelectDB()
        {
            //try
            //{
            MySqlDataReader datareader = pMySqlDB_.call_proc("sp_select_data");

            while (datareader.Read())
            {
                //SellData pSellData = new SellData();
                SellData pSellData = DataManager.Instance.GetData();

                pSellData.UserName_     = Convert.ToString(datareader["UserName"]);
                pSellData.CouponNumber_ = Convert.ToString(datareader["CouponNumber"]);
                pSellData.Cost_         = (float)Convert.ToDouble(datareader["Cost"]);

                ListSellData2_.Add(pSellData.CouponNumber_, pSellData);
            }

            datareader.Close();
            datareader.Dispose();
            datareader = null;
            //}
            //catch (System.Exception ex)
            //{
            //    return false;
            //}



            return(true);
        }
Exemple #2
0
        //Array p = new Array<SellData>();
        //Array<SellData> ListSellData_ = new Array<SellData>();
        public void MakeList()
        {
            for (Int32 i = 0; i < MaxCount_; i++)
            {
                SellData pSellData = new SellData();
                ListSellData_.Add(pSellData);
            }

            nCursor_ = 0;
        }
Exemple #3
0
        bool LoadAndDelete(string filepath)
        {
            proc_count_ = 0;
            //string filepath = @"d:\gbs_order_20141006.xls";
            Microsoft.Office.Interop.Excel.Application ap = null;
            Workbook  wb = null;
            Worksheet ws = null;

            HKExcelHelper.GetWorkSheet(filepath, ref ap, ref wb, ref ws);

            Int32 Columns  = ws.UsedRange.Columns.Count;
            Int32 RowCount = ws.UsedRange.Rows.Count;

            Range tRange = null;

            for (Int32 i = 2; i < RowCount; i++)
            {
                //if (i > 2000)
                //    break;

                proc_count_++;
                //SellData pSellData = new SellData();
                SellData pSellData = DataManager.Instance.GetData();
                tRange = ws.Cells[i, 5];
                pSellData.CouponNumber_ = Convert.ToString(tRange.Value2);
                pSellData.CouponNumber_ = pSellData.CouponNumber_.Trim();

                tRange = ws.Cells[i, 12];
                pSellData.UserName_ = Convert.ToString(tRange.Value2);
                pSellData.UserName_ = pSellData.UserName_.Trim();

                tRange          = ws.Cells[i, 13];
                pSellData.Cost_ = (float)Convert.ToDouble(tRange.Value2);

                ListSellData_.Add(pSellData.CouponNumber_, pSellData);
            }


            // 초기화
            wb.Close(false, Type.Missing, Type.Missing);
            ap.Quit();

            Marshal.FinalReleaseComObject(ws);
            Marshal.FinalReleaseComObject(wb);
            Marshal.FinalReleaseComObject(ap);
            ws = null;
            wb = null;
            ap = null;

            return(true);
        }