Add() public method

public Add ( Object value ) : int
value Object
return int
        public IResponse Execute(ICruiseRequest request)
        {
            Hashtable velocityContext = new Hashtable();
            ArrayList links = new ArrayList();
            links.Add(new ServerLink(urlBuilder, request.ServerSpecifier, "Server Log", ActionName));

            ProjectStatusListAndExceptions projects = farmService.GetProjectStatusListAndCaptureExceptions(request.ServerSpecifier,
                request.RetrieveSessionToken());
            foreach (ProjectStatusOnServer projectStatusOnServer in projects.StatusAndServerList)
            {
                DefaultProjectSpecifier projectSpecifier = new DefaultProjectSpecifier(projectStatusOnServer.ServerSpecifier, projectStatusOnServer.ProjectStatus.Name);
                links.Add(new ProjectLink(urlBuilder, projectSpecifier, projectSpecifier.ProjectName, ServerLogProjectPlugin.ActionName));
            }
            velocityContext["projectLinks"] = links;
            if (string.IsNullOrEmpty(request.ProjectName))
            {
                velocityContext["log"] = HttpUtility.HtmlEncode(farmService.GetServerLog(request.ServerSpecifier, request.RetrieveSessionToken()));
            }
            else
            {
                velocityContext["currentProject"] = request.ProjectSpecifier.ProjectName;
                velocityContext["log"] = HttpUtility.HtmlEncode(farmService.GetServerLog(request.ProjectSpecifier, request.RetrieveSessionToken()));
            }

            return viewGenerator.GenerateView(@"ServerLog.vm", velocityContext);
        }
        /// <summary>
        /// Action
        /// </summary>
        /// <param name="living"></param>
        public override void Execute(GameLiving living)
        {
            if (CheckPreconditions(living, DEAD | SITTING | MEZZED | STUNNED)) return;

            GamePlayer player = living as GamePlayer;
            if (player != null)
            {
                ArrayList targets = new ArrayList();
                if (player.Group == null)
                    targets.Add(player);
                else
                {
                    foreach (GamePlayer grpplayer in player.Group.GetPlayersInTheGroup())
                    {
                        if (player.IsWithinRadius(grpplayer, SpellRadius) && grpplayer.IsAlive)
                            targets.Add(grpplayer);
                    }
                }
                foreach (GamePlayer target in targets)
                {
                    //send spelleffect
                    if (!target.IsAlive) continue;
                    ValhallasBlessingEffect ValhallasBlessing = target.EffectList.GetOfType<ValhallasBlessingEffect>();
                    if (ValhallasBlessing != null)
                        ValhallasBlessing.Cancel(false);
                    new ValhallasBlessingEffect().Start(target);
                }
            }
            DisableSkill(living);
        }
        public DataSet PRC_PersonasListasDePrecios()
        {
            ArrayList Parameters=new ArrayList(0);

            SqlParameter MODOParameter=new SqlParameter("@MODO",SqlDbType.Int);
            MODOParameter.Size=0;
            MODOParameter.Value=MODO;
            Parameters.Add(MODOParameter);

            SqlParameter PersonasListasDePrecios_IDParameter=new SqlParameter("@PersonasListasDePrecios_ID",SqlDbType.Int);
            PersonasListasDePrecios_IDParameter.Size=0;
            PersonasListasDePrecios_IDParameter.Value=PersonasListasDePrecios_ID;
            Parameters.Add(PersonasListasDePrecios_IDParameter);

            SqlParameter Personas_IDParameter=new SqlParameter("@Personas_ID",SqlDbType.Int);
            Personas_IDParameter.Size=0;
            Personas_IDParameter.Value=Personas_ID;
            Parameters.Add(Personas_IDParameter);

            SqlParameter ListasDePrecios_IDParameter=new SqlParameter("@ListasDePrecios_ID",SqlDbType.Int);
            ListasDePrecios_IDParameter.Size=0;
            ListasDePrecios_IDParameter.Value=ListasDePrecios_ID;
            Parameters.Add(ListasDePrecios_IDParameter);

            SqlParameter PersonasDirecciones_IDParameter=new SqlParameter("@PersonasDirecciones_ID",SqlDbType.Int);
            PersonasDirecciones_IDParameter.Size=0;
            PersonasDirecciones_IDParameter.Value=PersonasDirecciones_ID;
            Parameters.Add(PersonasDirecciones_IDParameter);

             DataSet dsResult=ExecuteStoredProcedure("[Grifo].[PRC_PersonasListasDePrecios]",ref Parameters);

            return dsResult;
        }
