Example #1
0
        public void call(string keyid)
        {
            sqlComandlointobill      = String.Format(sqlComandlointobill, keyid.TrimEnd(','));
            sqlComandspbintibill     = String.Format(sqlComandspbintibill, keyid.TrimEnd(','));
            sqlComandlospbrfintobill = String.Format(sqlComandlospbrfintobill, keyid.TrimEnd(','));
            MessageBox.Show(sqlComandspbintibill);

            renouncementset LO  = new renouncementset(ConectString, "MED", "LO");
            renouncementset SPB = new renouncementset(ConectString, "MED", "SPB");
            renouncementset ALL = new renouncementset(ConectString, "MED", "ALL");

            LO.setselectcomand(sqlComandlointobill, CommandType.Text);
            SPB.setselectcomand(sqlComandspbintibill, CommandType.Text);
            ALL.setselectcomand(sqlComandlospbrfintobill, CommandType.Text);
            long iMaxLO = selectLO.maxkeid(selectLO.Ds.Tables["INV_TABL_LO"], "keyid");
            //"System.Int32"


            long iMaxSPB = selectspb.maxkeid(selectspb.Ds.Tables["INV_TABL_SPB"], "keyid");
            long iMaxALL = selectALL.maxkeid(selectALL.Ds.Tables["INV_TABL_ALL"], "keyid");

            MessageBox.Show("" + iMaxALL + iMaxLO + iMaxSPB);
            LO.dataColumn("keyid", "System.Int32", iMaxLO, 1);
            SPB.dataColumn("keyid", "System.Int32", iMaxSPB, 1);
            ALL.dataColumn("keyid", "System.Int32", iMaxALL, 1);



            SPB.adapterinstal();
            LO.adapterinstal();
            ALL.adapterinstal();


            selectALL.load(ALL.Dt, "INV_TABL_ALL");
            selectspb.load(SPB.Dt, "INV_TABL_spb");
            selectLO.load(LO.Dt, "INV_TABL_LO");


            this.Visible = true;
        }
