Пример #1
0
 private void dgv_thematicOrder_CellMouseDown(object sender, System.Windows.Forms.DataGridViewCellMouseEventArgs e)
 {
     try
     {
         if (e.Button == MouseButtons.Right)
         {
             if (e.RowIndex >= 0)
             {
                 //若行已是选中状态就不再进行设置
                 if (dgv_CommonOrder.Rows[e.RowIndex].Selected == false)
                 {
                     dgv_CommonOrder.ClearSelection();
                     dgv_CommonOrder.Rows[e.RowIndex].Selected = true;
                 }
                 //只选中一行时设置活动单元格
                 if (dgv_CommonOrder.SelectedRows.Count == 1)
                 {
                     dgv_CommonOrder.CurrentCell = dgv_CommonOrder.Rows[e.RowIndex].Cells[e.ColumnIndex];
                 }
                 //弹出操作菜单
                 cms_rightButton.Show(MousePosition.X, MousePosition.Y);
             }
         }
         else if (e.Button == MouseButtons.Left)
         {
             if (e.RowIndex >= 0)
             {
                 //若行已是选中状态就不再进行设置
                 if (dgv_CommonOrder.Rows[e.RowIndex].Selected == false)
                 {
                     dgv_CommonOrder.ClearSelection();
                     dgv_CommonOrder.Rows[e.RowIndex].Selected = true;
                 }
                 //只选中一行时设置活动单元格
                 if (dgv_CommonOrder.SelectedRows.Count == 1)
                 {
                     dgv_CommonOrder.CurrentCell = dgv_CommonOrder.Rows[e.RowIndex].Cells[e.ColumnIndex];
                 }
                 //弹出操作菜单
                 //cms_rightButton.Show(MousePosition.X, MousePosition.Y);
                 DataGridViewRow dgvr = dgv_CommonOrder.SelectedRows[0];
                 CommonOrder co = (CommonOrder)dgvr.DataBoundItem;
                 this.topForm.ShowSelectedOrderInMap(co.Orderid,null);
             }
         }
     }
     catch (System.ArgumentOutOfRangeException e1)
     {
         //e1.ToString();
     }
 }
 public string SubmitCPRequire(CommonOrder commonOrder)
 {
     try
     {
         CPRequireSubmitService.CPRequireSubmitClient cprequireSubmitclient = new CPRequireSubmitService.CPRequireSubmitClient();
         string xmlParam = generateCPOrderParam(commonOrder);
         string result   = cprequireSubmitclient.commonProductRequireSubmit(xmlParam);
         return(result);
     }
     catch (System.ServiceModel.EndpointNotFoundException e)
     {
         System.Windows.Forms.MessageBox.Show("请检查网络情况!");
         return(null);
     }
 }
Пример #3
0
        private void getDataInNeed(ThematicOrder to)
        {
            ProductDataMap     pdm           = new ProductDataMap();
            List <string>      commonInNeed  = pdm.GetCommonInNeed(to);
            List <string>      assistInNeed  = pdm.GetAssistInNeed(to);
            List <CommonOrder> commonListTmp = new List <CommonOrder>();
            List <AssistData>  assistListTmp = new List <AssistData>();

            this.commonOrderList = new List <CommonOrder>();
            foreach (string name in commonInNeed)
            {
                CommonOrder co = new CommonOrder();
                co.ProductName = name;
                co.CoverScope  = to.CoverScope;
                co.StartDate   = to.StartDate;
                co.EndDate     = to.EndDate;
Пример #4
0
        private void getDataInNeed(ThematicOrder to)
        {
            ProductDataMap     pdm           = new ProductDataMap();
            List <string>      commonInNeed  = pdm.GetCommonInNeed(to);
            List <string>      assistInNeed  = pdm.GetAssistInNeed(to);
            List <CommonOrder> commonListTmp = new List <CommonOrder>();
            List <AssistData>  assistListTmp = new List <AssistData>();

            this.commonOrderList = new List <CommonOrder>();
            foreach (string name in commonInNeed)
            {
                CommonOrder co = new CommonOrder();
                co.ProductName = name;
                co.CoverScope  = to.CoverScope;
                co.StartDate   = to.StartDate;
                co.EndDate     = to.EndDate;


                co.EnglishName = dataNameMap.GetCommonEnglishName(co.ProductName);;
                co.ProductType = dataNameMap.GetCommonCategory(co.ProductName);;
                //TODO:查找数据库,找出该数据是否在库
                co.IsInDataBase = false;
                commonListTmp.Add(co);
                if (co.IsInDataBase == false)
                {
                    co.Status = OrderStatus.等待生产队列.ToString();
                    commonOrderList.Add(co);
                }
            }
            this.commonInNeedList = commonListTmp;
            dgv_commonProductInNeed.DataSource = commonInNeedList;

            foreach (string name in assistInNeed)
            {
                AssistData ad = new AssistData();
                ad.ProductName = name;
                ad.CoverScope  = to.CoverScope;
                ad.StartDate   = to.StartDate;
                ad.EndDate     = to.EndDate;
                //TODO:查找数据库,找出该数据是否在库
                ad.IsInDataBase = false;
                ad.ProductType  = "";
                ad.EnglishName  = "";
                assistListTmp.Add(ad);
            }
            dgv_assistDataInNeed.DataSource = assistInNeedList;
        }
        private string generateCPOrderParam(CommonOrder co)
        {
            //string xmlParam = "";
            string paramXml = "<?xml version='1.0' encoding='UTF-8'?><root>";

            paramXml += " <condition>";
            paramXml += "<producttype>" + co.ProductType + "</producttype>";
            paramXml += "<productname>" + co.ProductName + "</productname>";
            paramXml += "<englishname>" + co.EnglishName + "</englishname>";
            paramXml += "<coverscope>" + co.CoverScope + "</coverscope>";
            paramXml += "<startdate>" + co.StartDate + "</startdate>";
            paramXml += "<enddate>" + co.EndDate + "</enddate>";

            paramXml += "</condition>";


            paramXml += "</root>";
            return(paramXml);
        }