当前位置: 首页>>代码示例>>C#>>正文


C# System.Collections.ArrayList.IndexOf方法代码示例

本文整理汇总了C#中System.Collections.ArrayList.IndexOf方法的典型用法代码示例。如果您正苦于以下问题:C# System.Collections.ArrayList.IndexOf方法的具体用法?C# System.Collections.ArrayList.IndexOf怎么用?C# System.Collections.ArrayList.IndexOf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Collections.ArrayList的用法示例。


在下文中一共展示了System.Collections.ArrayList.IndexOf方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetSourceSystems

        /// <summary>
        /// Get list of unique SourceSystem values present in the collection
        /// </summary>
        /// <returns></returns>
        public BusinessObjects.WorkManagement.eWMSourceSystem[] GetSourceSystems()
        {
            BusinessObjects.WorkManagement.eWMSourceSystem[] arrPropertyValues = null;
            System.Collections.ArrayList colPropertyValues = new System.Collections.ArrayList();

            foreach (AssignmentDetails objDetails in this)
            {
                if (colPropertyValues.IndexOf(objDetails.SourceSystem) < 0)
                {
                    colPropertyValues.Add(objDetails.SourceSystem);
                }
            }

            if (colPropertyValues.Count > 0)
            {
                arrPropertyValues = (BusinessObjects.WorkManagement.eWMSourceSystem[])colPropertyValues.ToArray(typeof(BusinessObjects.WorkManagement.eWMSourceSystem));
            }

            return arrPropertyValues;
        }
开发者ID:bedford603067,项目名称:Augment,代码行数:24,代码来源:AssignmentDetails.cs

