//-----------------------------------------------------------------------------------------------------------//

        private void Get_MalzemeAdres_List()
        {
            try
            {
                // Cursor
                alfaMsg.WaitCursor();

                // Create Service
                alfaSAP p_SAP = new alfaSAP();

                // Parameters
                WR.ZMM005_MALZEMELOKASYON_01 prms = new Terminal2012.WR.ZMM005_MALZEMELOKASYON_01();

                prms.I_BARKOD = "";
                prms.I_MATNR  = tbMlzNo.Text;
                prms.I_UNAME  = this.m_System.UserId;
                prms.I_VBELN  = tbVbeln.Text;
                prms.I_POSNR  = tbPosnr.Text;

                prms.T_MALZEMELOKASYON = new Terminal2012.WR.ZMM_S_MALZEMELOKASYON[0];

                // Call Service
                WR.ZMM005_MALZEMELOKASYON_01Response resp = p_SAP.ZMM005_MALZEMELOKASYON_01(prms);

                // Grid
                grdList.DataSource = resp.T_MALZEMELOKASYON;

                // Check Data
                if (resp.T_MALZEMELOKASYON.Length > 0)
                {
                    // Malzeme Adi
                    tbMlzAdi.Text = resp.T_MALZEMELOKASYON[0].MLZTANIM;

                    // Select Row
                    grdList.Select(grdList.CurrentRowIndex);

                    // RecordCount
                    lbRecordCount01.Text = "Adet = " + resp.T_MALZEMELOKASYON.Length.ToString();
                }
                else
                {
                    // RecordCount
                    lbRecordCount01.Text = "Adet = 0";
                }

                // Show Error
                if (resp.E_SUBRC == "4")
                {
                    alfaMsg.Error(resp.T_MESSAGES[0].MESSAGE);
                }

                // Cursor
                alfaMsg.DefaultCursor();
            }
            catch (Exception ex)
            {
                // Error
                alfaMsg.Error(ex.Message);
            }
        }
        //-----------------------------------------------------------------------------------------------------------//

        private void btnList_Click(object sender, EventArgs e)
        {
            try
            {
                // Cursor
                Cursor.Current = Cursors.WaitCursor;

                // Create Service
                alfaSAP p_SAP = new alfaSAP();

                // Create Params
                WR.ZMM005_MALZEMELOKASYON_01 prms = new Terminal2012.WR.ZMM005_MALZEMELOKASYON_01();

                // Clear Barkod Text
                tbBarkod.Text = string.Empty;

                // Assign Params
                prms.I_BARKOD          = lbBarkodSave.Text;
                prms.I_UNAME           = this.m_System.UserId;
                prms.T_MALZEMELOKASYON = new Terminal2012.WR.ZMM_S_MALZEMELOKASYON[0]; // Table

                // Call Service
                WR.ZMM005_MALZEMELOKASYON_01Response resp = p_SAP.ZMM005_MALZEMELOKASYON_01(prms);

                // Create Table
                System.Data.DataTable p_Table = alfaGrid.ToDataTable(resp.T_MALZEMELOKASYON, "T_MALZEMELOKASYON");

                // Create Style
                alfaGrid.CreateTableStyle(grdList, p_Table, "DEFAULT");

                // Assign to Grid
                grdList.DataSource = p_Table;

                // Check Data
                if (resp.T_MALZEMELOKASYON.Length > 0)
                {
                    // Select Row
                    grdList.Select(grdList.CurrentRowIndex);

                    // Set Malzeme Text
                    txtMalzeme.Text = resp.T_MALZEMELOKASYON[0].MLZTANIM;

                    // RecordCount
                    lbRecordCount01.Text = "Adet = " + resp.T_MALZEMELOKASYON.Length.ToString();
                }
                else
                {
                    // RecordCount
                    lbRecordCount01.Text = "Adet = 0";
                }

                // Show Error
                if (resp.E_SUBRC == "4")
                {
                    alfaMsg.Error(resp.T_MESSAGES[0].MESSAGE);
                }

                // Cursor
                Cursor.Current = Cursors.Default;
            }
            catch (Exception ex)
            {
                // Error
                alfaMsg.Error(ex.Message);
            }
        }
Exemple #3
0
        //-----------------------------------------------------------------------------------------------------------//

        private void btnAdd_Click(object sender, EventArgs e)
        {
            try
            {
                // Cursor
                alfaMsg.WaitCursor();

                // Create Service
                alfaSAP p_SAP = new alfaSAP();

                // Create Params
                WR.ZMM005_MALZEMELOKASYON_01 prms = new Terminal2012.WR.ZMM005_MALZEMELOKASYON_01();

                // Assign Params
                prms.I_BARKOD          = txtBarkod.Text;
                prms.I_UNAME           = this.m_System.UserId;
                prms.T_MALZEMELOKASYON = new Terminal2012.WR.ZMM_S_MALZEMELOKASYON[0]; // Table

                // Call Service
                WR.ZMM005_MALZEMELOKASYON_01Response resp = p_SAP.ZMM005_MALZEMELOKASYON_01(prms);

                // Create Table
                System.Data.DataTable p_ResultTable = alfaGrid.ToDataTable(resp.T_MALZEMELOKASYON, "T_MALZEMELOKASYON");

                // Status
                string p_Status = null;

                // Set Status
                if (p_ResultTable.Rows.Count > 0)
                {
                    p_Status = "TAMAM";
                }
                else
                {
                    p_Status = "HATA";
                }

                // Create Row
                DataRow row = m_Table.NewRow();

                row["NO"]     = string.Format("{0:000}", m_Table.Rows.Count + 1);
                row["BARKOD"] = txtBarkod.Text;
                row["DURUM"]  = p_Status;

                // Add Row
                m_Table.Rows.Add(row);

                // Create Style
                alfaGrid.CreateTableStyle(grdList, m_Table, "DURUM");

                // Assign to Grid
                grdList.DataSource = m_Table;

                // Select Last Item
                grdList.CurrentRowIndex = m_Table.Rows.Count - 1;
                grdList.Select(m_Table.Rows.Count - 1);
                grdList.Refresh();

                // Clear Barkod
                txtBarkod.Text = string.Empty;

                // Disable BtnAdd
                alfaCtrl.DisableControl(btnAdd, Color.Silver);

                // Enable BtnClear
                alfaCtrl.EnableControl(btnClear, Color.Blue);

                // Show Error
                if (resp.E_SUBRC == "4")
                {
                    alfaMsg.Error(resp.T_MESSAGES[0].MESSAGE);
                }

                // Cursor
                alfaMsg.DefaultCursor();
            }
            catch (Exception ex)
            {
                // Error
                alfaMsg.Error(ex.Message);
            }
        }