public void Load(ClsDataAccess Da, string Condition = "")
        {
            string OtherCondition = "";

            if (this.mOtherLoadCondition != "")
            {
                OtherCondition = " And " + this.mOtherLoadCondition;
            }

            DataTable Dt;
            DataRow   Dr;

            if (Condition == "")
            {
                Dt = Methods_Query.GetQuery(Da, this.mViewName, "*", "1 = 0");
                Dr = Dt.NewRow();
            }
            else
            {
                Dt = Methods_Query.GetQuery(Da, this.mViewName, "*", Condition + OtherCondition);
                if (Dt.Rows.Count > 0)
                {
                    Dr = Dt.Rows[0];
                }
                else
                {
                    Dr = Dt.NewRow();
                }
            }

            this.mDr = Dr;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Retrieves the insurance lookup tables from the web service and caches them.
        /// </summary>
        private void InitializeLocation()
        {
            try
            {
                lock (typeof(Locations))
                {
                    //AgencyID = GetAgencyID();
                    Order     DataConnection = new Order(Page);
                    DataTable Dt;
                    //Commented below lines on 10/16/2014- issue Location dropdown cache old values #Defect 1567
                    //if (Cache["Location"]==null)
                    //{
                    Dt = DataConnection.LookupDataSet("Insurance", "Location", new object[] { AgencyID }).Tables["LOCATION"];
                    DataRow Dr = Dt.NewRow();
                    Dr["Code"] = "All";
                    Dr["Desc"] = "All";
                    Dt.Rows.InsertAt(Dr, 0);

                    //Cache["Location"] = Dt;
                    _Locations.DataSource = Dt;
                    _Locations.DataBind();

                    //Commented below line on 10/16/2014- issue Location dropdown cache old values #Defect 1567
                    //}
                    DataConnection.Close();
                }
            }
            catch (Exception ex)
            {
                CSAAWeb.AppLogger.Logger.Log("Exception occurred in InitializeLocation method" + ex.ToString());
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Parse XML and create the expected table.
        /// </summary>
        /// <param name="board_xml">XML buffer to be parse</param>
        virtual protected void ParseXml(XmlReader board_xml)
        {
            if (board_xml.NodeType == XmlNodeType.EndElement && board_xml.Name == CurrentElementName)
            {
                NewElement = true;
            }

            if (board_xml.NodeType == XmlNodeType.Element && NewElement == true)
            {
                NewElement         = false;
                CurrentElementName = board_xml.Name;
                Dr = Dt.NewRow();
                AddBoardFieldToTable();
                AddNameFieldToTable(CurrentElementName);
                Dt.Rows.Add(Dr);

                var currentelementName = board_xml.Name;
                board_xml.Read();
                if (board_xml.NodeType == XmlNodeType.Text)
                {
                    AddValueFieldToTable(board_xml.Value);
                }
                else if (board_xml.NodeType == XmlNodeType.Element)
                {
                    ParseXml(board_xml);
                }
            }
        }
Exemplo n.º 4
0
        public void CargarComboBox()
        {
            DataSet   Ds;
            DataTable Dt;
            String    cmd = string.Format("select Codigo_Estudiante, Nombre_Estudiante from Estudiante");

            Ds = Utilidades.Ejecutar(cmd);

            Dt = Ds.Tables[0];
            DataRow fila = Dt.NewRow();

            fila["Nombre_Estudiante"] = "seleccione estudiante";
            Dt.Rows.InsertAt(fila, 0);
            comboBox1.ValueMember   = "Codigo_Estudiante";
            comboBox1.DisplayMember = "Nombre_Estudiante";
            comboBox1.DataSource    = Dt;

            cmd = string.Format("select ID_Servicio , Descripcion from Servicio");
            Ds  = Utilidades.Ejecutar(cmd);

            Dt = Ds.Tables[0];
            DataRow fil = Dt.NewRow();

            fil["Descripcion"] = "seleccione Servicio";
            Dt.Rows.InsertAt(fil, 0);
            comboBox2.ValueMember   = "ID_Servicio";
            comboBox2.DisplayMember = "Descripcion";
            comboBox2.DataSource    = Dt;
        }
Exemplo n.º 5
0
        internal void Add(Dictionary <string, string> myData)
        {
            DataRow drAdd = Dt.NewRow();

            foreach (var item in myData)
            {
                drAdd[item.Key] = item.Value;
            }
            Dt.Rows.Add(drAdd);
        }
        /// <summary>
        /// Retrieves the insurance lookup tables from the web service and caches them.
        /// </summary>
        private void Initialize()
        {
            lock (typeof(RevenueProduct))
            {
                Order     DataConnection = new Order(Page);
                DataTable Dt;
//				if (Cache["INS_Product_Type"]==null)
//				{
//					Dt = DataConnection.LookupDataSet("Insurance", "ProductTypes").Tables["INS_Product_Type"];
                if (Cache["All_INS_Product_Types"] == null)
                {
                    //START Modified by Cognizant on 12/10/2004
                    //To call the WebMethod GetAllProductTypes to fetch all Insurance Product Types (Both IIB and WU products)
                    Dt = DataConnection.LookupDataSet("Insurance", "GetAllProductTypes").Tables["All_INS_Product_Types"];
                    //END
                    //PAS AZ product configuration: Start added data view to sort the product type to be displayed in the product type drop down by cognizant on 03/15/2012
                    DataView productView = Dt.DefaultView;
                    productView.Sort = "Description";
                    Dt = productView.ToTable();
                    //PAS AZ product configuration: End added data view to sort the product type to be displayed in the product type drop down by cognizant on 03/15/2012
                    if (Dt.Rows.Count > 1)
                    {
                        DataRow Row = Dt.NewRow();
                        Row["ID"]          = "-1";
                        Row["Description"] = "All";
                        Dt.Rows.InsertAt(Row, 0);
                    }

                    //Cache["INS_Product_Type"] = Dt;
                    Cache["All_INS_Product_Types"] = Dt;
                }
                if (Cache["INS_Revenue_Type"] == null)
                {
                    Dt = DataConnection.LookupDataSet("Insurance", "RevenueTypes").Tables["INS_Revenue_Type"];
                    if (Dt.Rows.Count > 1)
                    {
                        DataRow Row = Dt.NewRow();
                        Row["ID"]          = "-1";
                        Row["Description"] = "All";
                        Dt.Rows.InsertAt(Row, 0);
                    }
                    Cache["INS_Revenue_Type"] = Dt;
                }
                DataConnection.Close();
            }
        }
Exemplo n.º 7
0
        private DataRow AddComponent(CCMModelItem ccmModelItem, ref int nodeId)
        {
            var dr = Dt.NewRow();

            dr["ID"] = ++nodeId;

            var key = ccmModelItem.ComponentKey.ToString();

            if (_keysIds.ContainsKey(key))
            {
                return(dr);
            }
            // _keysIds[key] = (int)dr["ID"];
            _keysIds[key] = ++nodeId;;

            UpdateDataRowFromModelItem(dr, ccmModelItem);

            Dt.Rows.Add(dr);
            return(dr);
        }
Exemplo n.º 8
0
    protected void Listar()
    {
        int cantidad = GridView1.Rows.Count + 1;

        GridView1.Visible = true;
        int numeroFilas = GridView1.Rows.Count;

        DataTable Dt;

        if (Session["datos"] == null)
        {
            Dt = new DataTable();
            Dt.Columns.Add("Row");
            Dt.Columns.Add("CORREO");
        }
        else
        {
            Dt = Session["datos"] as DataTable;
        }

        int i = 0;

        if (GridView1.Rows.Count > 1)
        {
            i = numeroFilas + 1;
        }
        while (i > cantidad)//cantidad
        {
            DataRow Fila = Dt.NewRow();
            Fila["Row"]    = "";
            Fila["CORREO"] = "";
            i++;
            cantidad--;
            Dt.Rows.Add(Fila);
        }

        GridView1.DataSource = Dt;
        GridView1.DataBind();

        Session["datos"] = Dt;
    }
		/// <summary>
		/// Fill a drop-down listbox with Rep DOs.
		/// </summary>
		public DataTable FillDOListBox(DropDownList listDO, DataTable DOs)
		{
			//OrderClasses.Service.Order DataConnection = new OrderClasses.Service.Order();
			DataTable Dt;
			//Dt = DataConnection.LookupDataSet("Authentication", "GetDOs").Tables[0];
			if (DOs==null) 
			{
				Authentication ua = new Authentication();
				Dt = ua.GetDOs().Tables[0];
				DataRow Row = Dt.NewRow();
				Row["ID"]=-1;
				Row["Description"]="All";
				Dt.Rows.InsertAt(Row, 0);
				DOs = Dt;
			}
			listDO.DataSource=DOs;
			listDO.DataBind();

			return DOs;			
			
		}
Exemplo n.º 10
0
        private void AddRootNode(string displayName)
        {
            var dr = Dt.NewRow();

            // create a data row for the Tree table
            dr["ID"]              = 1;
            dr["EntryNodeType"]   = 0;
            dr["Name"]            = displayName;
            dr["TreeDisplayName"] = displayName;
            dr["GridDisplayName"] = displayName;
            dr["TreeImageIndex"]  = 46;
            dr["Type"]            = string.Empty;
            dr["Host"]            = string.Empty;
            dr["NodeID"]          = string.Empty;
            dr["ApplType"]        = string.Empty;
            dr["ApplVersion"]     = string.Empty;
            dr["CMVer"]           = string.Empty;
            dr["Extension"]       = string.Empty;

            Dt.Rows.InsertAt(dr, 0); // we want root node to be first line in data table, so refresh doesn't expand into another node in the tree, in the short time until we restore selection.
        }
        /// <summary>
        /// Parse XML function for extended data tables
        /// </summary>
        /// <param name="board_xml"></param>
        override protected void ParseXml(XmlReader board_xml)
        {
            if (board_xml.NodeType == XmlNodeType.EndElement && board_xml.Name == CurrentElementName)
            {
                NewElement = true;
            }

            if (board_xml.NodeType == XmlNodeType.Element && NewElement == true)
            {
                NewElement         = false;
                CurrentElementName = board_xml.Name;
                Dr = Dt.NewRow();
                AddBoardFieldToTable();
                AddNameFieldToTable(CurrentElementName);
                Dt.Rows.Add(Dr);
            }

            if (board_xml.NodeType == XmlNodeType.Element && board_xml.Name != CurrentElementName)
            {
                if (!Dt.Columns.Contains(board_xml.Name))
                {
                    Dt.Columns.Add(board_xml.Name);
                }

                var currentelementName = board_xml.Name;
                board_xml.Read();
                if (board_xml.NodeType == XmlNodeType.Text)
                {
                    Dr[currentelementName] = board_xml.Value;
                }
                else if (board_xml.NodeType == XmlNodeType.Element)
                {
                    ParseXml(board_xml);
                }
            }
        }
Exemplo n.º 12
0
        //[-]

        public virtual void Load(ClsKeys Keys = null)
        {
            ClsDataAccess Da           = new ClsDataAccess();
            StringBuilder Sb_Condition = new StringBuilder();
            string        Condition    = "";

            try
            {
                if (Keys != null)
                {
                    if (Keys.Count() != this.mHeader_Key.Count)
                    {
                        throw new Exception("Keys not equal to required keys.");
                    }

                    string Inner_Condition_And = "";
                    bool   IsStart             = false;
                    foreach (string Inner_Key in this.mHeader_Key)
                    {
                        Sb_Condition.Append(Inner_Condition_And + " " + Inner_Key + " = " + Keys[Inner_Key]);
                        if (!IsStart)
                        {
                            Inner_Condition_And = " And ";
                        }
                        IsStart = true;
                    }
                }

                Condition = Sb_Condition.ToString();

                Da.Connect();

                DataTable Dt;
                DataRow   Dr;

                if (Keys == null)
                {
                    Dt = Methods_Query.GetQuery(Da, this.mHeader_ViewName, "*", "1 = 0");
                    Dr = Dt.NewRow();
                }
                else
                {
                    Dt = Methods_Query.GetQuery(Da, this.mHeader_ViewName, "*", Condition);
                    Dr = Dt.Rows[0];
                }

                this.mHeader_Dr = Dr;

                //[-]

                if (this.mBase_TableDetail != null)
                {
                    foreach (ClsBaseTableDetail Inner_Obj in this.mBase_TableDetail)
                    {
                        Inner_Obj.Load(Da, Condition);
                    }
                }

                //[-]

                if (this.mBase_RowDetail != null)
                {
                    foreach (ClsBaseRowDetail Inner_Obj in this.mBase_RowDetail)
                    {
                        Inner_Obj.Load(Da, Condition);
                    }
                }

                //[-]

                this.AddRequired();
            }
            catch { }
        }