コード例 #1
0
        void AggiornaGridDettagliFattura()
        {
            DS.invoicedetail.Clear();
            DetailsToUpdate.Clear();
            if (cmbCausale.SelectedIndex < 0)
            {
                return;
            }
            int causale = CfgFn.GetNoNullInt32(cmbCausale.SelectedValue);

            if (causale == 0)
            {
                return;
            }
            string filtercausale = QHC.CmpEq("idtipo", causale);

            if (DS.invoice.Rows.Count == 0)
            {
                return;
            }

            DataRow M             = DS.invoice.Rows[0];
            string  filterinvoice = QHS.AppAnd(QHS.CmpEq("idinvkind", M["idinvkind"]), QHS.CmpEq("yinv", M["yinv"]),
                                               QHS.CmpEq("ninv", M["ninv"]));

            string filterinvoicedetail = filterinvoice;

            filterinvoicedetail = QHS.AppAnd(filterinvoicedetail, QHS.IsNull("idexp_iva"), QHS.IsNull("idexp_taxable"));

            DSCopy = DS.Copy();

            DataAccess.RUN_SELECT_INTO_TABLE(Conn, DSCopy.Tables["invoicedetail"], null, filterinvoicedetail, null, false);
            Conn.DeleteAllUnselectable(DSCopy.Tables["invoicedetail"]);

            MetaData MD = MetaData.GetMetaData(this, "invoicedetail");

            MD.DS = DSCopy;
            MD.DescribeColumns(DSCopy.Tables["invoicedetail"], "wizardiva");
            GetData GD = new GetData();

            GD.InitClass(DSCopy, Conn, "invoicedetail");
            GD.GetTemporaryValues(DSCopy.Tables["invoicedetail"]);
            gridDetails.DataSource = null;
            HelpForm.SetDataGrid(gridDetails, DSCopy.Tables["invoicedetail"]);
            btnSelectAllDetail_Click(null, null);

            VisualizzaUPB();
            RecalcTotalDetails();
        }