本文整理汇总了C#中Parameters.Add方法的典型用法代码示例。如果您正苦于以下问题:C# Parameters.Add方法的具体用法?C# Parameters.Add怎么用?C# Parameters.Add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Parameters
的用法示例。
在下文中一共展示了Parameters.Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CanFollowMV
//判断是否有MV
public bool CanFollowMV(string keyword)
{
Parameters parameters = new Parameters();
parameters.Add("searchType", "mv");
parameters.Add("keyword", keyword);
string url = ConnectionBase.ConstructUrlWithParameters("http://www.yinyuetai.com/search/mv", parameters);
string searchresult = new ConnectionBase().Get(url);
if (string.IsNullOrEmpty(searchresult))
return false;
else
{
MatchCollection mc = Regex.Matches(searchresult, @"<div class=""noResult"">");
if (mc.Count != 0)
{
return false;
}
else
{
MatchCollection mc1 = Regex.Matches(searchresult, @"<div class=""title mv_title"".*?</div>", RegexOptions.Singleline);
if (mc1.Count == 0)
return false;
else
{
Match tmpmatch = Regex.Match(mc1[0].Groups[0].Value, @"href=""([^\""]+?)""");
mvUrl = @"http://www.yinyuetai.com/video/player/" + tmpmatch.Groups[1].Value.Substring(7) + @"/v_0.swf";
return true;
}
}
}
}
示例2: Execute
public override void Execute(Context c)
{
if ((m_parameters.Parameters == null || m_parameters.Parameters.Count == 0) && m_paramFunction == null)
{
m_worldModel.RunProcedure(m_procedure);
}
else
{
Parameters paramValues = new Parameters();
Element proc = m_worldModel.Procedure(m_procedure);
// TO DO: Check number of parameters matches, and that the function exists
int cnt = 0;
foreach (IFunction<object> f in m_parameters.Parameters)
{
paramValues.Add((string)proc.Fields[FieldDefinitions.ParamNames][cnt], f.Execute(c));
cnt++;
}
if (m_paramFunction != null)
{
paramValues.Add((string)proc.Fields[FieldDefinitions.ParamNames][cnt], m_paramFunction);
}
m_worldModel.RunProcedure(m_procedure, paramValues, false);
}
}
示例3: AddNewUser
public bool AddNewUser(Core.User user)
{
try
{
Parameters parameters = new Parameters();
parameters.Add("@FirstName", user.FirstName);
parameters.Add("@UserName", user.UserName);
parameters.Add("@Pass", user.Password);
parameters.Add("@RoleId", user.RoleId);
parameters.Add("@IsActive", user.IsActiveUser);
if (string.IsNullOrWhiteSpace(user.LastName))
parameters.Add("@LastName", DBNull.Value);
else
parameters.Add("@LastName", user.LastName);
if (string.IsNullOrWhiteSpace(user.NICNumber))
parameters.Add("@NICNumber", DBNull.Value);
else
parameters.Add("@NICNumber", user.NICNumber);
ExecuteNoneQuery("proc_AddNewUser", parameters);
return true;
}
catch (Exception)
{
throw;
}
}
示例4: AddNewFuelType
public bool AddNewFuelType(CECRunningChart.Core.FuelType fuelType)
{
try
{
Parameters parameters = new Parameters();
parameters.Add("@FuelName", fuelType.FuelName);
parameters.Add("@Rate", fuelType.FuelRate);
ExecuteNoneQuery("proc_AddNewFuelType", parameters);
return true;
}
catch (Exception)
{
return false;
}
}
示例5: AddNewLubricantType
public bool AddNewLubricantType(CECRunningChart.Core.LubricantType lubricantType)
{
try
{
Parameters parameters = new Parameters();
parameters.Add("@LubricantType", lubricantType.LubricantName);
parameters.Add("@Rate", lubricantType.LubricantRate);
ExecuteNoneQuery("proc_AddNewLubricantType", parameters);
return true;
}
catch (Exception)
{
return false;
}
}
示例6: GetFuelAndLubricantReport
public DataSet GetFuelAndLubricantReport(DateTime startDate, DateTime endDate, int pumpstationId)
{
try
{
Parameters parameters = new Parameters();
parameters.Add("@StartDate", startDate);
parameters.Add("@EndDate", endDate);
parameters.Add("@PumpstationId", pumpstationId);
return ExecuteDataSet("proc_RptFuelLubricantReport", parameters);
}
catch (Exception)
{
throw;
}
}
示例7: GetFuelConsumptionReport
public DataSet GetFuelConsumptionReport(DateTime startDate, DateTime endDate)
{
try
{
Parameters parameters = new Parameters();
parameters.Add("@StartDate", startDate);
parameters.Add("@EndDate", endDate);
return ExecuteDataSet("proc_RptFuelConsumptionReport", parameters);
//return ExecuteDataSet("proc_FuelConsumptionReport", parameters);
}
catch (Exception)
{
throw;
}
}
示例8: IsValidPasswordRestRequest
public bool IsValidPasswordRestRequest(int userId, string oldPassword)
{
try
{
Parameters parameters = new Parameters();
parameters.Add("@UserId", userId);
parameters.Add("@OldPassword", oldPassword);
int value = ExecuteScalar("proc_ValidPasswordResetRequest", parameters);
return value == 1;
}
catch (Exception)
{
throw;
}
}
示例9: AddNewPumpstation
public bool AddNewPumpstation(PumpStation pumpstation)
{
try
{
Parameters parameters = new Parameters();
parameters.Add("@PumpstationName", pumpstation.PumpStationName);
parameters.Add("@Description", pumpstation.Description);
ExecuteNoneQuery("proc_AddNewPumpstation", parameters);
return true;
}
catch (Exception)
{
return false;
}
}
示例10: GetDriverTimeSheetReport
public DataSet GetDriverTimeSheetReport(string driverName, DateTime startDate, DateTime endDate)
{
try
{
Parameters parameters = new Parameters();
parameters.Add("@DriverOperatorName", driverName);
parameters.Add("@StartDate", startDate);
parameters.Add("@EndDate", endDate);
return ExecuteDataSet("proc_RptDriverOperatorTimeSheet", parameters);
}
catch (Exception)
{
throw;
}
}
示例11: UpdatePumpstation
public bool UpdatePumpstation(PumpStation pumpstation)
{
try
{
Parameters parameters = new Parameters();
parameters.Add("@PumpstationId", pumpstation.Id);
parameters.Add("@PumpstationName", pumpstation.PumpStationName);
parameters.Add("@Description", pumpstation.Description);
ExecuteNoneQuery("proc_UpdatePumpstation", parameters);
return true;
}
catch (Exception)
{
throw;
}
}
示例12: ApproveRunningChart
public void ApproveRunningChart(int runningChartId, int approvedBy, DateTime approvedDate)
{
try
{
Parameters parameters = new Parameters();
parameters.Add("@RunningchartId", runningChartId);
parameters.Add("@ApprovedBy", approvedBy);
parameters.Add("@ApprovedDate", approvedDate);
ExecuteNoneQuery("proc_ApproveRunningChart", parameters);
}
catch (Exception)
{
throw;
}
}
示例13: Execute
public override void Execute(Context c)
{
if (m_parameters == null)
{
throw new NotImplementedException();
}
else
{
Element obj = m_appliesTo.Execute(c);
string delName = m_delegate.Execute(c);
DelegateImplementation impl = obj.Fields.Get(delName) as DelegateImplementation;
if (impl == null)
{
throw new Exception(string.Format("Object '{0}' has no delegate implementation '{1}'", obj.Name, m_delegate));
}
Parameters paramValues = new Parameters();
int cnt = 0;
foreach (IFunction<object> f in m_parameters.Parameters)
{
paramValues.Add((string)impl.Definition.Fields[FieldDefinitions.ParamNames][cnt], f.Execute(c));
cnt++;
}
m_worldModel.RunScript(impl.Implementation.Fields[FieldDefinitions.Script], paramValues, obj);
}
}
示例14: ToParameters
public Parameters ToParameters() {
var parameters = new Parameters(new DefaultFactory(new TestLogger()));
foreach (var p in _params) {
parameters.Add(p.Key, p.Value);
}
return parameters;
}
示例15: Calculate
public Parameters Calculate(Parameters inputparams)
{
double fi = (double)inputparams["ko_razr"].Value;
double VcMax = (double)inputparams["sko_str_max"].Value;
double psi = (double)inputparams["ko_zap"].Value;
double Qy = (double)inputparams["teor_pr_uct1"].Value;
double F = (double)inputparams["s_sech_konv"].Value;
double H = (double)inputparams["mo_ugpl_1"].Value;
double A = (double)inputparams["so_ugre"].Value;
double A2 = (double)inputparams["A2_pol"].Value;
double A1 = (double)inputparams["A1_pol"].Value;
double A0 = (double)inputparams["A0_pol"].Value;
double VkMax = (double)inputparams["sko_konv_max"].Value;
double y = (double)inputparams["pl_ug"].Value;
double fi1 = 1.6;
double Vc = VcMax / 60;
double Vk = VkMax / 60;
double yn = y / fi;
double Qkr = 60 * F * psi * Vk * yn;
double Kr = Qy / Qkr;
double Ko = (Qy * VkMax) / (Qkmax * psi * Vc);
double C = 1 / (4 * Ko - 1);
if (C < 1)
{
C = 1;
}
double h1 = A2 * C * C + A1 * C + A0;
double Hstrug = (h1 * 10 * F * fi1) / (H * fi);
double Vk = Vc / C;
Parameters result = new Parameters();
result.Add("max_depth_reg", Hstrug);
result.Add("c_sg_konv", C);
result.Add("proiz_konv", Qkr);
result.Add("v_konv", Vk);
result.Add("ko_skor", Ko);
return result;
}