Example #4
1
 public IList aListOfPoint()
 {
     IList list = new ArrayList();
     list.Add(new System.Drawing.Point(0,0));
     list.Add(new System.Drawing.Point(5,5));
     return list;
 }
		/// <summary>
		/// Creates a NDataReader from a <see cref="IDataReader" />
		/// </summary>
		/// <param name="reader">The <see cref="IDataReader" /> to get the records from the Database.</param>
		/// <param name="isMidstream"><see langword="true" /> if we are loading the <see cref="IDataReader" /> in the middle of reading it.</param>
		/// <remarks>
		/// NHibernate attempts to not have to read the contents of an <see cref="IDataReader"/> into memory until it absolutely
		/// has to.  What that means is that it might have processed some records from the <see cref="IDataReader"/> and will
		/// pick up the <see cref="IDataReader"/> midstream so that the underlying <see cref="IDataReader"/> can be closed 
		/// so a new one can be opened.
		/// </remarks>
		public NDataReader(IDataReader reader, bool isMidstream)
		{
			ArrayList resultList = new ArrayList(2);

			try
			{
				// if we are in midstream of processing a DataReader then we are already
				// positioned on the first row (index=0)
				if (isMidstream)
				{
					currentRowIndex = 0;
				}

				// there will be atleast one result 
				resultList.Add(new NResult(reader, isMidstream));

				while (reader.NextResult())
				{
					// the second, third, nth result is not processed midstream
					resultList.Add(new NResult(reader, false));
				}

				results = (NResult[]) resultList.ToArray(typeof(NResult));
			}
			catch (Exception e)
			{
				throw new ADOException("There was a problem converting an IDataReader to NDataReader", e);
			}
			finally
			{
				reader.Close();
			}
		}
        public DataTable GetByCriteria(IEntityBase value)
        {
            EConcepRemu objE = (EConcepRemu)value;

            try
            {

                ArrayList arrPrm = new ArrayList();

                arrPrm.Add(DataHelper.CreateParameter("@pidEmpresa", SqlDbType.Char, 3, objE.IdEmpresa));
                arrPrm.Add(DataHelper.CreateParameter("@pidConRemu", SqlDbType.Char, 3, objE.IdConRemu));
                arrPrm.Add(DataHelper.CreateParameter("@pdsConRemu", SqlDbType.VarChar, 50, objE.DsConRemu));
                arrPrm.Add(DataHelper.CreateParameter("@pidTipConcep", SqlDbType.Char, 3, objE.IdTipConcep));
                arrPrm.Add(DataHelper.CreateParameter("@pstCtaCte", SqlDbType.Char, 1, objE.StCtaCte));

                DataTable dt = this.ExecuteDatatable("RH_ConcepRemu_qry01", arrPrm);

                return dt;

            }
            catch (Exception ex)
            {

                ServerObjectException objEx = (ServerObjectException)this.GetException(MethodBase.GetCurrentMethod(), ex);
                throw objEx;

            }
        }
		public void MaxSize()
		{
			IKernel kernel = new DefaultKernel();
			kernel.AddComponent("a", typeof(PoolableComponent1));

			ArrayList instances = new ArrayList();

			instances.Add(kernel["a"] as PoolableComponent1);
			instances.Add(kernel["a"] as PoolableComponent1);
			instances.Add(kernel["a"] as PoolableComponent1);
			instances.Add(kernel["a"] as PoolableComponent1);
			instances.Add(kernel["a"] as PoolableComponent1);

			PoolableComponent1 other1 = kernel["a"] as PoolableComponent1;

			Assert.IsNotNull(other1);
			Assert.IsTrue(!instances.Contains(other1));

			foreach(object inst in instances)
			{
				kernel.ReleaseComponent(inst);
			}

			kernel.ReleaseComponent(other1);

			PoolableComponent1 other2 = kernel["a"] as PoolableComponent1;
			Assert.IsNotNull(other2);
			Assert.IsTrue(other1 != other2);
			Assert.IsTrue(instances.Contains(other2));

			kernel.ReleaseComponent(other2);
		}
        /// <summary>
        /// Crea Horas Para Subsidio
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public int CrearHorasSubsidio(IEntityBase value)
        {
            EProcPlaCalc objE = (EProcPlaCalc)value;

              try
              {

              ArrayList arrPrm = new ArrayList();

              arrPrm.Add(DataHelper.CreateParameter("@pidPeriodo", SqlDbType.Char, 4, objE.IdPeriodo));
              arrPrm.Add(DataHelper.CreateParameter("@pidEmpresa", SqlDbType.Char, 3, objE.IdEmpresa));
              arrPrm.Add(DataHelper.CreateParameter("@pidPlanilla", SqlDbType.Char, 3, objE.IdPlanilla));
              arrPrm.Add(DataHelper.CreateParameter("@pidForPago", SqlDbType.Char, 3, objE.IdForPago));
              arrPrm.Add(DataHelper.CreateParameter("@pnuProcAnual", SqlDbType.SmallInt, objE.NuProcAnual));

              int intRes = this.ExecuteNonQuery("RH_ProcPlaCalc_ope08", arrPrm);

              return intRes;

              }
              catch (Exception ex)
              {

              ServerObjectException objEx = (ServerObjectException)this.GetException(MethodBase.GetCurrentMethod(), ex);
              throw objEx;

              }
        }
        public DataTable GetByCriteria(IEntityBase value)
        {
            EEmpPeriodo objE = (EEmpPeriodo) value;

            try
            {

                ArrayList arrPrm = new ArrayList();

                arrPrm.Add(DataHelper.CreateParameter("@pidEmpresa", SqlDbType.Char,3, objE.IdEmpresa));
                arrPrm.Add(DataHelper.CreateParameter("@pidPeriodo", SqlDbType.Char,4, objE.IdPeriodo));

                DataTable dt = this.ExecuteDatatable("SY_EmpPeriodo_qry01", arrPrm);

                return dt;

            }
            catch(Exception ex)
            {

                ServerObjectException objEx = (ServerObjectException) this.GetException(MethodBase.GetCurrentMethod(), ex);
                throw objEx;

            }
        }
