private void WriteTextBox(Model model, SerialNumber serial)
 {
     NModel.Text = model.ModelName;
     NCustomer.Text = model.Customer;
     NProdectInfo.Text = model.ProductInfo;
     NProductNum.Text = model.PartNumber;
     NLabelID.Text = model.LabelID;
     NLHSerialNum.Text = serial.SerialNumberStart_L.ToString();
     NRHSerialNum.Text = serial.SerialNumberStart_R.ToString();
 }
        private void WriteModel(Model model, SerialNumber serial)
        {
            model.ModelName = NModel.Text;
            model.Customer = NCustomer.Text;
            model.ProductInfo = NProdectInfo.Text;
            model.PartNumber = NProductNum.Text;
            model.LabelID = NLabelID.Text;

            int temp;
            if (Int32.TryParse(NLHSerialNum.Text, out temp))
                serial.SerialNumberStart_L = temp;
            if (Int32.TryParse(NRHSerialNum.Text, out temp))
                serial.SerialNumberStart_R = temp;
        }
 public void SetModelItemInfo(Model m)
 {
     if (m != null)
     {
         if ((string)NModel.Content != m.ModelName)
             NModel.Content = m.ModelName;
         if ((string)NCustomer.Content != m.Customer)
             NCustomer.Content = m.Customer;
         if ((string)NProdectInfo.Content != m.ProductInfo)
             NProdectInfo.Content = m.ProductInfo;
         if ((string)NProductNum.Content != m.PartNumber)
             NProductNum.Content = m.PartNumber;
         if ((string)NLabelID.Content != m.LabelID)
             NLabelID.Content = m.LabelID;
     }
     if (m is ModelItem)
     {
         var i = m as ModelItem;
         NProductValue.Content = i.Leak;
         NSerialNum.Content = i.SerialNumber;
         NQrCode.Content = i.QRCode;
         var ret = NProductRet;
         switch (i.Result)
         {
             case ModelItem.RESULT.OK: //#FF37BD5B
                 if (ret.Background != OK_COLOR)
                 {
                     ret.Background = OK_COLOR;
                     ret.Content = ModelItem.RESULT.OK;
                 }
                 break;
             case ModelItem.RESULT.NG: //#FFE84A27
                 if (ret.Background != NG_COLOR)
                 {
                     ret.Background = NG_COLOR;
                     ret.Content = ModelItem.RESULT.NG;
                 }
                 break;
             case ModelItem.RESULT.PNG: //#FFE84A27
                 if (ret.Background != PNG_COLOR)
                 {
                     ret.Background = PNG_COLOR;
                     ret.Content = ModelItem.RESULT.PNG;
                 }
                 break;
         }
     }
 }