示例2: GenerateSummaryTable

		/// <summary>
		/// Generates a Summary Table Outlining the Provider Charges and Revenues
		/// Illustrating Unearned Income
		/// use MinDate and MaxDate to flag all dates
		/// </summary>
		public static DataTable GenerateSummaryTable(int Guarantor,DateTime dtFrom, DateTime dtTo)
		{
			DataTable rValReturnTable = null;
			DataTable dtProviderBalance = Db.GetTableOld(ProviderRevenueByGuarantor(Guarantor,dtFrom,dtTo));
			DataTable dtProvAbbr = Db.GetTableOld("SELECT ProvNum, Abbr FROM Provider");
			if (dtProviderBalance != null && dtProviderBalance.Rows.Count != 0)
			{
				// Get Provider Abbreviations
				System.Collections.Hashtable htAllProvs = new System.Collections.Hashtable();
				for (int i = 0; i < dtProvAbbr.Rows.Count; i++)
					if (!htAllProvs.ContainsKey(dtProvAbbr.Rows[i][0].ToString()))
						htAllProvs[dtProvAbbr.Rows[i][0].ToString()] = dtProvAbbr.Rows[i][1].ToString();
				if (!htAllProvs.ContainsKey("0"))
					htAllProvs["0"] = "Unearned";
				// First establish a list of providers
				System.Collections.ArrayList alProvs = new System.Collections.ArrayList();
				for (int i = 0; i < dtProviderBalance.Rows.Count; i++)
					if (!alProvs.Contains(dtProviderBalance.Rows[i][0].ToString()))
						alProvs.Add(dtProviderBalance.Rows[i][0].ToString());

				// Fill and Create DataTable
				DataTable dtBalancesTable = new DataTable();
				dtBalancesTable.Columns.Add(new DataColumn("Provider", typeof(string)));
				dtBalancesTable.Columns.Add(new DataColumn("Charges", typeof(string)));
				dtBalancesTable.Columns.Add(new DataColumn("Adjustments", typeof(string)));
				dtBalancesTable.Columns.Add(new DataColumn("Revenue", typeof(string)));
				dtBalancesTable.Columns.Add(new DataColumn("Balance", typeof(string)));
				DataRow drWorkingRow = null;
				int ColumnIndex = -1;

				try
				{
					System.Collections.Hashtable htAllProvs_Indexes = new System.Collections.Hashtable();
					for (int i = 0; i < alProvs.Count; i++) // For Each Provider add a Row in the Balances Table
					{
						dtBalancesTable.Rows.Add(dtBalancesTable.NewRow());
						dtBalancesTable.Rows[i][0] = alProvs[i].ToString();
					}

					for (int i = 0; i < dtProviderBalance.Rows.Count; i++)
					{
						drWorkingRow = dtBalancesTable.Rows[alProvs.IndexOf(dtProviderBalance.Rows[i][0].ToString())];
						drWorkingRow[0] = htAllProvs[dtProviderBalance.Rows[i][0].ToString()].ToString(); // the abbreviation

						// Which Column of the Row to add the number to?  Find the column
						// stated in the query's column 2
						string ColumnName_FromQuery = dtProviderBalance.Rows[i][2].ToString();
						ColumnIndex = dtBalancesTable.Columns.IndexOf(ColumnName_FromQuery);
						if (ColumnIndex > 0)
							drWorkingRow[ColumnIndex] = dtProviderBalance.Rows[i][1].ToString(); // note is not cast as number so numeric specifies cannot apply //ToString("F2");
						else
							drWorkingRow[4] = "ERROR!";


						ColumnIndex = -1;
					}
					decimal[] Totals = new decimal[4];
					// Fill in Null and Empty Entries
					for (int j = 0; j < dtBalancesTable.Rows.Count; j++)
						for (int k = 1; k < dtBalancesTable.Columns.Count; k++)
						{
							if (dtBalancesTable.Rows[j][k] == null || dtBalancesTable.Rows[j][k].ToString().Trim() == "")
								dtBalancesTable.Rows[j][k] = "0.00";
							if (k == dtBalancesTable.Columns.Count - 1)
							{
								decimal Balance = decimal.Parse(dtBalancesTable.Rows[j][1].ToString())
								+ decimal.Parse(dtBalancesTable.Rows[j][2].ToString())
								+ decimal.Parse(dtBalancesTable.Rows[j][3].ToString());
								dtBalancesTable.Rows[j][4] = Balance.ToString("F2");
							}
							// Add to the Totals to be placed at the bottom of the Table
							Totals[k - 1] += decimal.Parse(dtBalancesTable.Rows[j][k].ToString());
							// Format the Numbers Better
							dtBalancesTable.Rows[j][k] = decimal.Parse(dtBalancesTable.Rows[j][k].ToString()).ToString("F2");
						}
					DataRow TotalRow = dtBalancesTable.NewRow();
					TotalRow[0] = "Totals-->";
					for (int i = 1; i < dtBalancesTable.Columns.Count; i++)
						TotalRow[i] = Totals[i - 1].ToString("F2");
					dtBalancesTable.Rows.Add(TotalRow);
				}
				catch
				{
				}
				rValReturnTable =  dtBalancesTable; // Set this first becuase SummaryTable_as_Strings() will check for _SummaryTable != null
			//	_SummaryTableHeader = SummaryTable_as_Strings();
			}
			return rValReturnTable;
		}
开发者ID:romeroyonatan,项目名称:opendental,代码行数:94,代码来源:Report1_GuarantorAllocation.cs

示例3: messageArrived


//.........这里部分代码省略.........
									// consider them as members of the topmost class.
									if (classes.Count > 0)
									{
										child.setDefiningClass(0, (String) classes[0]);
										highestLevelWithMembers = Math.Max(highestLevelWithMembers, 0);
									}
								}
								else
								{
									child.setDefiningClass(level, definingClass);
									if (definingClass != null)
									{
										highestLevelWithMembers = Math.Max(highestLevelWithMembers, level);
									}
								}
								addVariableMember(parent.Id, child);
							}
							else
							{
								if (isTraits(child))
								{
									definingClass = child.QualifiedName;
									level = classes.Count;
									
									// If the traits name end with "$", then it represents a class object --
									// in other words, the variables inside it are static variables of that
									// class.  In that case, we need to juggle the information.  For example,
									// if we are told that a variable is a member of "MyClass$", we actually
									// store it into the information for "MyClass".
									if (definingClass.EndsWith("$"))
									{
										//$NON-NLS-1$
										String classWithoutDollar = definingClass.Substring(0, (definingClass.Length - 1) - (0));
										int indexOfClass = classes.IndexOf(classWithoutDollar);
										if (indexOfClass != - 1)
										{
											level = indexOfClass;
											definingClass = classWithoutDollar;
										}
									}
									
									// It wasn't static -- so, add this class to the end of the list of classes
									if (level == classes.Count)
									{
										classes.Add(definingClass);
									}
								}
							}
						}
					}
					
					if (parent != null && parent.getClassHierarchy(true) == null)
					{
                        String[] classesArray = new String[classes.Count];
                        int index = 0;

                        foreach (String className in classes)
                        {
                            classesArray[index++] = className;
                        }

						parent.setClassHierarchy(classesArray, highestLevelWithMembers + 1);
					}
					
					break;
				}
