using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Model;
using DCS.Place;

namespace QMAPP.WinForm.Forms.DisPatch
{
    public partial class FrmCarCardDetail : Form
    {
        public FrmCarCardDetail()
        {
            InitializeComponent();
        }
        private string pasterkey = "";
        public FrmCarCardDetail(string pastecardkey)
        {
            pasterkey = pastecardkey;
            InitializeComponent();
        }
        EPasteCard pastecard;
        string ptroducttype = "";
        string printtype = "";
        public bool isprint = false;
        public FrmCarCardDetail(EPasteCard ppaste, string pstrprodtype, string pprinttype)
        {
            printtype = pprinttype;
            pastecard = ppaste;
            ptroducttype = pstrprodtype;
            InitializeComponent();

        }
        public void getdate()
        {
            dgvMat.DataMember = null;
            dgvMat.DataSource = pastecard.DetailsCardlist;
        }
        
        /// <summary>
        /// 页面加载
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void FrmCarCardPrintShow_Load(object sender, EventArgs e)
        {
            #region
            try
            {
                //btnPrint.Enabled = true;
                if (printtype == "手动")
                {
                    ITEMNO.Visible = false;
                    getdate();
                }
                else
                {
                    QMAPP.ServicesAgent.ServiceAgent agent = ClientContext.GetServiceAgent();
                    DataTable tbl = agent.InvokeServiceFunction<DataTable>(QMAPP.ServicesAgent.FrmPlaceManage.FrmPlaceBLL_GetPascardDetailsByPid.ToString(), pasterkey);
                    dgvMat.DataSource = tbl;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            #endregion
        }

    }
}