private void BtnEdit_Click(object sender, EventArgs e)
        {
            //if (WPHbROWDGV[9, WPHbROWDGV.CurrentCell.RowIndex].Value.ToString() == "待审核" || WPHbROWDGV[9, WPHbROWDGV.CurrentCell.RowIndex].Value.ToString() == "已审核")
            //{
            //    if (WPHbROWDGV[9, WPHbROWDGV.CurrentCell.RowIndex].Value.ToString() == "待审核")
            //    {
            //        MessageBox.Show("此单已领用不能修改!!");
            //    }
            //    else
            //    {
            //        if (WPHbROWDGV[9, WPHbROWDGV.CurrentCell.RowIndex].Value.ToString() == "已审核")
            //        {
            //            MessageBox.Show("此单已审核不能修改!!");
            //        }
            //    }
            //}
            //else{
            int ID_ = WPHbROWDGV.CurrentCell.RowIndex;
            OutRuturnNOinforMation ornm = new OutRuturnNOinforMation(WPHbROWDGV[1, WPHbROWDGV.CurrentCell.RowIndex].Value.ToString());

            ornm.ShowDialog();
            brows();
            WPHbROWDGV.Rows[ID_].Selected = true;
            //}
        }
        private void TxtBarCode_KeyDown(object sender, KeyEventArgs e)
        {
            SqlConnection conn = sqlcon.getcon("");
            DataSet       ds   = new DataSet();

            if (e.KeyCode == Keys.Enter)
            {
                string strsql = "select ID,Case when type>2 then CAST ('True' as bit) else CAST ('False' as bit)end as ok,ShopName,CadeType,case when type=1 then '等待寄回' when type=2 then '等待收货' when type=3 then '确认收货' when type=4 then '换货完毕' when type=5 then '退款完毕'  when type=6 then 'ERP已审核' else '订单关闭' end type,CadeDate,barCodeDate,VipName,Mobile,OrderCade,BarCode,Remarks,ExpressName,ExpressBarCode," +
                                "userName from CS_OutRuturnStorage  where type>0 and (OrderCade like '%" + TxtBarCode.Text.ToString() + "%' or VipName='" + TxtBarCode.Text.ToString() + "' or ExpressBarCode='" + TxtBarCode.Text.ToString() + "' or Mobile='" + TxtBarCode.Text.ToString() + "')";
                SqlDataAdapter sqlDaper = new SqlDataAdapter(strsql, conn);

                conn.Open();
                sqlDaper.Fill(ds);
                conn.Close();
                if (ds.Tables[0].Rows.Count > 0)
                {
                    ProudctDGV.DataSource = ds.Tables[0];
                    ProudctDGV.Columns["ShopName"].HeaderText       = "店铺";
                    ProudctDGV.Columns["ok"].HeaderText             = "选";
                    ProudctDGV.Columns["ok"].Width                  = 45;
                    ProudctDGV.Columns["ShopName"].ReadOnly         = true;
                    ProudctDGV.Columns["CadeType"].HeaderText       = "类型";
                    ProudctDGV.Columns["CadeType"].Width            = 60;
                    ProudctDGV.Columns["CadeType"].ReadOnly         = true;
                    ProudctDGV.Columns["VipName"].HeaderText        = "会员";
                    ProudctDGV.Columns["VipName"].ReadOnly          = true;
                    ProudctDGV.Columns["Mobile"].HeaderText         = "电话";
                    ProudctDGV.Columns["Mobile"].ReadOnly           = true;
                    ProudctDGV.Columns["OrderCade"].HeaderText      = "订单";
                    ProudctDGV.Columns["OrderCade"].ReadOnly        = true;
                    ProudctDGV.Columns["CadeDate"].HeaderText       = "登记日期";
                    ProudctDGV.Columns["CadeDate"].ReadOnly         = true;
                    ProudctDGV.Columns["BarCodeDate"].HeaderText    = "收货日期";
                    ProudctDGV.Columns["BarCodeDate"].ReadOnly      = false;
                    ProudctDGV.Columns["BarCode"].HeaderText        = "货品条码";
                    ProudctDGV.Columns["BarCode"].ReadOnly          = true;
                    ProudctDGV.Columns["Remarks"].HeaderText        = "问题";
                    ProudctDGV.Columns["Remarks"].ReadOnly          = true;
                    ProudctDGV.Columns["Type"].HeaderText           = "状态";
                    ProudctDGV.Columns["Type"].ReadOnly             = true;
                    ProudctDGV.Columns["ExpressName"].HeaderText    = "退回快递公司";
                    ProudctDGV.Columns["ExpressBarCode"].HeaderText = "退回快递单";
                    ProudctDGV.Columns["UserName"].HeaderText       = "操作员";
                    ProudctDGV.Columns["UserName"].ReadOnly         = true;
                    ProudctDGV.Columns["ID"].Visible                = false;
                    for (int i = 0; i < ProudctDGV.Rows.Count; i++)
                    {
                        if (ProudctDGV.Rows[i].Cells["barCodeDate"].Value.ToString().Trim() == "")
                        {
                            ProudctDGV.Rows[i].Cells["barCodeDate"].Value = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
                        }
                    }
                    //ProudctDGV.Columns["barCodeDate"].Visible = false;
                }
                else
                {
                    DialogResult result = MessageBox.Show("没有此相关信息,“是”新增退货单,“否”输入无信息", "消息提示!", MessageBoxButtons.YesNoCancel);
                    if (result == DialogResult.Yes)
                    {
                        OutRuturnStorageEDIT ors = new OutRuturnStorageEDIT("", 3);
                        ors.ShowDialog();
                    }
                    else if (result == DialogResult.No)
                    {
                        OutRuturnNOinforMation ornm = new OutRuturnNOinforMation("");
                        ornm.ShowDialog();
                    }
                    else
                    {
                        return;
                    }
                }
                TxtBarCode.Text = "";
            }
        }