Example #10
0
        public ArrayList GetDataByDealer(int id)
        {
            SqlConnection con = new SqlConnection("Data Source=.\\sqlexpress;Initial Catalog=egas;Integrated Security=True;Pooling=False");
            SqlDataAdapter da = new SqlDataAdapter("select * from customer", con);
            DataSet ds = new DataSet();
            da.Fill(ds, "customer");

            ArrayList arr = new ArrayList();

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                if ((int.Parse(dr[10].ToString()) != id)||(dr[13].ToString() == "PENDING" ))
                {
                    dr.Delete();
                    continue; 
                }
            }

            arr.Add(da);
            arr.Add(ds);
            return arr;



        }
		//rewritten by Corillian so if it doesn't work you know who to yell at ;)
		public void HandlePacket(GameClient client, GSPacketIn packet)
		{
			byte grouped = (byte)packet.ReadByte();
			ArrayList list = new ArrayList();
			if (grouped != 0x00)
			{
				ArrayList groups = GroupMgr.ListGroupByStatus(0x00);
				if (groups != null)
				{
					foreach (Group group in groups)
						if (GameServer.ServerRules.IsAllowedToGroup(group.Leader, client.Player, true))
						{
							list.Add(group.Leader);
						}
				}
			}

			ArrayList Lfg = GroupMgr.LookingForGroupPlayers();

			if (Lfg != null)
			{
				foreach (GamePlayer player in Lfg)
				{
					if (player != client.Player && GameServer.ServerRules.IsAllowedToGroup(client.Player, player, true))
					{
						list.Add(player);
					}
				}
			}

			client.Out.SendFindGroupWindowUpdate((GamePlayer[])list.ToArray(typeof(GamePlayer)));
		}
        public string GenNewCode(IEntityBase value)
        {
            ETablaCorre objE = (ETablaCorre)value;

             try
             {
            ArrayList arrPrm = new ArrayList();

            arrPrm.Add(DataHelper.CreateParameter("@pidPeriodo", SqlDbType.Char, 4, objE.IdPeriodo));
            arrPrm.Add(DataHelper.CreateParameter("@pidEmpresa", SqlDbType.Char, 3, objE.IdEmpresa));
            arrPrm.Add(DataHelper.CreateParameter("@pidTabla", SqlDbType.VarChar, 25, objE.IdTabla));

            DataTable dt = this.ExecuteDatatable("SY_TablaCorre_mnt10", arrPrm);

            int intCode = 0;
            string strFmt = "";

            foreach (DataRow dr in dt.Rows)
            {
               intCode = Convert.ToInt32(dr[0]);
               strFmt = dr[1].ToString();
            }

            return intCode.ToString(strFmt);

             }
             catch (Exception ex)
             {
            ServerObjectException objEx = (ServerObjectException)this.GetException(MethodBase.GetCurrentMethod(), ex);
            throw objEx;

             }
        }
