Esempio n. 1
0
 public void huaDong()
 {
     try
     {
         string SHIPDETAILID = null;
         if (txtNumber != null)
         {
             SHIPDETAILID = txtNumber.Text.Trim();
         }
         string pageIndexAndCount = winFormPager1.PageIndex + "." + winFormPager1.PageSize;
         //ResultModelOfArrayOfModel_Huadong_Tms_Orderd4FqxSXX count = cs.GetHuadongQuery(null);
         //ResultModelOfint result=cs.GethuadongTmsOrderCount();
         //cs.Timeout = 10000;
         //ResultModelOfArrayOfModel_Huadong_Tms_Orderd4FqxSXX huadong = cs.GetHuadongQuery(pageIndexAndCount);
         //ResultModelOfint result = cs.GethuadongWaybillNumberCount(SHIPDETAILID);
         ResultModelOfint result = cs.GethuadongWaybillVagueCount(SHIPDETAILID);
         winFormPager1.DrawControl(result.Data);
         //ResultModelOfArrayOfModel_Huadong_Tms_Orderd4FqxSXX huadong = cs.GetHuadongWaybillNumberQuery(SHIPDETAILID,pageIndexAndCount);
         ResultModelOfArrayOfModel_Huadong_Tms_Orderd4FqxSXX huadong = cs.GetHuadongWaybillVagueQuery(SHIPDETAILID, pageIndexAndCount);
         if (huadong.Code != 0)
         {
             MessageBox.Show(huadong.Message);
         }
         else
         {
             dataGridView1.AutoGenerateColumns = false;
             dataGridView1.Rows.Clear();//清空数据
             foreach (Model_Huadong_Tms_Order item in huadong.Data)
             {
                 int rowIndex = dataGridView1.Rows.Add();
                 dataGridView1.Rows[rowIndex].Cells[0].Value = item.RelationIdk__BackingField;
                 dataGridView1.Rows[rowIndex].Cells[1].Value = item.Codek__BackingField;
                 dataGridView1.Rows[rowIndex].Cells[2].Value = item.SRCEXPNOk__BackingField;
                 dataGridView1.Rows[rowIndex].Cells[3].Value = item.ROADIDk__BackingField;
                 dataGridView1.Rows[rowIndex].Cells[4].Value = item.SHIPDETAILIDk__BackingField;
                 dataGridView1.Rows[rowIndex].Cells[5].Value = item.TOTALIDk__BackingField;
                 dataGridView1.Rows[rowIndex].Cells[6].Value = item.LEGCODEk__BackingField;
                 dataGridView1.Rows[rowIndex].Cells[7].Value = item.SHIPMENTCODEk__BackingField;
                 dataGridView1.Rows[rowIndex].Cells[8].Value = item.OPERATIONTYPEk__BackingField;
                 if (Convert.ToDateTime(item.DEMANDARRIVETIMEk__BackingField.ToString("yyyy-MM-dd")) > DateTime.MinValue && Convert.ToDateTime(item.DEMANDARRIVETIMEk__BackingField.ToString("yyyy-MM-dd")).Year != 1)
                 {
                     dataGridView1.Rows[rowIndex].Cells[9].Value = item.DEMANDARRIVETIMEk__BackingField;
                 }
                 else
                 {
                     dataGridView1.Rows[rowIndex].Cells[9].Value = null;
                 }
                 dataGridView1.Rows[rowIndex].Cells[10].Value = item.TOGTRANSNAMEk__BackingField;
                 dataGridView1.Rows[rowIndex].Cells[11].Value = item.RECEIVEMANk__BackingField;
                 dataGridView1.Rows[rowIndex].Cells[12].Value = item.RECEIVEPHONEk__BackingField;
                 dataGridView1.Rows[rowIndex].Cells[13].Value = item.RECEIVEADDRk__BackingField;
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
         MessageBox.Show(ex.Message, "error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }