コード例 #1
0
        private void btnAggiungi_Click(object sender, EventArgs e)
        {
            if (LimiteImportoRaggiunto())
            {
                return;
            }

            object idpettycash = cmbFondoPS.SelectedValue;

            if (idpettycash == null)
            {
                MessageBox.Show("Selezionare il fondo");
                return;
            }
            decimal importoRimasto = CfgFn.GetNoNullDecimal(HelpForm.GetObjectFromString(typeof(Decimal), txtRimasto.Text, "x.y.c"));
            decimal TotaleFattura  = CfgFn.GetNoNullDecimal(HelpForm.GetObjectFromString(typeof(Decimal), txtTotaleFattura.Text, "x.y.c"));

            FrmAskInfo F = new FrmAskInfo(null, Meta.Dispatcher, DBNull.Value, DBNull.Value, DBNull.Value, importoRimasto, importoRimasto, DBNull.Value, idpettycash, true, "InsertMode");

            if (F.ShowDialog(this) != DialogResult.OK)
            {
                return;
            }
            if (F.Dati == null)
            {
                return;
            }
            DataRow rDati           = F.Dati.Rows[0];
            DataRow RigaSelezionata = DS.Tables["Info"].NewRow();

            object idfinSelected = rDati["idfin"];

            RigaSelezionata["idfin"] = idfinSelected;

            object codefinSelected = rDati["codefin"];

            RigaSelezionata["codefin"] = codefinSelected;

            object idupbSelected = rDati["idupb"];

            RigaSelezionata["idupb"] = idupbSelected;

            object codeupbSelected = rDati["codeupb"];

            RigaSelezionata["codeupb"] = codeupbSelected;

            object idmanSelected = rDati["idman"];

            RigaSelezionata["idman"] = idmanSelected;

            object manSelected = rDati["manager"];

            RigaSelezionata["manager"] = manSelected;

            object amountSelected = rDati["amount"];

            RigaSelezionata["amount"] = amountSelected;

            object idexpSelected = rDati["idexp"];

            RigaSelezionata["idexp"] = idexpSelected;

            object nMovSelected = Conn.DO_READ_VALUE("expense", QHS.CmpEq("idexp", idexpSelected), "nmov");

            RigaSelezionata["nmov"] = nMovSelected;

            object yMovSelected = Conn.DO_READ_VALUE("expense", QHS.CmpEq("idexp", idexpSelected), "ymov");

            RigaSelezionata["ymov"] = yMovSelected;

            DS.Tables["Info"].Rows.Add(RigaSelezionata);
            AggiornaRimastodaAssegnare();
        }
コード例 #2
0
        private void btnModificaInfo_Click(object sender, EventArgs e)
        {
            DataRow RigaSelezionata = GetGridSelectedRow(gridInfo);

            if (RigaSelezionata == null)
            {
                MessageBox.Show("Selezionare un dettaglio.");
                return;
            }

            object idpettycash = cmbFondoPS.SelectedValue;

            if (idpettycash == null)
            {
                MessageBox.Show("Selezionare il fondo");
                return;
            }
            decimal importo = CfgFn.GetNoNullDecimal(RigaSelezionata["amount"]);

            object idupb = RigaSelezionata["idupb"];
            object idman = RigaSelezionata["idman"];
            object idfin = RigaSelezionata["idfin"];
            object idexp = RigaSelezionata["idexp"];

            string filterupb = null;

            decimal    importoRimasto = CfgFn.GetNoNullDecimal(HelpForm.GetObjectFromString(typeof(Decimal), txtRimasto.Text, "x.y.c"));
            FrmAskInfo F = new FrmAskInfo(filterupb, Meta.Dispatcher, idupb, idman, idfin, importo, importoRimasto, idexp, idpettycash, true, "EditMode");

            if (F.ShowDialog(this) != DialogResult.OK)
            {
                return;
            }
            if (F.Dati == null)
            {
                return;
            }
            DataRow rDati         = F.Dati.Rows[0];
            object  idfinSelected = rDati["idfin"];

            RigaSelezionata["idfin"] = idfinSelected;

            object codefinSelected = rDati["codefin"];

            RigaSelezionata["codefin"] = codefinSelected;

            object idupbSelected = rDati["idupb"];

            RigaSelezionata["idupb"] = idupbSelected;

            object codeupbSelected = rDati["codeupb"];

            RigaSelezionata["codeupb"] = codeupbSelected;

            object idmanSelected = rDati["idman"];

            RigaSelezionata["idman"] = idmanSelected;

            object manSelected = rDati["manager"];

            RigaSelezionata["manager"] = manSelected;

            object amountSelected = rDati["amount"];

            RigaSelezionata["amount"] = amountSelected;

            object idexpSelected = rDati["idexp"];

            RigaSelezionata["idexp"] = idexpSelected;

            object nMovSelected = Conn.DO_READ_VALUE("expense", QHS.CmpEq("idexp", idexpSelected), "nmov");

            RigaSelezionata["nmov"] = nMovSelected;

            object yMovSelected = Conn.DO_READ_VALUE("expense", QHS.CmpEq("idexp", idexpSelected), "ymov");

            RigaSelezionata["ymov"] = yMovSelected;

            AggiornaRimastodaAssegnare();
        }