Example #13
0
        static void Main(string[] args)
        {
            //ArrayList
            ArrayList arrayList = new ArrayList();
            arrayList.Add("First item");
            arrayList.Add(5);
            arrayList.Add('c');

            foreach (var item in arrayList) {
                Console.WriteLine("Element of arrayList: {0}", item);
            }

            //HashTable
            Hashtable hashtable = new Hashtable();
            hashtable.Add(0, "Zero item");
            hashtable[1] = "First item";
            hashtable["2"] = "Second item";
            hashtable[Guid.NewGuid()] = "Third item";

            ICollection keys = hashtable.Keys;
            foreach (var key in keys)
            {
                Console.WriteLine("Key: {0}, Value: {1}", key, hashtable[key]);
            }

            //SortedList
            SortedList sl = new SortedList();

            sl.Add("007", "Ritesh Saikia");
            sl.Add("001", "Zara Ali");
            sl.Add("002", "Abida Rehman");
            sl.Add("003", "Joe Holzner");
            sl.Add("004", "Mausam Benazir Nur");
            sl.Add("006", "M. Amlan");
            sl.Add("005", "M. Arif");

            ICollection slValues = sl.Values;
            foreach (var s in slValues) {
                Console.WriteLine("SortedList value: {0}", s);
            }
             //Queue is FIFO: First in First out
            Queue que = new Queue();
            que.Enqueue("Student_1");
            que.Enqueue(5);
            que.Enqueue("Student_2");
            que.Enqueue("Student_3");

            Console.WriteLine(que.Dequeue().ToString());
            Console.WriteLine(que.Dequeue().ToString());

            // Stack is FILO: First in Last out
            Stack StackPop = new Stack();
            StackPop.Push("Student_1");
            StackPop.Push("Student_2");
            StackPop.Push("Student_3");
            Console.WriteLine(StackPop.Pop().ToString());
            Console.WriteLine(StackPop.Pop().ToString());

            Console.ReadLine();
        }
Example #14
0
        public bool isPHPReady()
        {            
            if (!File.Exists(var.strPHPTemplateConfigFilePath))
            {
            	MessageBox.Show("The PHP template file, " + var.strPHPTemplateConfigFilePath + " cannot be found");
            	return false;
            }
            /*if (!File.Exists(var.strPHPTSConfigFilePath))
            {
            	MessageBox.Show("The PHP configuration file, " +  var.strPHPTSConfigFilePath + " cannot be found");
            	return false;
            }
            if (!File.Exists(var.strPHPNTSConfigFilePath))
            {
            	MessageBox.Show("The PHP configuration file, " + var.strPHPNTSConfigFilePath + " cannot be found");
            	return false;
            }*/
        
            // Thread-safe PHP config
            ArrayList alReplace = new ArrayList();
            alReplace.Add(new string[]{";%INCLUDE_PATH%", "include_path=\".;"+var.strPHPTSFolderPath+"\\pear\""});
            alReplace.Add(new string[]{"%EXTDIR%", Path.Combine(var.strPHPTSFolderPath, "ext")});
			File.WriteAllText(var.strPHPTSConfigFilePath, var.replaceText(File.ReadAllText(var.strPHPTemplateConfigFilePath),alReplace));
			
			// Non thread-safe PHP config
			alReplace.Clear();
			alReplace.Add(new string[]{";%INCLUDE_PATH%", "include_path=\".;"+var.strPHPNTSFolderPath+"\\pear\""});
			alReplace.Add(new string[]{"%EXTDIR%", Path.Combine(var.strPHPNTSFolderPath, "ext")});
			File.WriteAllText(var.strPHPNTSConfigFilePath, var.replaceText(File.ReadAllText(var.strPHPTemplateConfigFilePath),alReplace));
			
			Environment.SetEnvironmentVariable("PHP_FCGI_MAX_REQUESTS",var.getString("PHP","numPHPRequests"));
			
			return true;
        }
