Пример #1
0
        /// <summary>
        /// 根据订单号查询物料信息
        /// </summary>
        private void getOrderInfo(string sDdh)
        {
            string[] strTmpArray = { "", "", "", "", "", "" };
            strTmpArray = sapClass.getOrdInfo(sDdh);

            if (strTmpArray[1] == "")
            {
                lstHint2.Items.Add("生产订单信息获取失败,从SAP下载!");
                sapClass.downOrderInfo(sDdh);
                strTmpArray = sapClass.getOrdInfo(sDdh);
            }

            if (strTmpArray[1] == "")
            {
                lstHint2.Items.Add("生产订单信息获取失败!");
            }

            txtScdd.Text = sDdh;
            txtHxmh.Text = strTmpArray[0];
            txtWlbh.Text = strTmpArray[1];
            txtGc.Text   = strTmpArray[2];
            txtWlmc.Text = sapClass.getMaterialName(strTmpArray[1]);
        }
Пример #2
0
        /// <summary>
        /// 编辑数据信息
        /// </summary>
        private void doUpdate(int iFlag)
        {
            if ((txtScdd.Text == "") || (txtGc.Text == "") || (txtKcd.Text == ""))
            {
                MessageBox.Show("工厂、生产订单与库存地都不能为空!");
                return;
            }

            string strTmpTable, strTmpField, strTmpWhere;

            if (uGridData.Selected.Rows.Count > 0)
            {
                foreach (UltraGridRow ugr in uGridData.Selected.Rows)
                {
                    strOptNo = uGridData.Rows[ugr.Index].Cells["FS_BATCHNO"].Value.ToString();
                    if (uGridData.Selected.Rows.Count == 1)
                    {
                        p_FS_BATCHNO = (txtLh.Text != "") ? txtLh.Text : uGridData.Rows[ugr.Index].Cells["FS_BATCHNO"].Value.ToString();
                    }
                    else
                    {
                        p_FS_BATCHNO = uGridData.Rows[ugr.Index].Cells["FS_BATCHNO"].Value.ToString();
                    }

                    p_FS_PRODUCTNO      = (txtScdd.Text != "") ? txtScdd.Text : uGridData.Rows[ugr.Index].Cells["FS_PRODUCTNO"].Value.ToString();
                    p_FS_ITEMNO         = (txtHxmh.Text != "") ? txtHxmh.Text : "0001";
                    p_FS_MATERIALNAME   = sapClass.getMaterialName(sapClass.getMaterial(p_FS_PRODUCTNO));
                    p_FS_RECEIVEFACTORY = (txtGc.Text != "") ? txtGc.Text : uGridData.Rows[ugr.Index].Cells["FS_PLANT"].Value.ToString();
                    p_FS_RECEIVESTORE   = (txtKcd.Text != "") ? txtKcd.Text : uGridData.Rows[ugr.Index].Cells["FS_SAPSTORE"].Value.ToString();
                    p_FS_ACCOUNTDATE    = dteJzrq.Value.ToString("yyyy-MM-dd");

                    strTmpTable = "DT_PLATECONFIRMWEIGHTMAIN";
                    strTmpField = "";
                    switch (iFlag)
                    {
                    case 0:
                        strTmpField = "FS_PRODUCTNO='" + txtScdd.Text + "',FS_ITEMNO='0001',FS_SAPSTORE='" + txtKcd.Text + "',"
                                      + "FS_ACCOUNTDATE='" + dteJzrq.Value.ToString("yyyy-MM-dd") + "',FS_PLANT='1100',FS_HEADER='"
                                      + cmbHead.Text + "',FS_ISMATCH=1,FS_AUDITOR='" + CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName()
                                      + "'";
                        break;

                    case 1:
                        strTmpField = "FS_ISMATCH=0";
                        break;
                    }
                    strTmpWhere = "FS_BATCHNO='" + strOptNo + "'";

                    if (sapClass.uptData(strTmpTable, strTmpField, strTmpWhere))
                    {
                        lstHint2.Items.Add("数据修改成功!");
                    }
                    else
                    {
                        MessageBox.Show("数据修改失败!");
                    }
                }
            }
            else
            {
                MessageBox.Show("请先选择要修改的数据行!");
            }
        }