Beispiel #1
0
        private void ProcessData()
        {
            Import_dtInfo = new Express.BLL.OrgOrder().GetList(" 0=1").Tables[0];
            for (int i = 0; i < dtImportInfo.Rows.Count; i++)
            {
                ///过滤无用的单号信息
                //if (new Express.BLL.OrderInfo().GetRecordCount(string.Format(" orderno='{0}' and Daterecived=#{1}#", dtImportInfo.Rows[i][0].ToString(),dtReciveDate.Date)) <= 0)
                //{
                if (!string.IsNullOrEmpty(dtImportInfo.Rows[i][1].ToString()) && dtImportInfo.Rows[i][1].ToString().Length > 6)
                {
                    DataRow newrow = Import_dtInfo.NewRow();
                    newrow["orderno"] = dtImportInfo.Rows[i][0].ToString();
                    newrow["imtime"]  = dtReciveDate.Date;
                    newrow["pid"]     = dtImportInfo.Rows[i][1].ToString();
                    Import_dtInfo.Rows.Add(newrow);
                }
            }
            bool sucess = new Express.BLL.OrgOrder().AddByGroup(Import_dtInfo);

            MessageBox.Show("成功导入数据完成!共导入(" + (dtImportInfo.Rows.Count - 1) + ")票!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            btnImport.Enabled = true;
        }
Beispiel #2
0
        private void LoadData()
        {
            this.anpageinfo.Refresh();
            gvInfo.Rows.Clear();
            int pagesize = PageSize;

            DataTable dt       = new Express.BLL.OrgOrder().GetListByPage(SearchCondition(), "id", pagesize, anpageinfo.PageIndex).Tables[0];
            int       rowCount = dt.Rows.Count;

            if (rowCount > 0)
            {
                gvInfo.Rows.Add(rowCount);
            }
            rowCount = 0;
            foreach (DataRow item in dt.Rows)
            {
                gvInfo.Rows[rowCount].Cells[0].Value = item["id"];
                gvInfo.Rows[rowCount].Cells[1].Value = (rowCount + 1);
                gvInfo.Rows[rowCount].Cells[2].Value = item["orderno"];
                gvInfo.Rows[rowCount].Cells[3].Value = item["pid"];
                gvInfo.Rows[rowCount].Cells[4].Value = item["imtime"];
                rowCount++;
            }
        }