Example #15
0
        public Listener( int port )
        {
            m_ThisPort = port;
            m_Disposed = false;
            m_Accepted = new Queue();
            m_OnAccept = new AsyncCallback( OnAccept );

            m_Listener = Bind( IPAddress.Any, port );

            try
            {
                IPHostEntry iphe = Dns.Resolve( Dns.GetHostName() );

                ArrayList list = new ArrayList();
                list.Add( IPAddress.Loopback );

                Console.WriteLine( "Address: {0}:{1}", IPAddress.Loopback, port );

                IPAddress[] ips = iphe.AddressList;

                for ( int i = 0; i < ips.Length; ++i )
                {
                    if ( !list.Contains( ips[i] ) )
                    {
                        list.Add( ips[i] );

                        Console.WriteLine( "Address: {0}:{1}", ips[i], port );
                    }
                }
            }
            catch
            {
            }
        }
		public static string[] Split( string src, char delimiter, params char[] quotedelims )
		{
			ArrayList		strings = new ArrayList();
			StringBuilder	sb = new StringBuilder();
			ArrayList		ar = new ArrayList(quotedelims);
			char			quote_open = Char.MinValue;

			foreach (char c in src) 
			{
				if (c == delimiter && quote_open == Char.MinValue) 
				{
					strings.Add( sb.ToString() );
					sb.Remove( 0, sb.Length );
				}
					
				else if (ar.Contains(c)) 
				{
					if (quote_open == Char.MinValue)
						quote_open = c;
					else if (quote_open == c)
						quote_open = Char.MinValue;
					sb.Append(c);
				}
				else
					sb.Append( c );
			}

			if (sb.Length > 0)
				strings.Add( sb.ToString());

			return (string[])strings.ToArray(typeof(string));
		}
Example #17
0
        public DataSet PRC_ArticulosMarcas()
        {
            ArrayList Parameters=new ArrayList(0);

            SqlParameter MODOParameter=new SqlParameter("@MODO",SqlDbType.Int);
            MODOParameter.Size=0;
            MODOParameter.Value=MODO;
            Parameters.Add(MODOParameter);

            SqlParameter ArticulosMarcas_IDParameter=new SqlParameter("@ArticulosMarcas_ID",SqlDbType.Int);
            ArticulosMarcas_IDParameter.Size=0;
            ArticulosMarcas_IDParameter.Value=ArticulosMarcas_ID;
            Parameters.Add(ArticulosMarcas_IDParameter);

            SqlParameter Articulos_IDParameter=new SqlParameter("@Articulos_ID",SqlDbType.Int);
            Articulos_IDParameter.Size=0;
            Articulos_IDParameter.Value=Articulos_ID;
            Parameters.Add(Articulos_IDParameter);

            SqlParameter Marcas_IDParameter=new SqlParameter("@Marcas_ID",SqlDbType.Int);
            Marcas_IDParameter.Size=0;
            Marcas_IDParameter.Value=Marcas_ID;
            Parameters.Add(Marcas_IDParameter);

             DataSet dsResult=ExecuteStoredProcedure("[Grifo].[PRC_ArticulosMarcas]",ref Parameters);

            return dsResult;
        }
