private void SaveDoc(string FileExcel, string FileA8, int Stato, int bl_id, int Mese, int Anno)
        {
            for (int i = 1; i <= 1; i++)
            {
                S_ControlsCollection _SCollection = new S_ControlsCollection();

                S_Controls.Collections.S_Object s_p_ID = new S_Object();
                s_p_ID.ParameterName = "p_Id";
                s_p_ID.DbType        = CustomDBType.Integer;
                s_p_ID.Direction     = ParameterDirection.Input;
                s_p_ID.Index         = _SCollection.Count;
                s_p_ID.Value         = DBNull.Value;
                _SCollection.Add(s_p_ID);

                S_Controls.Collections.S_Object s_p_BL_ID = new S_Object();
                s_p_BL_ID.ParameterName = "p_bl_Id";
                s_p_BL_ID.DbType        = CustomDBType.Integer;
                s_p_BL_ID.Direction     = ParameterDirection.Input;
                s_p_BL_ID.Index         = _SCollection.Count;
                s_p_BL_ID.Value         = bl_id;
                _SCollection.Add(s_p_BL_ID);

                S_Controls.Collections.S_Object s_p_NOME_DOC = new S_Object();
                s_p_NOME_DOC.ParameterName = "p_NOME_DOC";
                s_p_NOME_DOC.DbType        = CustomDBType.VarChar;
                s_p_NOME_DOC.Direction     = ParameterDirection.Input;
                s_p_NOME_DOC.Size          = 225;
                s_p_NOME_DOC.Index         = _SCollection.Count;
                //				if(i==0)
                s_p_NOME_DOC.Value = System.IO.Path.GetFileName(FileExcel);
                //				else
                //					s_p_NOME_DOC.Value=System.IO.Path.GetFileName(FileA8);
                _SCollection.Add(s_p_NOME_DOC);

                S_Controls.Collections.S_Object s_p_ID_STATO = new S_Object();
                s_p_ID_STATO.ParameterName = "p_ID_STATO";
                s_p_ID_STATO.DbType        = CustomDBType.Integer;
                s_p_ID_STATO.Direction     = ParameterDirection.Input;
                s_p_ID_STATO.Index         = _SCollection.Count;
                s_p_ID_STATO.Value         = Stato;
                _SCollection.Add(s_p_ID_STATO);

                S_Controls.Collections.S_Object s_p_DATA_INVIO = new S_Object();
                s_p_DATA_INVIO.ParameterName = "p_DATA_INVIO";
                s_p_DATA_INVIO.DbType        = CustomDBType.VarChar;
                s_p_DATA_INVIO.Direction     = ParameterDirection.Input;
                s_p_DATA_INVIO.Size          = 225;
                s_p_DATA_INVIO.Index         = _SCollection.Count;
                //				if (CKMail.Checked==true)
                //					s_p_DATA_INVIO.Value= System.DateTime.Now.ToString().Replace('.',':');
                //				else
                s_p_DATA_INVIO.Value = DBNull.Value;
                _SCollection.Add(s_p_DATA_INVIO);

                S_Controls.Collections.S_Object s_p_DATA_INSERIMENTo = new S_Object();
                s_p_DATA_INSERIMENTo.ParameterName = "p_DATA_INSERIMENTo";
                s_p_DATA_INSERIMENTo.DbType        = CustomDBType.VarChar;
                s_p_DATA_INSERIMENTo.Direction     = ParameterDirection.Input;
                s_p_DATA_INSERIMENTo.Size          = 225;
                s_p_DATA_INSERIMENTo.Index         = _SCollection.Count;
                s_p_DATA_INSERIMENTo.Value         = System.DateTime.Now.ToString().Replace('.', ':');
                _SCollection.Add(s_p_DATA_INSERIMENTo);

                S_Controls.Collections.S_Object s_p_anno = new S_Object();
                s_p_anno.ParameterName = "p_anno";
                s_p_anno.DbType        = CustomDBType.Integer;
                s_p_anno.Direction     = ParameterDirection.Input;
                s_p_anno.Size          = 225;
                s_p_anno.Index         = _SCollection.Count;
                s_p_anno.Value         = Anno.ToString();
                _SCollection.Add(s_p_anno);

                S_Controls.Collections.S_Object s_p_note = new S_Object();
                s_p_note.ParameterName = "p_note1";
                s_p_note.DbType        = CustomDBType.VarChar;
                s_p_note.Direction     = ParameterDirection.Input;
                s_p_note.Size          = 225;
                s_p_note.Index         = _SCollection.Count;
                s_p_note.Value         = "";;
                _SCollection.Add(s_p_note);

                S_Controls.Collections.S_Object s_p_mese = new S_Object();
                s_p_mese.ParameterName = "p_mese";
                s_p_mese.DbType        = CustomDBType.Integer;
                s_p_mese.Direction     = ParameterDirection.Input;
                s_p_mese.Size          = 225;
                s_p_mese.Index         = _SCollection.Count;
                s_p_mese.Value         = Mese.ToString();
                _SCollection.Add(s_p_mese);

                //				if(i==0)
                //				{
                if (File.Exists(FileExcel))
                {
                    _inviodoc.SaveMesi(_SCollection);
                }
                //				}
                //				else
                //				{
                //					if (File.Exists(FileA8))
                //						_inviodoc.SaveMesi(_SCollection);
                //				}
            }
        }
