Example #1
0
        /// <summary>
        /// 编辑数据信息
        /// </summary>
        private void doUpdate()
        {
            String wlmc = "";

            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_STOVENO"].Value.ToString();
                    if (uGridData.Selected.Rows.Count == 1)
                    {
                        p_FS_STOVENO = (txtLh.Text != "") ? txtLh.Text : uGridData.Rows[ugr.Index].Cells["FS_STOVENO"].Value.ToString();
                    }
                    else
                    {
                        p_FS_STOVENO = uGridData.Rows[ugr.Index].Cells["FS_STOVENO"].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   = "";
                    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");
                    wlmc = txtWlmc.Text != "" ? txtWlmc.Text : uGridData.Rows[ugr.Index].Cells["FS_MATERIALNAME"].Value.ToString();


                    strTmpTable = "DT_SteelWeightMain";
                    strTmpField = "FS_PRODUCTNO='" + txtScdd.Text + "',FS_ITEMNO='0001',FS_SAPSTORE='" + txtKcd.Text + "',"
                                  + "FS_ACCOUNTDATE='" + dteJzrq.Value.ToString("yyyy-MM-dd") + "',FS_ISMATCH='1',fs_materialname='" + wlmc + "',FS_PLANT='1100'";
                    strTmpWhere = "FS_STOVENO ='" + strOptNo + "'";

                    if (sapClass.uptData(strTmpTable, strTmpField, strTmpWhere))
                    {
                        lstHint2.Items.Add("数据修改成功!");
                    }
                    else
                    {
                        MessageBox.Show("数据修改失败!");
                    }
                }
            }
            else
            {
                MessageBox.Show("请先选择要修改的数据行!");
            }
        }
Example #2
0
        /// <summary>
        /// 编辑数据信息
        /// </summary>
        private void doUpdate()
        {
            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_STOVENO"].Value.ToString();

                    strTmpTable = "DT_SAP261";
                    strTmpField = "";
                    strTmpField = "FS_PRODUCTNO='" + txtScdd.Text + "',FS_ITEMNO='0001',FS_SAPSTORE='" + txtKcd.Text + "',"
                                  + "FS_ACCOUNTDATE='" + dteJzrq.Value.ToString("yyyy-MM-dd") + "',FS_PLANT='" + txtGc.Text + "',FS_HEADER='"
                                  + cmbHead.Text + "',FS_AUDITOR='" + CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName() + "'";
                    strTmpWhere = "FS_STOVENO='" + strOptNo + "'";

                    if (sapClass.uptData(strTmpTable, strTmpField, strTmpWhere))
                    {
                        lstHint2.Items.Add("数据修改成功!");
                    }
                    else
                    {
                        MessageBox.Show("数据修改失败!");
                    }
                }
            }
            else
            {
                MessageBox.Show("请先选择要修改的数据行!");
            }
        }
Example #3
0
        /// <summary>
        /// 编辑数据信息
        /// </summary>
        private void doUpdate(int iFlag)
        {
            if (iFlag == 0)
            {
                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)
                {
                    //if (Convert.ToDecimal(uGridData.Rows[ugr.Index].Cells["FN_JJ_WEIGHT"].Value) < Convert.ToDecimal(uGridData.Rows[ugr.Index].Cells["FN_WEIGHT"].Value))
                    //{
                    //    if (DialogResult.No == MessageBox.Show(strOptNo + "已经材大于坯,是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information))
                    //    {
                    //        continue;
                    //    }
                    //}

                    /*
                     * 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 = "";
                     * p_FS_RECEIVEFACTORY = (txtGc.Text != "") ? txtGc.Text : uGridData.Rows[ugr.Index].Cells["FS_PLANT"].Value.ToString();
                     * p_FS_RECEIVESTORE = txtKcd.Text;
                     * p_FS_ACCOUNTDATE = dteJzrq.Value.ToString("yyyy-MM-dd");
                     */

                    if (iFlag == 0)
                    {
                        if (txtWlbh.Text.Trim() == "")
                        {
                            sapClass.getMaterial(txtScdd.Text);
                        }
                    }

                    strTmpTable = "DT_GX_STORAGEWEIGHTMAIN";
                    strTmpWhere = "FS_BATCHNO ='" + uGridData.Rows[ugr.Index].Cells["FS_BATCHNO"].Value.ToString() + "'";

                    switch (iFlag)
                    {
                    case 0:
                        strTmpField = "FS_PRODUCTNO='" + txtScdd.Text + "',FS_SAPSTORE='" + txtKcd.Text + "',"
                                      + "FS_ACCOUNTDATE='" + dteJzrq.Value.ToString("yyyy-MM-dd") + "',FS_PLANT='" + txtGc.Text + "',"
                                      + "FS_MATERIALNO='" + txtWlbh.Text + "',FS_MATERIALNAME='"
                                      + txtWlmc.Text + "',FS_HEADER='" + cmbHead.Text + "'";
                        try
                        {
                            sapClass.uptData(strTmpTable, strTmpField, strTmpWhere);
                        }
                        catch (Exception)
                        { }
                        break;

                    case 1:
                        break;
                    }

                    strTmpTable = "DT_GX_STORAGEWEIGHTDETAIL";
                    strTmpField = "";
                    switch (iFlag)
                    {
                    case 0:
                        strTmpField = "FS_PRODUCTNO='" + txtScdd.Text + "',FS_SAPSTORE='" + txtKcd.Text + "',"
                                      + "FS_ACCOUNTDATE='" + dteJzrq.Value.ToString("yyyy-MM-dd") + "',FS_PLANT='" + txtGc.Text + "',"
                                      + "FS_HEADER='" + cmbHead.Text + "',FS_ISMATCH='1',FS_UPFLAG='0'";
                        break;

                    case 1:
                        strTmpField = "FS_ISMATCH=0";
                        break;
                    }
                    strTmpWhere = "FS_BATCHNO ='" + uGridData.Rows[ugr.Index].Cells["FS_BATCHNO"].Value.ToString() + "'"
                                  + " AND FN_BANDNO=" + uGridData.Rows[ugr.Index].Cells["FN_BANDNO"].Value.ToString();

                    if (sapClass.uptData(strTmpTable, strTmpField, strTmpWhere))
                    {
                        lstHint2.Items.Add("数据修改成功!");
                    }
                    else
                    {
                        MessageBox.Show("数据修改失败!");
                    }
                }
            }
            else
            {
                MessageBox.Show("请先选择要修改的数据行!");
            }
        }
Example #4
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("请先选择要修改的数据行!");
            }
        }