Example #18
0
        static void Main(string[] args)
        {
            IList list1 = new ArrayList();
            list1.Add("Hello, ");
            list1.Add("my ");
            list1.Add("dear ");
            list1.Add("old ");
            list1.Add("friend! ");

            IList list2 = new ArrayList();
            list2.Add("my ");
            list2.Add("dear ");
            list2.Add("old ");

            foreach (var value in list2)
            {
                while (list1.Contains(value))
                {
                    list1.Remove(value);
                }
            }

            foreach (var v in list1)
            {
                Console.Write(v);
            }
        }
        private static ArrayList CreateSeparatedSite(String site)
        {
            if (site == null || site.Length == 0)
            {
                throw new ArgumentException( Environment.GetResourceString("Argument_InvalidSite" ));
            }
            Contract.EndContractBlock();

            ArrayList list = new ArrayList();
            int braIndex = -1;
            int ketIndex = -1;
            braIndex = site.IndexOf('[');
            if (braIndex == 0)
                ketIndex = site.IndexOf(']', braIndex+1);

            if (ketIndex != -1)
            {
                // Found an IPv6 address. Special case that
                String ipv6Addr = site.Substring(braIndex+1, ketIndex-braIndex-1);
                list.Add(ipv6Addr);
                return list;
            }

            // Regular hostnames or IPv4 addresses
            // We dont need to do this for IPv4 addresses, but it's easier to do it anyway
            String[] separatedArray = site.Split( m_separators );
            
            for (int index = separatedArray.Length-1; index > -1; --index)
            {
                if (separatedArray[index] == null)
                {
                    throw new ArgumentException( Environment.GetResourceString("Argument_InvalidSite" ));
                }
                else if (separatedArray[index].Equals( "" )) 
                {
                    if (index != separatedArray.Length-1) 
                    {
                        throw new ArgumentException( Environment.GetResourceString("Argument_InvalidSite" ));
                    }
                }
                else if (separatedArray[index].Equals( "*" ))
                {
                    if (index != 0)
                    {
                        throw new ArgumentException( Environment.GetResourceString("Argument_InvalidSite" ));
                    }
                    list.Add( separatedArray[index] );
                }
                else if (!AllLegalCharacters( separatedArray[index] ))
                {
                    throw new ArgumentException( Environment.GetResourceString("Argument_InvalidSite" ));
                }
                else
                {
                    list.Add( separatedArray[index] );
                }
            }
            
            return list;
        }
        public void Call()
        {
            AbstractMachineState state = new AbstractMachineState(new AMFactory());
            ArrayList prog = new ArrayList();
            prog.Add(new PutConstantInstruction());
            prog.Add(new HaltInstruction());

            state.Initialize(prog);

            AMProgram program = (AMProgram)state.Program;

            ProgramClause clause = new ProgramClause("male", 2);

            program.AddLabel("male/2", clause);

            CallInstruction i = new CallInstruction();

            object[] args = { "male", "2" };

            i.Process(args);

            i.Execute(state);
            Assert.AreEqual("call", i.Name());
            Assert.AreEqual(2, i.NumberOfArguments());
            Assert.AreSame(clause, program.P);
            Assert.AreEqual("halt", program.CP.Instruction.Name());
        }
        public int Delete(IEntityBase value)
        {
            ETablaCorre objE = (ETablaCorre)value;

             try
             {

            ArrayList arrPrm = new ArrayList();

            arrPrm.Add(DataHelper.CreateParameter("@pidPeriodo", SqlDbType.Char, 4, objE.IdPeriodo));
            arrPrm.Add(DataHelper.CreateParameter("@pidEmpresa", SqlDbType.Char, 3, objE.IdEmpresa));
            arrPrm.Add(DataHelper.CreateParameter("@pidTabla", SqlDbType.VarChar, 10, objE.IdTabla));

            int intRes = this.ExecuteNonQuery("SY_TablaCorre_mnt03", arrPrm);

            return intRes;

             }
             catch (Exception ex)
             {

            ServerObjectException objEx = (ServerObjectException)this.GetException(MethodBase.GetCurrentMethod(), ex);
            throw objEx;

             }
        }
Example #22
0
        public AssemblerMethod(Method method, AssemblerLine[] lines)
        {
            this.method = method;
            this.lines = lines;
            addresses = new ArrayList ();

            ArrayList contents = new ArrayList ();
            foreach (AssemblerLine line in lines) {
                if (line.Label != null) {
                    if (end_row > 0) {
                        contents.Add ("");
                        end_row++;
                    } else
                        start_row++;
                    contents.Add (String.Format ("{0}:", line.Label));
                    end_row++;
                }

                addresses.Add (new LineEntry (line.Address, 0, ++end_row));
                contents.Add (String.Format ("  {0:x}   {1}", line.Address, line.Text));
            }

            string[] text = new string [contents.Count];
            contents.CopyTo (text);

            buffer = new SourceBuffer (method.Name, text);
        }
Example #23
0
        static void Main(string[] args)
        {
            ArrayList arrayList = new ArrayList();
            arrayList.Add("agnaldo");
            arrayList.Add(1);
            arrayList.Add(10.1205);

            Console.WriteLine(arrayList.Count);

            foreach (var item in arrayList)
                Console.WriteLine(item);

            Console.WriteLine();

            List<int> list = new List<int>();
            list.Add(1);
            list.Add(11);
            list.Add(11);
            list.Add(11);
            list.Add(11);
            list.Add(111);
            //list.Add(11.11);

            Console.WriteLine(list.Count);

            foreach (var item in list)
                Console.WriteLine(item);

            Console.ReadKey();
        }
