public override void HighlightCostume()
 {
     if (dataGridView1.DataSource != null)
     {
         if (!String.IsNullOrEmpty(BaseModifyCostumeID))
         {
             foreach (DataGridViewRow row in dataGridView1.Rows)
             {
                 DifferenceDetailConfirmModel detail = row.DataBoundItem as DifferenceDetailConfirmModel;
                 HighlightCostume(row, detail?.CostumeID);
             }
         }
     }
 }
        public void Initialize(DifferenceOrder differenceOrder = null)
        {
            this.skinLabel_OrderID.Text = string.Empty;
            if (this.models != null)
            {
                this.models.Clear();
            }
            else
            {
                this.models = new List <DifferenceDetailConfirmModel>();
            }

            SetDisplay();
            //如果调拨单
            if (CommonGlobalUtil.OrderType(differenceOrder?.SourceOrderID).Equals("调拨"))
            {
                bool canEdit = HasPermission(RolePermissionEnum.编辑);
                baseButtonConfirm.Enabled = canEdit;
                BaseButtonCancel.Enabled  = canEdit;
                if (differenceOrder.Confirmed)
                {
                    baseButtonConfirm.Visible = false;
                    BaseButtonCancel.Visible  = false;
                }
            }
            else
            {
                baseButtonConfirm.Visible = false;
                BaseButtonCancel.Visible  = false;
            }

            if (differenceOrder != null)
            {
                this.curDifferenceOrder = differenceOrder;
            }

            this.skinLabel_SendShop.Visible    = false;
            this.skinLabel_ReceiveShop.Visible = false;
            this.skinLabel_operator.Visible    = false;
            if (this.curDifferenceOrder != null)
            {
                //  盘点单店铺不是本店的  和  差异单发货方不是本店的  不可以确认差异
                skinLabel_operator.Visible  = false;
                this.guideComboBox1.Visible = false;

                this.skinLabel_OrderID.Text     = "差异单号:" + this.curDifferenceOrder.ID;
                this.skinLabel_SendShop.Text    = "发货方:" + CommonGlobalCache.GetShopName(this.curDifferenceOrder.OutboundShopID);
                this.skinLabel_ReceiveShop.Text = "收货方:" + CommonGlobalCache.GetShopName(this.curDifferenceOrder.InboundShopID);
                this.skinLabel_operator.Text    = "操作人:" + CommonGlobalCache.GetUserName(this.curDifferenceOrder.ConfirmUserID);
                if (this.curDifferenceOrder.InboundShopID == this.curDifferenceOrder.OutboundShopID)
                {
                    this.isCheckStoreOrder = true;

                    if (!LoadSnagShot())
                    {
                        return;
                    }
                    outboundCountDataGridViewTextBoxColumn.HeaderText = "账面数";
                    inboundCountDataGridViewTextBoxColumn.HeaderText  = "实盘数";
                    this.skinLabel_SendShop.Visible    = false;
                    this.skinLabel_ReceiveShop.Visible = false;
                    this.checkStoreDetails             = CommonGlobalCache.ServerProxy.GetCheckStoreDetail(this.curDifferenceOrder.SourceOrderID);
                }
                else
                {
                    //this.BaseButtonCancel.Visible = !curDifferenceOrder.Confirmed;
                    //this.baseButtonConfirm.Visible = !curDifferenceOrder.Confirmed;
                    // this.guideComboBox1.Visible = !curDifferenceOrder.Confirmed && IsPos;
                    this.skinLabel_SendShop.Visible    = true;
                    this.skinLabel_ReceiveShop.Visible = true;
                    //this.skinLabel_operator.Visible = true;
                    this.inboundDetails = CommonGlobalCache.ServerProxy.GetInboundDetail(this.curDifferenceOrder.InboundOrderID);
                }

                if (curDifferenceOrder?.OutboundShopID != CommonGlobalCache.CurrentShopID)
                {
                    this.BaseButtonCancel.Visible   = false;
                    this.baseButtonConfirm.Visible  = false;
                    this.guideComboBox1.Visible     = false;
                    this.skinLabel_operator.Visible = false;
                }

                List <DifferenceDetail> differenceDetails = CommonGlobalCache.ServerProxy.GetDifferenceDetail(this.curDifferenceOrder.ID);
                if (differenceDetails != null)
                {
                    foreach (DifferenceDetail detail in differenceDetails)
                    {
                        foreach (string sizeName in CostumeStoreHelper.CostumeSizeColumn)
                        {
                            String dbSize          = sizeName; //CostumeStoreHelper.GetCostumeSize(sizeName, sizeGroup);
                            int    differenceCount = Convert.ToInt32(CJBasic.Helpers.ReflectionHelper.GetProperty(detail, sizeName));

                            if (differenceCount != 0)
                            {
                                //实盘
                                int inboundCount  = this.GetInboundCount(differenceCount, detail, dbSize);
                                int outboundCount = 0;
                                //变化数
                                int changeCount = 0;
                                if (isCheckStoreOrder)
                                {
                                    //盘点单,库存数=盘点数-差异数
                                    changeCount   = this.GetChangeCount(detail, dbSize);
                                    outboundCount = this.GetOutboundCount(detail, dbSize);;
                                }
                                else
                                {
                                    //调拨、补货
                                    outboundCount = inboundCount + differenceCount;
                                }

                                DifferenceDetailConfirmModel model = new DifferenceDetailConfirmModel()
                                {
                                    CostumeID       = detail.CostumeID,
                                    CostumeName     = CommonGlobalCache.GetCostumeName(detail.CostumeID),
                                    ColorName       = detail.ColorName,
                                    SizeName        = dbSize,
                                    DifferenceCount = differenceCount,
                                    InboundCount    = inboundCount,
                                    OutboundCount   = outboundCount,
                                    ChangeCount     = changeCount
                                };
                                this.models.Add(model);
                            }
                        }
                    }
                }
            }
            this.BindingSource();
        }