public override string ToString() { return(String.Format("{0}, {1}, {2}", StartNumber.ToString().PadLeft(3), _rawCrew.crewName, // String.Join(",", ClubIndices), CategoryName.PadRight(26))); }
public static dynamic GetTSObject(StartNumber dynObject) { if (dynObject is null) { return(null); } return(dynObject.teklaObject); }
public static void DecoratorCalcQuestion() { IFormula formula = new StartNumber(5); formula = new MethodMulDecorator(formula, 2); formula = new MethodAddDecorator(formula, 100); formula = new MethodDivDecorator(formula, 12); formula = new MethodSubDecorator(formula, 3); formula = new MethodMulDecorator(formula, 4); formula = new MethodAddDecorator(formula, 7); Console.WriteLine($"{formula.GetFormula()} Result: {formula.GetResult()}"); }
public override string ToString() { if (StreetNumberIsNumber) { if (StartNumber != EndNumber) { return($"{StartNumber}-{EndNumber}"); } else { return(StartNumber.ToString()); } } else { return(NonNumberStreetNumber); } }
static void Main(string[] args) { StartNumber number = new StartNumber(5); IFormula numberMul2 = new MulDecorator(number, 2); IFormula numberMul2Add100 = new AddDecorator(numberMul2, 100); IFormula numberMul2Add100Div12 = new DivDecorator(numberMul2Add100, 12); IFormula numberMul2Add100Div12Sub3 = new SubDecorator(numberMul2Add100Div12, 3); IFormula numberMul2Add100Div12Sub3Mul4 = new MulDecorator(numberMul2Add100Div12Sub3, 4); IFormula numberMul2Add100Div12Sub3Mul4Add7 = new AddDecorator(numberMul2Add100Div12Sub3Mul4, 7); Console.WriteLine(numberMul2Add100Div12Sub3Mul4Add7.GetFormula()); Console.WriteLine(numberMul2Add100Div12Sub3Mul4Add7.GetResult()); number.modifyNumber(30); Console.WriteLine(numberMul2Add100Div12Sub3Mul4Add7.GetFormula()); Console.WriteLine(numberMul2Add100Div12Sub3Mul4Add7.GetResult()); }
/// <summary> /// 分页查询返回DATASET /// </summary> /// <param name="TableName">需要查询的表名</param> /// <param name="Fields">需要返回的列(所以列*)</param> /// <param name="PageSize">页容量(每页显示页的数量)</param> /// <param name="PageIndex">当前页</param> /// <param name="Where">查询条件(Id=Id)</param> /// <param name="OrderBy">排序(ID desc)</param> /// <returns></returns> public static DataSet Table_List(string TableName, string OrderBy, string Fields, int PageSize, int PageIndex, string Where) { SqlParameter[] parameters = { new SqlParameter("@TableName", SqlDbType.VarChar, 20), new SqlParameter("@Fields", SqlDbType.VarChar, 500), new SqlParameter("@Where", SqlDbType.VarChar, 500), new SqlParameter("@OrderBy", SqlDbType.VarChar, 200), new SqlParameter("@PageSize", SqlDbType.Int), new SqlParameter("@PageIndex", SqlDbType.Int) }; parameters[0].Value = TableName; parameters[1].Value = Fields; parameters[2].Value = Common.LCommon.ClearSql(Where); parameters[3].Value = OrderBy; parameters[4].Value = PageSize; parameters[5].Value = PageIndex; //return DbHelperSQL.RunProcedure("Table_List", parameters, "ds"); //不调用存储过程直接执行查询语句 string Row = ""; string TableWhere = parameters[0].SqlValue.ToString(); int StartNumber; int EndNumber; if (!String.IsNullOrEmpty(parameters[2].SqlValue.ToString())) { TableWhere = parameters[0].SqlValue.ToString() + " where " + parameters[2].SqlValue.ToString(); } if (parameters[4].SqlValue.ToString() != "0") { StartNumber = (Int32.Parse(parameters[5].SqlValue.ToString()) - 1) * Int32.Parse(parameters[4].SqlValue.ToString()) + 1; EndNumber = (Int32.Parse(parameters[5].SqlValue.ToString()) - 1) * Int32.Parse(parameters[4].SqlValue.ToString()) + Int32.Parse(parameters[4].SqlValue.ToString()); Row = " where Row between " + StartNumber.ToString() + " and " + EndNumber.ToString(); } return(DbHelperSQL.Query("with temptbl AS (SELECT ROW_NUMBER() OVER (ORDER BY " + parameters[3].SqlValue.ToString() + ")AS Row, " + parameters[1].SqlValue.ToString() + " FROM " + TableWhere + ") SELECT * FROM temptbl" + Row)); }
public override int GetHashCode() { return(StartNumber.GetHashCode()); }
public void RefreshFields(COneRoundResults RouteResults, CMemberAndResults Parent = null, CFontStyleSettings RowFontStyle = null) { if (m_Parent == null || Parent != null) { m_Parent = Parent; } else { Parent = m_Parent; } if (m_RowFontStyle == null || RowFontStyle != null) { m_RowFontStyle = RowFontStyle; } else { RowFontStyle = m_RowFontStyle; } bool PlainStyleSetted = false; Route1.RefreshFields(Parent, RouteResults, RouteResults.Route1, RowFontStyle, out PlainStyleSetted); Route2.RefreshFields(Parent, RouteResults, RouteResults.Route2, RowFontStyle, out PlainStyleSetted); Sum.RefreshFields(Parent, RouteResults, RouteResults.Sum, RowFontStyle, out PlainStyleSetted); StartNumber.RefreshFields(Parent, RouteResults, RouteResults.Route1, RowFontStyle, out PlainStyleSetted); SurnameAndName.RefreshFields(Parent, RouteResults, RouteResults.Route1, RowFontStyle, out PlainStyleSetted); switch (RouteResults.m_Round) { #region Qualif, Qualif2 case enRounds.Qualif: case enRounds.Qualif2: if (RouteResults.Sum != null && RouteResults.Sum.CondFormating.HasValue) { switch (RouteResults.Sum.CondFormating.Value) { case enCondFormating.StayOnStart: // Находится на старте case enCondFormating.Preparing: // Участник готовится break; case enCondFormating.JustRecievedResult: // Только что полученный результат StartNumber.RefreshFields(Parent, RouteResults, RouteResults.Sum, RowFontStyle, out PlainStyleSetted); SurnameAndName.RefreshFields(Parent, RouteResults, RouteResults.Sum, RowFontStyle, out PlainStyleSetted); break; default: break; } } break; #endregion #region OneEighthFinal, QuaterFinal, SemiFinal, Final case enRounds.OneEighthFinal: case enRounds.QuaterFinal: case enRounds.SemiFinal: case enRounds.Final: break; #endregion } }