Example #24
0
        public bool UpdateTjcy(ActionEnum action, Xm_Ysxx ysxx, List<Item_File> fileInfos)
        {
            ArrayList sqls = new ArrayList();
            string tmpSql;

            switch (action)
            {
                case ActionEnum.Insert:
                    sqls.Add(SqlBuilder.BuildInsertSql(ysxx));
                    break;
                case ActionEnum.Update:
                    sqls.Add(SqlBuilder.BuildUpdateSql(ysxx));
                    break;
            }

            //清空项目所有的文件。
            tmpSql = "delete from item_file where itemcode = '{0}' and nodeid = '{1}' and filecode not in ('24','25','26')";
            tmpSql = string.Format(tmpSql, ysxx.ITEMCODE, (int)WorkFlowNode.JunGong);
            sqls.Add(tmpSql);

            //插入基本信息的文件。
            foreach (Item_File fileInfo in fileInfos)
            {
                sqls.Add(SqlBuilder.BuildInsertSql(fileInfo));
            }

            return OracleHelper.ExecuteCommand(sqls);
        }
        public DataTable GetByCriteria(IEntityBase value)
        {
            EPrestaCuota objE = (EPrestaCuota)value;

             try
             {

            ArrayList arrPrm = new ArrayList();

            arrPrm.Add(DataHelper.CreateParameter("@pidEmpresa", SqlDbType.Char, 3, objE.IdEmpresa));
            arrPrm.Add(DataHelper.CreateParameter("@pidPersonal", SqlDbType.Char, 7, objE.IdPersonal));
            arrPrm.Add(DataHelper.CreateParameter("@pidPrestamo", SqlDbType.Char, 4, objE.IdPrestamo));
            arrPrm.Add(DataHelper.CreateParameter("@pnuCuota", SqlDbType.SmallInt, objE.NuCuota));

            DataTable dt = this.ExecuteDatatable("RH_PrestaCuota_qry01", arrPrm);

            return dt;

             }
             catch (Exception ex)
             {

            ServerObjectException objEx = (ServerObjectException)this.GetException(MethodBase.GetCurrentMethod(), ex);
            throw objEx;

             }
        }
        public DataTable GetByCriteria(IEntityBase value)
        {
            EClienteBandeja objE = (EClienteBandeja)value;

            try
            {

                ArrayList arrPrm = new ArrayList();
                arrPrm.Add(DataHelper.CreateParameter("@pidEmpresa", SqlDbType.Char, 3, objE.IdEmpresa));
                arrPrm.Add(DataHelper.CreateParameter("@pidCliente", SqlDbType.Char, 7, objE.IdCliente));
                arrPrm.Add(DataHelper.CreateParameter("@pnuNif", SqlDbType.VarChar, 20, objE.NuNif));
                arrPrm.Add(DataHelper.CreateParameter("@pdsRazSocial", SqlDbType.VarChar, 150, objE.DsRazSocial));

                DataTable dt = this.ExecuteDatatable("PD_Clientes_qry01", arrPrm);

                return dt;

            }
            catch (Exception ex)
            {

                ServerObjectException objEx = (ServerObjectException)this.GetException(MethodBase.GetCurrentMethod(), ex);
                throw objEx;

            }
        }
