/// <summary>
        /// 查询到货信息
        /// </summary>
        private void SearchReceiveData()
        {
            //获取查询条件
            UserInfo usr = new UserInfo();

            usr.AreaId = base.CurrentUserSingleRegionId;
            usr.OrgId  = base.CurrentUserRegOrgId;
            //string startDate = ComUtil.formatDate(this.dtStartDate.Text);
            //string endDate = ComUtil.formatDate(this.dtEndDate.Value.AddDays(1).ToString());

            string startDate = ComUtil.formatDate(this.dtStartDate.Text);
            string endDate   = ComUtil.formatDate(this.dtEndDate.Text);

            string medicalName = this.txtmedicalName.Text.Trim();
            string salerName   = this.txtSalerName.Text.Trim();



            //获取查询数据集
            //dtReceive = OutOrderReceiveDao.GetInstance().GetOrderReceive(usr, startDate, endDate, medicalName, salerName);
            dtReceive = OutOrderReceiveDao.GetInstance().GetOrderReceive(usr);
            InitFromCacheByData(dtReceive);


            this.cachedDataView.Sort = " ID desc ";

            this.bindingSource1.DataSource = dtReceive.DefaultView;
        }
        private void btnAllExport_Click(object sender, EventArgs e)
        {
            bool flag = true;

            if (this.gridView3.RowCount == 0)
            {
                XtraMessageBox.Show("无可操作记录!", Constant.MsgTitle, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);

                return;
            }

            string strCurrentDB = FileOperation.GetNodeValue(FileOperation.GetNodeObject(EmedFunc.GetLocalPersonCfgPath() + @"/HisOrderReceive.xml", "Config/DestDB"), "DBType");

            if (strCurrentDB.Equals("EXCEL"))
            {
                //选择导出文件
                string ExpFilePath = this.SelectExportFile();

                if (ExpFilePath.Length == 0)
                {
                    return;
                }

                try
                {
                    //dttmp = (DataTable)(this.bindingSource1.List[0]);

                    DataRow[] drArray = dtReceive.DefaultView.Table.Select(dtReceive.DefaultView.RowFilter,
                                                                           dtReceive.DefaultView.Sort,
                                                                           dtReceive.DefaultView.RowStateFilter);

                    dttmp = dtReceive.DefaultView.Table.Clone();
                    foreach (DataRow dr in drArray)
                    {
                        dttmp.Rows.Add(dr.ItemArray);
                    }
                    //原代码全导出无法查询导出
                    //flag = OutOrderReceiveDao.GetInstance().ExportReceive(ExpFilePath, dtReceive);
                    //修改后
                    flag = OutOrderReceiveDao.GetInstance().ExportReceive(ExpFilePath, dttmp);
                    if (flag)
                    {
                        XtraMessageBox.Show("导出到货信息文件成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        XtraMessageBox.Show("导出到货信息文件失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);

                        return;
                    }
                }
                catch (Exception ex)
                {
                    XtraMessageBox.Show("导出到货信息文件出错!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);

                    return;
                }
            }

            string receiveIdstr    = string.Empty;
            string receiveHisIdstr = string.Empty;

            foreach (DataRow dr in dtReceive.Rows)
            {
                if (dr["TYPE"].ToString().Equals("1"))
                {
                    receiveIdstr += "'" + dr["ID"].ToString() + "',";
                }
                else
                {
                    receiveHisIdstr += "'" + dr["ID"].ToString() + "',";
                }
            }

            //OutOrderReceiveDao.GetInstance().UpdateOrderReceive(receiveIdstr, receiveHisIdstr);
        }