public static double MatrixToMinute(EstimateType caculateType, ref SKMatrix minuteMatrix) { double minuteRadian = MatrixToRadian(ref minuteMatrix); double positiveRadian = minuteRadian < 0 ? minuteRadian + 2 * Math.PI : minuteRadian; if (caculateType == EstimateType.Ceiling) { int roundMinute = (int)Math.Ceiling(positiveRadian * 60 / 2 / Math.PI); return(roundMinute == 60 ? 0 : roundMinute); } else if (caculateType == EstimateType.Round) { int roundMinute = (int)Math.Round(positiveRadian * 60 / 2 / Math.PI); return(roundMinute == 60 ? 0 : roundMinute); } else if (caculateType == EstimateType.Floor) { int roundMinute = (int)Math.Floor(positiveRadian * 60 / 2 / Math.PI); return(roundMinute == 60 ? 0 : roundMinute); } else //Actually { return(positiveRadian * 60 / 2 / Math.PI); } }
private bool Estimate(EstimateType estimateType, int year, long storeID) { using (IDbCommand command = CreateCommand()) { command.CommandTimeout = 0; command.CommandType = CommandType.StoredProcedure; switch (estimateType) { case EstimateType.CashDeskPeople: command.CommandText = "spBusinessVolume_EstimateCashDeskPeople"; break; case EstimateType.WorkingHours: command.CommandText = "spBusinessVolume_EstimateWorkingHours"; break; default: goto case EstimateType.CashDeskPeople; } SqlParameter paramStoreID = new SqlParameter("@StoreID", SqlDbType.BigInt, 8); if (storeID < 0) { paramStoreID.Value = DBNull.Value; } else { paramStoreID.Value = storeID; } command.Parameters.Add(paramStoreID); SqlParameter estimateYear = new SqlParameter("@EstimateYear", SqlDbType.SmallInt, 2); estimateYear.Value = year; command.Parameters.Add(estimateYear); SqlParameter result = new SqlParameter("@result", SqlDbType.Int, 4); result.Direction = ParameterDirection.Output; command.Parameters.Add(result); command.ExecuteNonQuery(); return(((int)result.Value) > 0); } }
public static double MatrixToHour(EstimateType caculateType, ref SKMatrix hourMatrix) { double hourRadian = MatrixToRadian(ref hourMatrix);// + Math.PI; //时针从6点初始 double positiveRadian = hourRadian < 0 ? hourRadian + 2 * Math.PI : hourRadian; if (caculateType == EstimateType.Floor) { return((int)Math.Floor(positiveRadian * 12 / 2 / Math.PI)); } else if (caculateType == EstimateType.Round) { return((int)Math.Round(positiveRadian * 12 / 2 / Math.PI)); } else if (caculateType == EstimateType.Ceiling) { return((int)Math.Ceiling(positiveRadian * 12 / 2 / Math.PI)); } else { return(positiveRadian * 12 / 2 / Math.PI); } }
public DataSet GetRenewEstimate(string VcNumber, EstimateType estimateType) { return(new DataSet()); }