Esempio n. 1
0
        /// <summary>
        /// Genera nodos a partir de la navegaci�n de claves foraneas que referencian a la tabla.
        /// </summary>
        /// <param name="pParentNode">Nodo padre.</param>
        /// <date>2006-04-05T00:00:00</date>
        /// <author>moviedo</author>
        private void GenerateChildNodes(TreeNode pParentNode, ref StoreProcedures pStoreProcedures)
        {
            string wSpName = string.Empty;

            FieldRelationList wRelatedFields;

            try
            {
                if (pParentNode.Nodes.Count == 0)
                {
                    foreach (StoreProcedure wStoreProcedure in pStoreProcedures)
                    {
                        TreeNode wTreeNodeStoreProcedure = AddChildNode(pParentNode, wStoreProcedure.Name);

                        wRelatedFields = new FieldRelationList();

                        foreach (SPParameter wParameter in wStoreProcedure.Parameters)
                        {
                            AddChildNode(wTreeNodeStoreProcedure, wParameter.Name);
                        }
                    }

                    pParentNode.Expand();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 2
0
        internal StoreProcedures LoadStoreProceduresByTables(Tables pTables, bool pLoadParameters)
        {
            string          strSpName        = String.Empty;
            StoreProcedures wStoreProcedures = null;
            StoreProcedure  wStoreProcedure  = null;

            foreach (Table wTabla in pTables)
            {
                DataSet wDtsStores = GetStoreProceduresFromTable(wTabla.Name);
                if (wDtsStores.Tables.Count > 0 && wDtsStores.Tables[0].Rows.Count > 0)
                {
                    foreach (DataRow wDtr in wDtsStores.Tables[0].Rows)
                    {
                        if (wDtr[1].ToString().ToUpper() == "STORED PROCEDURE")
                        {
                            strSpName = wDtr[0].ToString().Substring(4, wDtr[0].ToString().Length - 4);


                            wStoreProcedure = new StoreProcedure();

                            wStoreProcedure.Name = strSpName;
                            if (pLoadParameters == true)
                            {
                                FillParametesAndText(wStoreProcedure);
                            }

                            wStoreProcedures.Add(wStoreProcedure);
                        }
                    }
                }
            }

            return(wStoreProcedures);
        }
Esempio n. 3
0
        /// <summary>
        ///   The STORE command alters data associated with a message in the mailbox.
        ///   http://tools.ietf.org/html/rfc2060#section-6.4.6
        /// </summary>
        /// <param name = "set">The sequence set representing the targeted messages, e.g. "1"; "1,2"; "2:4".</param>
        /// <param name = "value">The keywords to add or remove.</param>
        /// <param name = "procedure">The procedure, whether to add or remove the flags.</param>
        public ImapResponse StoreSilent(SequenceSet set, string value, StoreProcedures procedure)
        {
            var reader   = StoreInternal(set, value, procedure, "FLAGS.SILENT");
            var response = new ImapResponse();

            response.Parse(reader);
            return(response);
        }
Esempio n. 4
0
        private ImapResponseReader StoreInternal(SequenceSet set, string value, StoreProcedures procedure, string commandString)
        {
            var prefix  = procedure == StoreProcedures.Add ? "+" : "-";
            var isUid   = set.IsUid ? "UID " : string.Empty;
            var text    = string.Format("{0}STORE {1} {2}{3} ({4})", isUid, set, prefix, commandString, value);
            var command = new ImapCommand(text);

            return(SendAndReceive(command, false));
        }
Esempio n. 5
0
        private void txtSearch_TextChanged(object sender, EventArgs e)
        {
            Control         send = (Control)sender;
            StoreProcedures sp   = (StoreProcedures)Convert.ToInt32(send.Tag);

            info.Add("str", txtSearch.Text);
            init(info, sp.ToString());
            info.Clear();
        }
Esempio n. 6
0
        /// <summary>
        ///
        /// </summary>
        public Metadata(CnnString cnnString)
            : base(String.Empty)
        {
            _Tables          = new Tables();
            _StoreProcedures = new StoreProcedures();
            _DataBaseServer  = new DataBaseServer(true);

            _DataBaseServer.CurrentCnnString = cnnString;
        }
        //
        // GET: /Dossier/Delete/5

        public ActionResult Delete(int dossierId)
        {
            try
            {
                StoreProcedures.DeleteDossier(dossierId);
            }
            catch (Exception)
            {
                return(RedirectToAction("Details", new { dossierId = dossierId }));
            }

            return(RedirectToAction("Index", "Home"));
        }
Esempio n. 8
0
        /// <summary>
        /// Retorna los StoreProcedures seleccionados en el tree view.-
        /// </summary>
        /// <returns></returns>
        public StoreProcedures GetSelectedStoreProcedures()
        {
            StoreProcedures wStoreProceduresSelected = new StoreProcedures();

            foreach (StoreProcedure wStoreProcedure in _StoreProcedures)
            {
                if (wStoreProcedure.Checked)
                {
                    wStoreProceduresSelected.Add(_StoreProcedures[_StoreProcedures.IndexOf(wStoreProcedure)]);
                }
            }

            return(wStoreProceduresSelected);
        }
Esempio n. 9
0
        private void LoadFromDataBase()
        {
            lblTreeViewSelected.Text = "Cargando StoreProcedure desde la base de datos..";
            ProgressBar.Visible      = true;
            ProgressBar.Maximum      = 10;

            Fwk.DataBase.Metadata Metadata = new Metadata();
            Metadata.AddElementEvent += new AddElementHandler(Metadata_AddElementEvent);
            Metadata.LoadStoreProcedures();
            this._StoreProcedures = Metadata.StoreProcedures;



            Metadata.AddElementEvent -= new AddElementHandler(Metadata_AddElementEvent);
        }
Esempio n. 10
0
        private void UpdateBDD(object sender, EventArgs e)
        {
            Control         send = (Control)sender;
            StoreProcedures sp   = (StoreProcedures)Convert.ToInt32(send.Tag);

            switch (sp)
            {
            case StoreProcedures.Select_Contact_Info:
                break;

            case StoreProcedures.SP___Guardar___Contact_Email_Direction_Number:
                for (int i = 0; i < listControllers.Count(); i++)
                {
                    getValues(listControllers[i]);
                }
                break;

            case StoreProcedures.SP___Eliminar___Contact_Email_Direction_Number:
                info.Add("contactID", contacts[listBoxContacts.SelectedIndex].contactID);
                break;

            case StoreProcedures.SP___Modificar___Contact_Email_Direction_Number:
                info.Add("contactID", contacts[listBoxContacts.SelectedIndex].contactID);
                for (int i = 0; i < listControllers.Count(); i++)
                {
                    getValues(listControllers[i]);
                }
                break;

            case StoreProcedures.__Filtrar__Contacto:

                info.Add("str", txtSearch.Text);

                break;

            default:
                break;
            }

            Conexion.Save(info, sp.ToString());
            init(null, listBoxContacts.Tag.ToString());
            info.Clear();
        }
Esempio n. 11
0
        /// <summary>
        /// Carga todos los store procedures de una base de datos .-
        /// </summary>
        /// <param name="pLoadParameters">Indica si se cargan los parametros y text del Store Procedure .-</param>
        /// <returns></returns>
        internal StoreProcedures LoadStoreProcedures(bool pLoadParameters)
        {
            StoreProcedure  wStoreProcedure  = null;
            StoreProcedures wStoreProcedures = new  StoreProcedures();
            DataSet         wDtsStores       = null;

            try
            {
                wDtsStores = GetStoredProcedureFromDatabase();

                foreach (DataRow wDtr in wDtsStores.Tables[0].Rows)
                {
                    wStoreProcedure = new StoreProcedure();


                    wStoreProcedure.Name   = wDtr["Name"].ToString();
                    wStoreProcedure.Schema = wDtr["Schema"].ToString();

                    if (pLoadParameters == true)
                    {
                        FillParametesAndText(wStoreProcedure);
                    }

                    wStoreProcedures.Add(wStoreProcedure);
                }

                wStoreProcedures.IsLoaded = true;

                wDtsStores.Dispose();
                wDtsStores = null;

                OnAddElementEvent();
                return(wStoreProcedures);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 12
0
        /// <summary>
        /// Carga todos los store procedures de una base de datos .-
        /// </summary>
        /// <param name="pLoadParameters">Indica si se cargan los parametros y text del Store Procedure .-</param>
        /// <returns></returns>
        internal StoreProcedures LoadStoreProcedures(bool pLoadParameters)
		{
			
            StoreProcedure wStoreProcedure = null;
			StoreProcedures wStoreProcedures = new  StoreProcedures() ;
            DataSet wDtsStores = null;
            
			try
			{
				wDtsStores = GetStoredProcedureFromDatabase();
				
				foreach (DataRow wDtr in wDtsStores.Tables [0].Rows)
				{
                    wStoreProcedure = new StoreProcedure();


                    wStoreProcedure.Name = wDtr["Name"].ToString();
                    wStoreProcedure.Schema = wDtr["Schema"].ToString();

                    if (pLoadParameters == true)
                        FillParametesAndText(wStoreProcedure);

                    wStoreProcedures.Add(wStoreProcedure);
				}

				wStoreProcedures.IsLoaded = true;

                wDtsStores.Dispose();
                wDtsStores = null;

                OnAddElementEvent();
				return wStoreProcedures;
			}
			catch(Exception ex)
			{
				throw ex;
			}
        }
Esempio n. 13
0
        /// <summary>
        /// Carga los StoreProcedures de la base de datos accediendo a la base de datos nuevamente.-
        /// </summary>
        /// <returns>StoreProcedures</returns>
        public void LoadStoreProcedures()
        {
            if (!_ReloadObjects)
            {
                return;
            }
            StoreProcedureBack wStoreProcedureBack = new StoreProcedureBack(_DataBaseServer.CnnString.ToString(), _DataBaseServer.ServerVersion);

            try
            {
                _StoreProcedures          = wStoreProcedureBack.LoadStoreProcedures();
                _StoreProcedures.IsLoaded = true;

                if (OnStoreProcedureLoad != null)
                {
                    OnStoreProcedureLoad();
                }
            }
            catch (Exception ex)
            {
                throw new DataBaseExeption(ex, _DataBaseServer.CnnString);
            }
        }
Esempio n. 14
0
        private void button3_Click(object sender, EventArgs e)
        {
            DateTime inicio = DateTime.Now;

            Fwk.DataBase.Metadata Metadata = new Metadata();
            Metadata.LoadStoreProcedures();
            StoreProcedures t = Metadata.StoreProcedures;

            //TreeNode wTreeNode = new TreeNode(cboTable.SelectedValue.ToString());
            TreeNode wTreeNode = new TreeNode("StoreProcedures");

            wTreeNode.Checked = true;
            treeView1.Nodes.Add(wTreeNode);

            GenerateChildNodes(wTreeNode, ref t);


            DateTime final    = DateTime.Now;
            TimeSpan duracion = final - inicio;

            //double segundosTotales = duracion.TotalSeconds;
            lblSPTimeToLoad.Text = duracion.Seconds.ToString();
        }
Esempio n. 15
0
        /// <summary>
        /// Genera nodos a partir de la navegaci�n de claves foraneas que referencian a la tabla.
        /// </summary>
        /// <param name="pParentNode">Nodo padre.</param>
        /// <date>2006-04-05T00:00:00</date>
        /// <author>moviedo</author>
        private void GenerateChildNodes(TreeNode pParentNode, ref StoreProcedures pStoreProcedures)
        {
            string wSpName = string.Empty;

            FieldRelationList wRelatedFields;
            try
            {
                if (pParentNode.Nodes.Count == 0)
                {


                    foreach (StoreProcedure wStoreProcedure in pStoreProcedures)
                    {
                        TreeNode wTreeNodeStoreProcedure = AddChildNode(pParentNode, wStoreProcedure.Name);

                        wRelatedFields = new FieldRelationList();

                        foreach (SPParameter wParameter in wStoreProcedure.Parameters)
                        {
                             AddChildNode(wTreeNodeStoreProcedure, wParameter.Name); 

                        }



                    }

                    pParentNode.Expand();

                }


            }
            catch (Exception ex)
            {
                throw ex;
            }

        }
Esempio n. 16
0
 /// <summary>
 ///
 /// </summary>
 public Metadata() : base(String.Empty)
 {
     _Tables          = new Tables();
     _StoreProcedures = new StoreProcedures();
     _DataBaseServer  = new DataBaseServer(true);
 }
        public DossierDetailsModel(int dossierId, string ConnectionString = "")
        {
            _dossier = (from d in _context.dossiers
                        where d.dossierId == dossierId
                        select new POCO.dossier {
                dossierId = d.dossierId,
                creationDate = d.creationDate,
                dossierName = d.dossierName,
                userId = d.userId
            }).FirstOrDefault();

            _dossierId = dossierId;

            //userName

            _userName = (from d in _context.dossiers
                         join u in _context.AspNetUsers on d.userId equals u.Id
                         where d.dossierId == dossierId
                         select u.UserName).Single();



            _RecordCategories = (from sc in (_context.recordCategories.Where(ec => ec.dossierId == dossierId).ToList())
                                 select new POCO.recordCategory
            {
                description = sc.description,
                dossierId = sc.dossierId,
                isExpense = sc.isExpense,
                recordCategoryId = sc.recordCategoryId,
            }).ToList();



            //TODO: test both methods
            _endYear   = StoreProcedures.GetMaxYearDossier(dossierId);
            _beginYear = StoreProcedures.GetMinYearDossier(dossierId);


            var _RecordSubcategoriesResult = _context.GetrecordSubcategoriesByDossierId(dossierId);

            _RecordSubcategories = (from rscr in _RecordSubcategoriesResult
                                    select new POCO.recordSubcategory
            {
                description = rscr.description,
                recordCategoryId = rscr.recordCategoryId,
                recordSubcategoryId = rscr.recordCategoryId
            }).ToList();


            var myDate  = DateTime.Now;
            var newDate = myDate.AddYears(-1);

            newDate = newDate.AddDays(1);

            string beginDate365dd = Utils.Utils.FormatDate(newDate);
            string endDate365dd   = Utils.Utils.FormatDate(DateTime.Now);

            IncomeStatementTab expenses = new IncomeStatementTab(dossierId, beginDate365dd, endDate365dd, true);
            IncomeStatementTab revenues = new IncomeStatementTab(dossierId, beginDate365dd, endDate365dd, false);

            try
            {
                if (!string.IsNullOrEmpty(ConnectionString))
                {
                    SetStringArrayJS(expenses, ConnectionString);
                }
            }
            catch (Exception)
            {
            }

            _overallExpensesLast365 = expenses.totalDec;
            _overallRevenuesLast365 = revenues.totalDec;


            //var mostExpensiveCategories = (from ex in expenses.report
            //                                where ex.bitmap == 1
            //                                orderby ex.total descending
            //                                select ex.category).Take(4);


            //var ado = new AdoRepository<POCO.yearlyExpensePerCategoryLine>(ConnectionString);



            //_yearlyExpensePerCategoryLines = ado.YearlyExpensePerCategory(dossierId,
            //                                                              mostExpensiveCategories.ElementAt(0),
            //                                                              mostExpensiveCategories.ElementAt(1),
            //                                                              mostExpensiveCategories.ElementAt(2),
            //                                                              mostExpensiveCategories.ElementAt(3),
            //                                                              true);
        }
Esempio n. 18
0
        private void LoadFromDataBase()
        {
            lblTreeViewSelected.Text = "Cargando StoreProcedure desde la base de datos..";
            ProgressBar.Visible = true;
            ProgressBar.Maximum = 10;

            Fwk.DataBase.Metadata Metadata = new Metadata();
            Metadata.AddElementEvent += new AddElementHandler(Metadata_AddElementEvent);
            Metadata.LoadStoreProcedures();
            this._StoreProcedures = Metadata.StoreProcedures;



            Metadata.AddElementEvent -= new AddElementHandler(Metadata_AddElementEvent);
        }
Esempio n. 19
0
        /// <summary>
        /// Retorna los StoreProcedures seleccionados en el tree view.-
        /// </summary>
        /// <returns></returns>
        public StoreProcedures GetSelectedStoreProcedures()
        {
            StoreProcedures wStoreProceduresSelected = new StoreProcedures();
            foreach (StoreProcedure wStoreProcedure in _StoreProcedures)
            {

                if (wStoreProcedure.Checked)
                    wStoreProceduresSelected.Add(_StoreProcedures[_StoreProcedures.IndexOf(wStoreProcedure)]);

            }

            return wStoreProceduresSelected;
        }
Esempio n. 20
0
        /// <summary>
        /// 
        /// </summary>
        public Metadata(CnnString cnnString)
            : base(String.Empty)
        {
            _Tables = new Tables();
            _StoreProcedures = new StoreProcedures();
            _DataBaseServer = new DataBaseServer(true);

            _DataBaseServer.CurrentCnnString = cnnString;
        }
Esempio n. 21
0
        /// <summary>
        /// 
        /// </summary>
		public Metadata():base(String.Empty)
		{
			_Tables = new Tables ();	
			_StoreProcedures = new StoreProcedures ();
			_DataBaseServer = new DataBaseServer (true);
		}
Esempio n. 22
0
 /// <summary>
 ///   The STORE command alters data associated with a message in the mailbox.
 ///   http://tools.ietf.org/html/rfc2060#section-6.4.6
 /// </summary>
 /// <param name = "set">The sequence set representing the targeted messages, e.g. "1"; "1,2"; "2:4".</param>
 /// <param name = "value">The keywords to add or remove.</param>
 /// <param name = "procedure">The procedure, whether to add or remove the flags.</param>
 public ImapResponse StoreSilent(SequenceSet set, string value, StoreProcedures procedure)
 {
     var reader = StoreInternal(set, value, procedure, "FLAGS.SILENT");
     var response = new ImapResponse();
     response.Parse(reader);
     return response;
 }
Esempio n. 23
0
 /// <summary>
 ///   The STORE command alters data associated with a message in the mailbox.
 ///   http://tools.ietf.org/html/rfc2060#section-6.4.6
 /// </summary>
 /// <param name = "set">The sequence set representing the targeted messages, e.g. "1"; "1,2"; "2:4".</param>
 /// <param name = "flags">The flags to add or remove.</param>
 /// <param name = "procedure">The procedure, whether to add or remove the flags.</param>
 public ImapResponse StoreSilent(SequenceSet set, MessageFlags flags, StoreProcedures procedure)
 {
     var value = flags.ToMimeFormat();
     return StoreSilent(set, value, procedure);
 }
Esempio n. 24
0
 private ImapResponseReader StoreInternal(SequenceSet set, string value, StoreProcedures procedure, string commandString)
 {
     var prefix = procedure == StoreProcedures.Add ? "+" : "-";
     var isUid = set.IsUid ? "UID " : string.Empty;
     var text = string.Format("{0}STORE {1} {2}{3} ({4})", isUid, set, prefix, commandString, value);
     var command = new ImapCommand(text);
     return SendAndReceive(command, false);
 }
Esempio n. 25
0
		/// <summary>
		/// Carga los StoreProcedures de la base de datos accediendo a la base de datos nuevamente.-
		/// </summary>
		/// <returns>StoreProcedures</returns>
        public void LoadStoreProcedures()
		{
			if(!_ReloadObjects) return;
			StoreProcedureBack wStoreProcedureBack = new StoreProcedureBack  (_DataBaseServer.CnnString.ToString(),_DataBaseServer.ServerVersion);
			try
			{
				
				_StoreProcedures = wStoreProcedureBack.LoadStoreProcedures();
				_StoreProcedures.IsLoaded = true;

				if(OnStoreProcedureLoad!=null)
					OnStoreProcedureLoad();
				
			}
			catch(Exception ex)
			{
                throw new DataBaseExeption(ex, _DataBaseServer.CnnString);
			}
		}
Esempio n. 26
0
        /// <summary>
        ///   The STORE command alters data associated with a message in the mailbox.
        ///   http://tools.ietf.org/html/rfc2060#section-6.4.6
        /// </summary>
        /// <param name = "set">The sequence set representing the targeted messages, e.g. "1"; "1,2"; "2:4".</param>
        /// <param name = "flags">The flags to add or remove.</param>
        /// <param name = "procedure">The procedure, whether to add or remove the flags.</param>
        public ImapResponse StoreSilent(SequenceSet set, MessageFlags flags, StoreProcedures procedure)
        {
            var value = flags.ToMimeFormat();

            return(StoreSilent(set, value, procedure));
        }