Пример #2
0
        private void SalvaInvio()
        {
            S_ControlsCollection _SCollection = new S_ControlsCollection();

            S_Controls.Collections.S_Object s_p_ID = new S_Object();
            s_p_ID.ParameterName = "p_Id";
            s_p_ID.DbType        = CustomDBType.Integer;
            s_p_ID.Direction     = ParameterDirection.Input;
            s_p_ID.Index         = _SCollection.Count;
            s_p_ID.Value         = DBNull.Value;
            _SCollection.Add(s_p_ID);

            S_Controls.Collections.S_Object s_p_BL_ID = new S_Object();
            s_p_BL_ID.ParameterName = "p_bl_Id";
            s_p_BL_ID.DbType        = CustomDBType.Integer;
            s_p_BL_ID.Direction     = ParameterDirection.Input;
            s_p_BL_ID.Index         = _SCollection.Count;
            s_p_BL_ID.Value         = Convert.ToInt32(DrEdifici.SelectedValue);
            _SCollection.Add(s_p_BL_ID);

            S_Controls.Collections.S_Object s_p_NOME_DOC = new S_Object();
            s_p_NOME_DOC.ParameterName = "p_NOME_DOC";
            s_p_NOME_DOC.DbType        = CustomDBType.VarChar;
            s_p_NOME_DOC.Direction     = ParameterDirection.Input;
            s_p_NOME_DOC.Size          = 225;
            s_p_NOME_DOC.Index         = _SCollection.Count;
            s_p_NOME_DOC.Value         = System.IO.Path.GetFileName(UploadFile.PostedFile.FileName);
            _SCollection.Add(s_p_NOME_DOC);

            S_Controls.Collections.S_Object s_p_ID_STATO = new S_Object();
            s_p_ID_STATO.ParameterName = "p_ID_STATO";
            s_p_ID_STATO.DbType        = CustomDBType.Integer;
            s_p_ID_STATO.Direction     = ParameterDirection.Input;
            s_p_ID_STATO.Index         = _SCollection.Count;

            if (DrTipoDocumenti.SelectedValue == "1")
            {
                s_p_ID_STATO.Value = "1";
            }
            if (DrTipoDocumenti.SelectedValue == "2")
            {
                s_p_ID_STATO.Value = "3";
            }
            if (DrTipoDocumenti.SelectedValue == "3")
            {
                s_p_ID_STATO.Value = "1";
            }
            if (DrTipoDocumenti.SelectedValue == "4")
            {
                s_p_ID_STATO.Value = "5";
            }
            if (DrTipoDocumenti.SelectedValue == "5")
            {
                s_p_ID_STATO.Value = "3";
            }

            _SCollection.Add(s_p_ID_STATO);

            S_Controls.Collections.S_Object s_p_DATA_INVIO = new S_Object();
            s_p_DATA_INVIO.ParameterName = "p_DATA_INVIO";
            s_p_DATA_INVIO.DbType        = CustomDBType.VarChar;
            s_p_DATA_INVIO.Direction     = ParameterDirection.Input;
            s_p_DATA_INVIO.Size          = 225;
            s_p_DATA_INVIO.Index         = _SCollection.Count;
            s_p_DATA_INVIO.Value         = System.DateTime.Now.ToShortDateString();
            _SCollection.Add(s_p_DATA_INVIO);

            S_Controls.Collections.S_Object s_p_DATA_INSERIMENTo = new S_Object();
            s_p_DATA_INSERIMENTo.ParameterName = "p_DATA_INSERIMENTo";
            s_p_DATA_INSERIMENTo.DbType        = CustomDBType.VarChar;
            s_p_DATA_INSERIMENTo.Direction     = ParameterDirection.Input;
            s_p_DATA_INSERIMENTo.Size          = 225;
            s_p_DATA_INSERIMENTo.Index         = _SCollection.Count;
            s_p_DATA_INSERIMENTo.Value         = System.DateTime.Now.ToShortDateString();
            _SCollection.Add(s_p_DATA_INSERIMENTo);

            S_Controls.Collections.S_Object s_p_anno = new S_Object();
            s_p_anno.ParameterName = "p_anno";
            s_p_anno.DbType        = CustomDBType.Integer;
            s_p_anno.Direction     = ParameterDirection.Input;
            s_p_anno.Size          = 225;
            s_p_anno.Index         = _SCollection.Count;
            s_p_anno.Value         = DropAnno.SelectedValue;
            _SCollection.Add(s_p_anno);

            S_Controls.Collections.S_Object s_p_note = new S_Object();
            s_p_note.ParameterName = "p_note1";
            s_p_note.DbType        = CustomDBType.VarChar;
            s_p_note.Direction     = ParameterDirection.Input;
            s_p_note.Size          = 225;
            s_p_note.Index         = _SCollection.Count;
            s_p_note.Value         = TxtAnnotazioni.Text.Trim();
            _SCollection.Add(s_p_note);

            if (DrTipoDocumenti.SelectedValue == "2" || DrTipoDocumenti.SelectedValue == "1")
            {
                Result = _inviodoc.SaveAnni(_SCollection);
            }
            else
            {
                S_Controls.Collections.S_Object s_p_mese = new S_Object();
                s_p_mese.ParameterName = "p_mese";
                s_p_mese.DbType        = CustomDBType.Integer;
                s_p_mese.Direction     = ParameterDirection.Input;
                s_p_mese.Size          = 225;
                s_p_mese.Index         = _SCollection.Count;
                s_p_mese.Value         = DropMese.SelectedValue;
                _SCollection.Add(s_p_mese);

                Result = _inviodoc.SaveMesi(_SCollection);
            }
        }