Example #27
0
        public DataSet PRC_ProcesosCategrias()
        {
            ArrayList Parameters=new ArrayList(0);

            SqlParameter MODOParameter=new SqlParameter("@MODO",SqlDbType.Int);
            MODOParameter.Size=0;
            MODOParameter.Value=MODO;
            Parameters.Add(MODOParameter);

            SqlParameter ProcesosCategrias_IDParameter=new SqlParameter("@ProcesosCategrias_ID",SqlDbType.Int);
            ProcesosCategrias_IDParameter.Size=0;
            ProcesosCategrias_IDParameter.Value=ProcesosCategrias_ID;
            Parameters.Add(ProcesosCategrias_IDParameter);

            SqlParameter Procesos_IDParameter=new SqlParameter("@Procesos_ID",SqlDbType.Int);
            Procesos_IDParameter.Size=0;
            Procesos_IDParameter.Value=Procesos_ID;
            Parameters.Add(Procesos_IDParameter);

            SqlParameter Categorias_IDParameter=new SqlParameter("@Categorias_ID",SqlDbType.Int);
            Categorias_IDParameter.Size=0;
            Categorias_IDParameter.Value=Categorias_ID;
            Parameters.Add(Categorias_IDParameter);

             DataSet dsResult=ExecuteStoredProcedure("[Grifo].[PRC_ProcesosCategrias]",ref Parameters);

            return dsResult;
        }
        public DataSet PRC_DocumentosCabeceraPersonasDirecciones()
        {
            ArrayList Parameters=new ArrayList(0);

            SqlParameter MODOParameter=new SqlParameter("@MODO",SqlDbType.Int);
            MODOParameter.Size=0;
            MODOParameter.Value=MODO;
            Parameters.Add(MODOParameter);

            SqlParameter DocumentosCabeceraPersonasDirecciones_IDParameter=new SqlParameter("@DocumentosCabeceraPersonasDirecciones_ID",SqlDbType.Int);
            DocumentosCabeceraPersonasDirecciones_IDParameter.Size=0;
            DocumentosCabeceraPersonasDirecciones_IDParameter.Value=DocumentosCabeceraPersonasDirecciones_ID;
            Parameters.Add(DocumentosCabeceraPersonasDirecciones_IDParameter);

            SqlParameter FechaParameter=new SqlParameter("@Fecha",SqlDbType.DateTime);
            FechaParameter.Size=0;
            FechaParameter.Value=Fecha;
            Parameters.Add(FechaParameter);

            SqlParameter DocumentosCabecera_IDParameter=new SqlParameter("@DocumentosCabecera_ID",SqlDbType.Int);
            DocumentosCabecera_IDParameter.Size=0;
            DocumentosCabecera_IDParameter.Value=DocumentosCabecera_ID;
            Parameters.Add(DocumentosCabecera_IDParameter);

            SqlParameter PersonasDirecciones_IDParameter=new SqlParameter("@PersonasDirecciones_ID",SqlDbType.Int);
            PersonasDirecciones_IDParameter.Size=0;
            PersonasDirecciones_IDParameter.Value=PersonasDirecciones_ID;
            Parameters.Add(PersonasDirecciones_IDParameter);

             DataSet dsResult=ExecuteStoredProcedure("[Grifo].[PRC_DocumentosCabeceraPersonasDirecciones]",ref Parameters);

            return dsResult;
        }
Example #29
0
        /// <summary>
        /// Gets/Sets the specified value
        /// </summary>
        public dynamic this[string key]
        {
            get
              {
            if (!Values.ContainsKey(key))
              return null;

            object result = Values[key];
            if (result is IDictionary<string, object>)
              result = new JsonDataObject(result as IDictionary<string, object>);
            else if (result is ArrayList)
            {
              ArrayList resultList = result as ArrayList;
              ArrayList dataList = new ArrayList();
              foreach (object current in resultList)
              {
            if (current is IDictionary<string, object>)
              dataList.Add(new JsonDataObject(current as IDictionary<string, object>));
            else
              dataList.Add(current);
              }

              result = dataList;
            }

            return result;
              }
              set
              {
            if (Values.ContainsKey(key))
              Values[key] = value;
            else
              Values.Add(key, value);
              }
        }
Example #30
0
		public void DrainLife()
		{
			ArrayList list = new ArrayList();

			foreach ( Mobile m in this.GetMobilesInRange( 2 ) )
			{
				if ( m == this || !CanBeHarmful( m ) )
					continue;

				if ( m is BaseCreature && (((BaseCreature)m).Controlled || ((BaseCreature)m).Summoned || ((BaseCreature)m).Team != this.Team) )
					list.Add( m );
				else if ( m.Player )
					list.Add( m );
			}

			foreach ( Mobile m in list )
			{
				DoHarmful( m );

				m.FixedParticles( 0x374A, 10, 15, 5013, 0x496, 0, EffectLayer.Waist );
				m.PlaySound( 0x231 );

				m.SendMessage( "You feel the life drain out of you!" );

				int toDrain = Utility.RandomMinMax( 10, 40 );

				Hits += toDrain;
				m.Damage( toDrain, this );
			}
		}