开发者ID:heon21st,项目名称:flashdevelop,代码行数:67,代码来源:DManager.cs

示例4: CreateObject

        protected override Object CreateObject(NonterminalToken token)
        {
            string name;
               int bytes, inx, value;
               CmdItem cmdItem;
               TestValue testval;
               try
               {
               switch (token.Rule.Id)
               {

                   case (int)RuleConstants.RULE_TESTGROUPEXPRESS_TESTEQ:
                       CanTest = false;
                       break;
                   case (int)RuleConstants.RULE_VERSION_VERSIONEQ_FLOAT:
                       this.version = token.Tokens[1].UserObject.ToString();
                       break;
                   case (int)RuleConstants.RULE_TESTGROUPEXPRESS_TESTEQ2:
                       CanTest = true;
                       break;
                   case (int)RuleConstants.RULE_TESTEXPRESS_ATCMD:
                       tmpTestExpress.Add(tmpTestValues);
                       tmpTestValues = new System.Collections.ArrayList(10);
                       break;
                   case (int)RuleConstants.RULE_TESTREPEATITEMS_LBRACE_RBRACE:

                       testval = (TestValue)token.Tokens[0].UserObject;
                       inx = tmpTestValues.IndexOf(testval);
                       for (int i = inx + 1; i < tmpTestValues.Count; i++)
                           testval.subValues.Add(tmpTestValues[i]);
                       for (int i = tmpTestValues.Count - 1; i > inx; i--)
                           tmpTestValues.RemoveAt(i);
                       break;
                   case (int)RuleConstants.RULE_TESTSELECTVALUE_NUMBER:

                       return token.Tokens[0].ToString();
                   case (int)RuleConstants.RULE_TESTSELECTVALUES:
                       return token.Tokens[0].UserObject;

                   case (int)RuleConstants.RULE_TESTSELECTITEM_IDENTIFIER_LPARAN_RPARAN:

                       name = token.Tokens[0].UserObject.ToString();
                       value = Convert.ToInt32(token.Tokens[2].UserObject.ToString());
                       tmpTestValues.Add(testval = new TestValue(name, value));
                       return testval;

                   case (int)RuleConstants.RULE_TESTITEM2:

                       return token.Tokens[0].UserObject;

                   case (int)RuleConstants.RULE_RANGEITEM_IDENTIFIER_LPARAN_RPARAN:
                       NonterminalToken ntok;
                       name = token.Tokens[getTokenInx(token, "Identifier")].UserObject.ToString();
                       ntok = findToken(token, "Bytes");
                       bytes = Convert.ToInt32(ntok.Tokens[0].UserObject.ToString());
                       ntok = findToken(token, "LValue");
                       int lval = Convert.ToInt32(ntok.Tokens[0].UserObject.ToString());
                       ntok = findToken(token, "HValue");
                       int hval = Convert.ToInt32(ntok.Tokens[0].UserObject.ToString());
                       TmpCmdItems.Add(cmdItem = new CmdItem(name, bytes, lval, hval));
                       return cmdItem;

                   case (int)RuleConstants.RULE_SELECTITEM_IDENTIFIER_LPARAN_RPARAN:
                       SelectValue[] selectvalues;
                       name = token.Tokens[0].UserObject.ToString();
                       bytes = Convert.ToInt32(findToken(token, "Bytes").Tokens[0].UserObject.ToString());
                       selectvalues = new SelectValue[TmpSelectValues.Count];
                       for (int i = 0; i < TmpSelectValues.Count; i++)
                       {
                           selectvalues[i] = (SelectValue)TmpSelectValues[i];
                       }
                       TmpCmdItems.Add(cmdItem = new CmdItem(name, bytes, selectvalues));
                       TmpSelectValues.Clear();
                       return cmdItem;

                   case (int)RuleConstants.RULE_SELECTVALUE_NUMBER:
                       SelectValue sVal = new SelectValue();
                       sVal.value = Convert.ToInt32(token.Tokens[0].UserObject.ToString());
                       sVal.valueName = findToken(token, "ValueDescription").Tokens[0].UserObject.ToString();
                       TmpSelectValues.Add(sVal);

                       break;
                   case (int)RuleConstants.RULE_EXPRESSITEM:
                       return token.Tokens[0].UserObject;

                   case (int)RuleConstants.RULE_REPEATEXPRESS_LBRACE_RBRACE:
                       inx = TmpCmdItems.IndexOf(token.Tokens[0].UserObject);
                       for (int i = inx + 1; i < TmpCmdItems.Count; i++)
                           ((CmdItem)TmpCmdItems[inx]).AddSubItems((CmdItem)TmpCmdItems[i]);//reduce repeat item
                       for (int i = TmpCmdItems.Count - 1; i > inx; i--)
                           TmpCmdItems.RemoveAt(i);
                       return TmpCmdItems[inx];
                   case (int)RuleConstants.RULE_SENDEXPRESS_SENDEQ:  //send express
                       tmpSendExpress.Clear();
                       break;
                   case (int)RuleConstants.RULE_SENDEXPRESS_SENDEQ2: //sendexpress
                       tmpSendExpress = (System.Collections.ArrayList)TmpCmdItems.Clone();
                       TmpCmdItems.Clear();
                       break;
                   case (int)RuleConstants.RULE_RETURNEXPRESS_RETURNEQ:
//.........这里部分代码省略.........
开发者ID:ufjl0683,项目名称:sshmc,代码行数:101,代码来源:Protocol.cs

示例5: monitorear

        private void monitorear()
        {
            try
            {
                Logger.Log("Monitoreo iniciado.");
                string queryAlertas =
                    "SELECT nombre, id_satelital, alerta_id, umbral_nivel_verde, umbral_nivel_amarilla," +
                    "       umbral_nivel_roja, umbral_lluvia_verde, umbral_lluvia_amarilla " +
                    "FROM" +
                    "(" +
                    "    SELECT nombre, id_satelital, alerta_id" +
                    "    FROM SAT.Estaciones" +
                    "    WHERE activa = 1 AND alerta_id IS NOT NULL" +
                    ") AS e " +
                    "INNER JOIN (" +
                    "    SELECT id, umbral_nivel_verde, umbral_nivel_amarilla, umbral_nivel_roja, " +
                    "    umbral_lluvia_verde, umbral_lluvia_amarilla" +
                    "    FROM SAT.alertas" +
                    ") AS a ON a.id = e.alerta_id;";
                string queryDatos;
                MySqlConnection con;
                MySqlCommand cmd;
                MySqlDataReader rdrMonitoreo;
                System.Collections.ArrayList alertasEstaciones;
                alerta alertaEstacion;
                while (true)
                {
                    con = new MySqlConnection(Properties.Resources.MySqlConn);
                    cmd = new MySqlCommand(queryAlertas, con);
                    if (con.State != System.Data.ConnectionState.Open)
                    {
                        con.Open();
                        Logger.Log("Conexion a BD abierta");
                    }
                    rdrMonitoreo = cmd.ExecuteReader();
                    Logger.Log("Query de estaciones y alertas ejecutado");
                    string ids = "";
                    alertasEstaciones = new System.Collections.ArrayList(50);
                    Logger.Log("Preparando para leer estaciones");
                    while (rdrMonitoreo.Read())
                    {
                        alertaEstacion = new alerta(rdrMonitoreo.GetString("id_satelital"));
                        //alertaEstacion.idSatelital = ;
                        alertaEstacion.nombre = rdrMonitoreo.GetString("nombre");
                        alertaEstacion.idAlerta = rdrMonitoreo.GetUInt32("alerta_id");
                        alertaEstacion.uNivelVerde = rdrMonitoreo.IsDBNull(3) ? -1.0 : rdrMonitoreo.GetDouble("umbral_nivel_verde");
                        alertaEstacion.uNivelAmarilla = rdrMonitoreo.IsDBNull(4) ? -1.0 : rdrMonitoreo.GetDouble("umbral_nivel_amarilla");
                        alertaEstacion.uNivelRoja = rdrMonitoreo.IsDBNull(5) ? -1.0 : rdrMonitoreo.GetDouble("umbral_nivel_roja");
                        alertaEstacion.uLluviaVerde = rdrMonitoreo.IsDBNull(6) ? -1.0 : rdrMonitoreo.GetDouble("umbral_lluvia_verde");
                        alertaEstacion.uLluviaAmarilla = rdrMonitoreo.IsDBNull(7) ? -1.0 : rdrMonitoreo.GetDouble("umbral_lluvia_amarilla");
                        alertasEstaciones.Add(alertaEstacion);
                        ids += "'" + alertaEstacion.idSatelital + "',";
                    }
                    Logger.Log("Datos de estaciones leidos");
                    rdrMonitoreo.Close();
                    queryDatos =
                        "SELECT sta.SATELLITE_ID, dat.*, d.ED_VALUE " +
                        "FROM xc_data.xc_data1 as d " +
                        "INNER JOIN " +
                        "( " +
                        "SELECT STATION_ID, MAX(TIME_TAG) AS TIME_TAG, SENSORNAME " +
                        "FROM xc_data.xc_data1 " +
                        "WHERE SENSORNAME IN ('LLUVIA', 'NIVEL') " +
                        "GROUP BY STATION_ID, SENSORNAME " +
                        ") as dat on dat.TIME_TAG = d.TIME_TAG AND dat.STATION_ID = d.STATION_ID AND d.SENSORNAME = dat.SENSORNAME " +
                        "INNER JOIN " +
                        "( " +
                        "  SELECT STATION_ID, SATELLITE_ID " +
                        "  FROM xc_data.xc_sites " +
                        //"-- \"  WHERE SATELLITE_ID IN ('5042B196', '5045D644', '504484C2', '5042977A', '50469240', '50439580', '5040E41E')" +
                        "  WHERE SATELLITE_ID IN (" + ids.Substring(0, ids.Length - 1) + ") " +
                        ") as sta ON sta.STATION_ID = dat.STATION_ID;";
                    cmd.CommandText = queryDatos;
                    rdrMonitoreo = cmd.ExecuteReader();
                    Logger.Log("Query de datos ejectuado");
                    Logger.Log("Leyendo datos");
                    while (rdrMonitoreo.Read())
                    {
                        int idx = alertasEstaciones.IndexOf(new alerta(rdrMonitoreo.GetString("SATELLITE_ID")));
                        string msg = "";
                        switch (rdrMonitoreo.GetString("SENSORNAME"))
                        {
                            case "NIVEL":
                                if (rdrMonitoreo.GetDouble("ED_VALUE") >= ((alerta)(alertasEstaciones[idx])).uNivelRoja)
                                {
                                    /*System.Windows.Forms.MessageBox.Show(
                                    "ALERTA ROJA!\n" +
                                    "Estación: " + rdrMonitoreo.GetString("STATION_ID") + "\n" +
                                    "Sensor: " + rdrMonitoreo.GetString("SENSORNAME") + "\n" +
                                    "Umbral:" + ((alerta)(alertasEstaciones[idx])).uNivelRoja.ToString() + "\n" +
                                    "Valor: " + rdrMonitoreo.GetDouble("ED_VALUE").ToString() + "\n" +
                                    "Fecha/Hora: " + rdrMonitoreo.GetString("TIME_TAG") + "\n", "ALERTA!!!");*/
                                    msg = "ALERTA ROJA!\n" +
                                    "Estación: " + rdrMonitoreo.GetString("STATION_ID") + "\n" +
                                    "Sensor: " + rdrMonitoreo.GetString("SENSORNAME") + "\n" +
                                    "Umbral:" + ((alerta)(alertasEstaciones[idx])).uNivelRoja.ToString() + "\n" +
                                    "Valor: " + rdrMonitoreo.GetDouble("ED_VALUE").ToString() + "\n" +
                                    "Fecha/Hora: " + rdrMonitoreo.GetString("TIME_TAG") + "\n";
                                }
                                else if (rdrMonitoreo.GetDouble("ED_VALUE") >= ((alerta)(alertasEstaciones[idx])).uNivelAmarilla)
//.........这里部分代码省略.........
开发者ID:gmahomarf,项目名称:SAT,代码行数:101,代码来源:Monitor.cs

示例6: CalAction

        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        protected void CalAction(HttpContext context, String action)
        {
            DataTable dtf = new DataTable();
            string result;
            if (dtf.Columns.Count < 1)
            {
                DataColumn fName = new DataColumn("mes", Type.GetType("System.String"));

                dtf.Dispose();
                dtf.Columns.Add(fName);

            }
            else
            { dtf.Clear(); }

            DataRow drf = dtf.NewRow();

            drf["mes"] = "OK";

            var parameters = getParameters(context.Request);

            switch (action)
            {
                case "UPDATEMDATE":
                    SysLog.WriteActionLog(context, action);
                    string gsql = "select id from itemrecordhead where mdate is null or mdate=''";
                    DataSet gds = Db.ExecDataSet(gsql);
                    DataTable gdt = gds.Tables[0];
                    for (int i = 0; i < gdt.Rows.Count; i++)
                    {
                       string id= gdt.Rows[i]["id"].ToString();
                       string asql = "select mdate from qcitemrecord where [email protected]";
                       DataSet ads = Db.ExecDataSet(asql, new SqlParameter("id", id));
                       if (ads != null || ads.Tables[0].Rows.Count > 0)
                       {
                           DataTable adt = ads.Tables[0];
                           string mdate = adt.Rows[0]["mdate"].ToString();
                           string usql = "update itemrecordhead set [email protected] where [email protected]";
                           Db.ExecNonQuery(usql, new SqlParameter("mdate", mdate), new SqlParameter("id", id));
                       }
                    }

                    break;

                case "CALHEAD":
                    SysLog.WriteActionLog(context, action);
                    string sql = "delete from itemrecordhead";
                    Db.ExecNonQuery(sql);
                    sql = "select ponumber, poitem,sn,max(pn) as pn,max(type) as type,max(inspected_by) as inspected_by,max(reviewed_by) as reviewed_by,max(approved_by)as approved_by,max(printf)as printf from qcitemrecord group by ponumber,poitem,type,sn";
                    DataSet ds = Db.ExecDataSet(sql);
                    DataTable dt = ds.Tables[0];

                    long hid = DateTime.Now.Ticks;
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        hid++;
                        string pon = dt.Rows[i]["ponumber"].ToString();
                        string item = dt.Rows[i]["poitem"].ToString();
                        string type = dt.Rows[i]["type"].ToString();
                        string pn = dt.Rows[i]["pn"].ToString();
                        string sn = dt.Rows[i]["sn"].ToString();
                        string ib = dt.Rows[i]["inspected_by"].ToString();
                        string rb = dt.Rows[i]["reviewed_by"].ToString();
                        string ab = dt.Rows[i]["approved_by"].ToString();
                        string printf = dt.Rows[i]["printf"].ToString();
                        string sqla = "insert into itemrecordhead(id,ponumber,poitem,pn,sn,type,inspected_by,reviewed_by,approved_by,printf) values(@id,@pon,@item,@pn,@sn,@type,@ib,@rb,@ab,@printf)";
                        Db.ExecNonQuery(sqla, new SqlParameter("id", hid), new SqlParameter("pon", pon), new SqlParameter("item", item), new SqlParameter("pn", pn), new SqlParameter("sn", sn)
                            , new SqlParameter("type", type), new SqlParameter("ib", ib), new SqlParameter("rb", rb), new SqlParameter("ab", ab), new SqlParameter("printf", printf));
                        sqla = "update qcitemrecord set recordh_id = @id where [email protected] and [email protected] and [email protected] and [email protected]";
                        Db.ExecNonQuery(sqla, new SqlParameter("id", hid), new SqlParameter("pon", pon), new SqlParameter("item", item), new SqlParameter("sn", sn)
                        , new SqlParameter("type", type));

                        string sqlus = "select distinct status from qcitemrecord where [email protected]";
                        string hstatus = "";
                        DateTime changet = DateTime.Now;
                        DataSet dsus = Db.ExecDataSet(sqlus, new SqlParameter("id", hid));
                        if (dsus != null || dsus.Tables[0].Rows.Count > 0)
                        {
                            System.Collections.ArrayList Alist = new System.Collections.ArrayList();
                            string sts;
                            for (var k = 0; k < dsus.Tables[0].Rows.Count; k++)
                            {
                                sts = dsus.Tables[0].Rows[k]["status"].ToString().Trim();
                                Alist.Add(sts);
                            }
                            //Alist.Sort();
                            if (Alist.IndexOf("") < 0)
                            {
                                if (Alist.IndexOf("0") < 0)
                                {
                                    if (Alist.IndexOf("-1") < 0)
                                    {
                                        if (Alist.IndexOf("2") < 0)
                                        {
                                            hstatus = "1";
                                        }
                                        else { hstatus = "2"; }
//.........这里部分代码省略.........
开发者ID:hihi77,项目名称:AMEC-ONLINE,代码行数:101,代码来源:service.ashx.cs

示例7: updatestatus

        public static void updatestatus(string id,string irecord_id,string istatus,string changetf)
        {
            //update status of qcitemrecord
            //string sql = "update qcitemrecord set [email protected] where [email protected]_id";
            //Db.ExecNonQuery(sql, new SqlParameter("status", istatus), new SqlParameter("record_id", irecord_id));

            //update status of itemrecordhead

            string recordh_id = id;
            string sqlus = "select distinct status from qcitemrecord where [email protected]";
            string hstatus = "";
            DateTime changet = DateTime.Now;
            DataSet dsus = Db.ExecDataSet(sqlus, new SqlParameter("id", recordh_id));
            if (dsus != null || dsus.Tables[0].Rows.Count > 0)
            {
                System.Collections.ArrayList Alist = new System.Collections.ArrayList();
                string sts;
                for (var i = 0; i < dsus.Tables[0].Rows.Count; i++)
                {
                    sts = dsus.Tables[0].Rows[i]["status"].ToString().Trim();
                    Alist.Add(sts);
                }
                //Alist.Sort();
                if (Alist.IndexOf("") < 0)
                {
                    if (Alist.IndexOf("0") < 0)
                    {
                        if (Alist.IndexOf("-2") < 0)
                        {
                            if (Alist.IndexOf("-1") < 0)
                            {
                                if (Alist.IndexOf("2") < 0)
                                {
                                    hstatus = "1";
                                }
                                else { hstatus = "2"; }
                            }
                            else { hstatus = "-1"; }
                        }
                        else { hstatus = "-2"; }
                    }
                    else { hstatus = "0"; }
                }
                else { hstatus = "0"; }
            }
            if (changetf == "1")
            {
                sqlus = "update itemrecordhead set last_changed = @changet,status = @status where id = @id";
                Db.ExecNonQuery(sqlus, new SqlParameter("changet", changet), new SqlParameter("status", hstatus), new SqlParameter("id", recordh_id));
            }
            else {
                sqlus = "update itemrecordhead set status = @status where id = @id";
                Db.ExecNonQuery(sqlus, new SqlParameter("status", hstatus), new SqlParameter("id", recordh_id));

            }
        }
开发者ID:hihi77,项目名称:AMEC-ONLINE,代码行数:56,代码来源:service.ashx.cs


注:本文中的System.Collections.ArrayList.IndexOf方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。