Beispiel #1
0
        private bool dgvActGoods_Restore()
        {
            oAct.ClearError();
            oAct.ID = nActID;
            oAct.FillData();
            if (oAct.ErrorNumber == 0)
            {
                if (nActID != 0)
                {
                    oAct.FillTableActsGoods();
                    if (oAct.ErrorNumber == 0)
                    {
                        oAct.TableActsGoods.PrimaryKey                       = null;
                        oAct.TableActsGoods.Columns["ID"].Unique             = false;
                        oAct.TableActsGoods.Columns["ID"].AllowDBNull        = true;
                        oAct.TableActsGoods.Columns["ActGoodID"].Unique      = false;
                        oAct.TableActsGoods.Columns["ActGoodID"].AllowDBNull = true;
                    }
                }
                else
                {
                    oAct.FillTableActsGoodsFromPut(nInputID, nOutputID);
                    if (oAct.ErrorNumber == 0)
                    {
                        oAct.TableActsGoods.PrimaryKey                       = null;
                        oAct.TableActsGoods.Columns["ID"].Unique             = false;
                        oAct.TableActsGoods.Columns["ID"].AllowDBNull        = true;
                        oAct.TableActsGoods.Columns["ActGoodID"].Unique      = false;
                        oAct.TableActsGoods.Columns["ActGoodID"].AllowDBNull = true;
                    }

                    if (dt != null)
                    {
                        oAct.TableActsGoods.Clear();
                        oAct.TableActsGoods.Merge(dt);
                    }
                }
                decimal nQnt = 0;
                decimal nBox = 0;
                foreach (DataRow droRow in oAct.TableActsGoods.Rows)
                {
                    nQnt += (decimal)droRow["QntConfirmed"];
                    nBox += (decimal)droRow["BoxConfirmed"];
                }
                dgvActGoods.GetGridState();
                dgvActGoods.Restore(oAct.TableActsGoods);
                lblTotalQnt.Text = nQnt.ToString("### ### ##0").Trim();
                lblTotalBox.Text = nBox.ToString("# ### ##0.0").Trim();
            }
            return(oAct.ErrorNumber == 0);
        }