Example #2
0
        private void renouncement_Load(object sender, EventArgs e)
        {
            // TODO: данная строка кода позволяет загрузить данные в таблицу "dataSet1.LUTAG9". При необходимости она может быть перемещена или удалена.
            this.lUTAG9TableAdapter.Fill(this.dataSet1.LUTAG9);
            //  this.ex_oracle.Visible = false;

            selectLO  = new renouncementset(ConectString, "MED", "INV_TABL_LO");
            selectspb = new renouncementset(ConectString, "MED", "INV_TABL_spb");
            selectALL = new renouncementset(ConectString, "MED", "INV_TABL_ALL");
            //--------------------------------------------------------------------------------------------------------------
            calcultionLO  = new Calcultion(datageidlo);
            calcultionSPB = new Calcultion(datagridspbrf);

            selectLO.setselectcomand(sqlselectLO, CommandType.Text);
            selectLO.AddSelectParametr(":Month", this.MonthBox.Text);
            selectLO.AddSelectParametr(":year", OracleType.Number, 5, this.yearBox.Text);


            //--------------------------------------------------------------------------------------------------------------------
            selectLO.setinsertcomand(sqlinsertLO, CommandType.StoredProcedure);
            selectLO.Adapter.InsertCommand.Parameters.Add("tcountry", OracleType.VarChar, 10).Value = "LO";
            selectLO.Adapter.InsertCommand.Parameters.Add("tspecid", OracleType.Number, 10, "SpecId");
            selectLO.Adapter.InsertCommand.Parameters.Add("tSUMOTK", OracleType.Number, 12, "SUMOTK");
            selectLO.Adapter.InsertCommand.Parameters.Add("tPOS", OracleType.Number, 12, "POS");
            selectLO.Adapter.InsertCommand.Parameters.Add("tOBR", OracleType.Number, 12, "OBR");
            selectLO.Adapter.InsertCommand.Parameters.Add("tQTY", OracleType.Number, 12, "QTY");
            selectLO.Adapter.InsertCommand.Parameters.Add("tUET", OracleType.Number, 12, "UET");
            selectLO.Adapter.InsertCommand.Parameters.Add("tYEAR", OracleType.Number, 12).Value   = int.Parse(yearBox.Text);
            selectLO.Adapter.InsertCommand.Parameters.Add("tMonth", OracleType.VarChar, 12).Value = MonthBox.Text;
            selectLO.Adapter.InsertCommand.Parameters.Add("v_cunt", OracleType.Number, 12).Value  = 0;
            ///-----------------------------------------------------------------------------------------------------------------
            selectLO.setupdatecomand(sqlUPDATELO, CommandType.StoredProcedure);
            selectLO.Adapter.UpdateCommand.Parameters.Add("tcountry", OracleType.VarChar, 10).Value = "LO";
            selectLO.Adapter.UpdateCommand.Parameters.Add("tkeyid", OracleType.Number, 10, "keyid");
            selectLO.Adapter.UpdateCommand.Parameters.Add("tspecid", OracleType.Number, 10, "SpecId");
            selectLO.Adapter.UpdateCommand.Parameters.Add("tSUMOTK", OracleType.Number, 12, "SUMOTK");
            selectLO.Adapter.UpdateCommand.Parameters.Add("tPOS", OracleType.Number, 12, "POS");
            selectLO.Adapter.UpdateCommand.Parameters.Add("tOBR", OracleType.Number, 12, "OBR");
            selectLO.Adapter.UpdateCommand.Parameters.Add("tQTY", OracleType.Number, 12, "QTY");
            selectLO.Adapter.UpdateCommand.Parameters.Add("tUET", OracleType.Number, 12, "UET");
            selectLO.Adapter.UpdateCommand.Parameters.Add("tYEAR", OracleType.Number, 12).Value   = int.Parse(yearBox.Text);
            selectLO.Adapter.UpdateCommand.Parameters.Add("tMonth", OracleType.VarChar, 12).Value = MonthBox.Text;

            selectLO.setdeletcomand(sqldeletLO, CommandType.StoredProcedure);
            selectLO.Adapter.DeleteCommand.Parameters.Add("tcountry", OracleType.VarChar, 10).Value = "LO";
            selectLO.Adapter.DeleteCommand.Parameters.Add("tkeyid", OracleType.Number, 10, "keyid");

            selectLO.adapterinstal();
            ///----------------------------------------------------------------------------------------------------------------
            selectspb.setselectcomand(sqlselectspb, CommandType.Text);
            selectspb.Adapter.SelectCommand.Parameters.AddWithValue(":Month", this.MonthBox.Text);
            selectspb.Adapter.SelectCommand.Parameters.Add(":year", OracleType.Number, 5).Value = this.yearBox.Text;

            //-----------------------------------------------------------------------------------------------------------------------------
            //--------------------------------------------------------------------------------------------------------------------
            selectspb.setinsertcomand(sqlinsertspb, CommandType.StoredProcedure);
            selectspb.Adapter.InsertCommand.Parameters.Add("tcountry", OracleType.VarChar, 10).Value = "RF";
            selectspb.Adapter.InsertCommand.Parameters.Add("tspecid", OracleType.Number, 10, "SpecId");
            selectspb.Adapter.InsertCommand.Parameters.Add("tSUMOTK", OracleType.Number, 12, "SUMOTK");
            selectspb.Adapter.InsertCommand.Parameters.Add("tPOS", OracleType.Number, 12, "POS");
            selectspb.Adapter.InsertCommand.Parameters.Add("tOBR", OracleType.Number, 12, "OBR");
            selectspb.Adapter.InsertCommand.Parameters.Add("tQTY", OracleType.Number, 12, "QTY");
            selectspb.Adapter.InsertCommand.Parameters.Add("tUET", OracleType.Number, 12, "UET");
            selectspb.Adapter.InsertCommand.Parameters.Add("tYEAR", OracleType.Number, 12).Value   = int.Parse(yearBox.Text);
            selectspb.Adapter.InsertCommand.Parameters.Add("tMonth", OracleType.VarChar, 12).Value = MonthBox.Text;
            selectspb.Adapter.InsertCommand.Parameters.Add("v_cunt", OracleType.Number, 12).Value  = 0;
            ///-----------------------------------------------------------------------------------------------------------------
            selectspb.setupdatecomand(sqlUPDATEspb, CommandType.StoredProcedure);
            selectspb.Adapter.UpdateCommand.Parameters.Add("tcountry", OracleType.VarChar, 10).Value = "RF";
            selectspb.Adapter.UpdateCommand.Parameters.Add("tkeyid", OracleType.Number, 10, "keyid");
            selectspb.Adapter.UpdateCommand.Parameters.Add("tspecid", OracleType.Number, 10, "SpecId");
            selectspb.Adapter.UpdateCommand.Parameters.Add("tSUMOTK", OracleType.Number, 12, "SUMOTK");
            selectspb.Adapter.UpdateCommand.Parameters.Add("tPOS", OracleType.Number, 12, "POS");
            selectspb.Adapter.UpdateCommand.Parameters.Add("tOBR", OracleType.Number, 12, "OBR");
            selectspb.Adapter.UpdateCommand.Parameters.Add("tQTY", OracleType.Number, 12, "QTY");
            selectspb.Adapter.UpdateCommand.Parameters.Add("tUET", OracleType.Number, 12, "UET");
            selectspb.Adapter.UpdateCommand.Parameters.Add("tYEAR", OracleType.Number, 12).Value   = int.Parse(yearBox.Text);
            selectspb.Adapter.UpdateCommand.Parameters.Add("tMonth", OracleType.VarChar, 12).Value = MonthBox.Text;

            selectspb.setdeletcomand(sqldeletLO, CommandType.StoredProcedure);
            selectspb.Adapter.DeleteCommand.Parameters.Add("tcountry", OracleType.VarChar, 10).Value = "RF";
            selectspb.Adapter.DeleteCommand.Parameters.Add("tkeyid", OracleType.Number, 10, "keyid");

            selectspb.adapterinstal();
///--------------------------------------------------------------------------------------------------------------------------------

            selectALL.setselectcomand(sqlselectall, CommandType.Text);
            selectALL.Adapter.SelectCommand.Parameters.AddWithValue(":Month", this.MonthBox.Text);
            selectALL.Adapter.SelectCommand.Parameters.Add(":year", OracleType.Number, 5).Value = this.yearBox.Text;

            //-----------------------------------------------------------------------------------------------------------------------------
            //--------------------------------------------------------------------------------------------------------------------
            selectALL.setinsertcomand(sqlinsertall, CommandType.StoredProcedure);
            selectALL.Adapter.InsertCommand.Parameters.Add("tcountry", OracleType.VarChar, 10).Value = "ALL";
            selectALL.Adapter.InsertCommand.Parameters.Add("tspecid", OracleType.Number, 10, "SpecId");
            selectALL.Adapter.InsertCommand.Parameters.Add("tSUMOTK", OracleType.Number, 12, "SUMOTK");
            selectALL.Adapter.InsertCommand.Parameters.Add("tPOS", OracleType.Number, 12, "POS");
            selectALL.Adapter.InsertCommand.Parameters.Add("tOBR", OracleType.Number, 12, "OBR");
            selectALL.Adapter.InsertCommand.Parameters.Add("tQTY", OracleType.Number, 12, "QTY");
            selectALL.Adapter.InsertCommand.Parameters.Add("tUET", OracleType.Number, 12, "UET");
            selectALL.Adapter.InsertCommand.Parameters.Add("tYEAR", OracleType.Number, 12).Value   = int.Parse(yearBox.Text);
            selectALL.Adapter.InsertCommand.Parameters.Add("tMonth", OracleType.VarChar, 12).Value = MonthBox.Text;
            selectALL.Adapter.InsertCommand.Parameters.Add("v_cunt", OracleType.Number, 12).Value  = 0;
            ///-----------------------------------------------------------------------------------------------------------------
            selectALL.setupdatecomand(sqlUPDATEall, CommandType.StoredProcedure);
            selectALL.Adapter.UpdateCommand.Parameters.Add("tcountry", OracleType.VarChar, 10).Value = "ALL";
            selectALL.Adapter.UpdateCommand.Parameters.Add("tkeyid", OracleType.Number, 10, "keyid");
            selectALL.Adapter.UpdateCommand.Parameters.Add("tspecid", OracleType.Number, 10, "SpecId");
            selectALL.Adapter.UpdateCommand.Parameters.Add("tSUMOTK", OracleType.Number, 12, "SUMOTK");
            selectALL.Adapter.UpdateCommand.Parameters.Add("tPOS", OracleType.Number, 12, "POS");
            selectALL.Adapter.UpdateCommand.Parameters.Add("tOBR", OracleType.Number, 12, "OBR");
            selectALL.Adapter.UpdateCommand.Parameters.Add("tQTY", OracleType.Number, 12, "QTY");
            selectALL.Adapter.UpdateCommand.Parameters.Add("tUET", OracleType.Number, 12, "UET");
            selectALL.Adapter.UpdateCommand.Parameters.Add("tYEAR", OracleType.Number, 12).Value   = int.Parse(yearBox.Text);
            selectALL.Adapter.UpdateCommand.Parameters.Add("tMonth", OracleType.VarChar, 12).Value = MonthBox.Text;

            selectALL.setdeletcomand(sqldeletall, CommandType.StoredProcedure);
            selectALL.Adapter.DeleteCommand.Parameters.Add("tcountry", OracleType.VarChar, 10).Value = "ALL";
            selectALL.Adapter.DeleteCommand.Parameters.Add("tkeyid", OracleType.Number, 10, "keyid");

            selectALL.adapterinstal();

///------------------------------------------------------------------------------------------------------------------------------
            this.datageidlo.DataSource      = selectLO.GetDataView();
            this.datagridspbrf.DataSource   = selectspb.GetDataView();
            this.datagridspbrflo.DataSource = selectALL.GetDataView();
        }