本文整理汇总了C#中Ajancy.Kimia_Ajancy.GetCommand方法的典型用法代码示例。如果您正苦于以下问题:C# Kimia_Ajancy.GetCommand方法的具体用法?C# Kimia_Ajancy.GetCommand怎么用?C# Kimia_Ajancy.GetCommand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ajancy.Kimia_Ajancy
的用法示例。
在下文中一共展示了Kimia_Ajancy.GetCommand方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnExcel_Click
//.........这里部分代码省略.........
{
byte fuelType = Public.ToByte(this.drpFuelType.SelectedValue);
drivers = from q in drivers
where q.FuelType == fuelType
select q;
}
if (this.drpFuelCardType.SelectedIndex > 0)
{
byte fuelCardType = Public.ToByte(this.drpFuelCardType.SelectedValue);
drivers = from q in drivers
where q.CardType == fuelCardType
select q;
}
if (!string.IsNullOrEmpty(this.txtFuelCardPAN.Text))
{
drivers = from q in drivers
where q.PAN.Equals(this.txtFuelCardPAN.Text.Trim())
select q;
}
if (!string.IsNullOrEmpty(this.txtCarVIN.Text))
{
drivers = from q in drivers
where q.VIN.Equals(this.txtCarVIN.Text.Trim())
select q;
}
if (this.drpGender.SelectedIndex > 0)
{
byte gender = Public.ToByte(this.drpGender.SelectedValue);
drivers = from q in drivers
where q.Gender == gender
select q;
}
if (!string.IsNullOrEmpty(this.txtFirstName.Text))
{
drivers = from q in drivers
where q.FirstName.Contains(this.txtFirstName.Text.Trim())
select q;
}
if (!string.IsNullOrEmpty(this.txtLastName.Text))
{
drivers = from q in drivers
where q.LastName.Contains(this.txtLastName.Text.Trim())
select q;
}
if (!string.IsNullOrEmpty(this.txtNationalCode.Text))
{
drivers = from q in drivers
where q.NationalCode == this.txtNationalCode.Text.Trim()
select q;
}
if (!string.IsNullOrEmpty(this.txtBirthCertificateNo.Text))
{
drivers = from q in drivers
where q.BirthCertificateNo == this.txtBirthCertificateNo.Text.Trim()
select q;
}
if (!string.IsNullOrEmpty(this.txtCarPlateNumber_1.Text) && !string.IsNullOrEmpty(this.txtCarPlateNumber_2.Text) && !string.IsNullOrEmpty(this.txtCarPlateNumber_3.Text))
{
drivers = from q in drivers
where q.TwoDigits == this.txtCarPlateNumber_1.Text.Trim() &&
q.ThreeDigits == this.txtCarPlateNumber_2.Text.Trim() &&
q.RegionIdentifier == this.txtCarPlateNumber_3.Text.Trim() &&
q.Alphabet == this.drpCarPlateNumber.SelectedValue
select q;
}
if (this.txtDateFrom.HasDate && !this.txtDateTo.HasDate)
{
drivers = from q in drivers
where q.SubmitDate == this.txtDateFrom.GeorgianDate.Value
select q;
}
else if (this.txtDateFrom.HasDate && this.txtDateTo.HasDate)
{
drivers = from q in drivers
where q.SubmitDate >= this.txtDateFrom.GeorgianDate.Value && q.SubmitDate <= this.txtDateTo.GeorgianDate.Value
select q;
}
DataTable dtObj = new DataTable();
db.Connection.Open();
dtObj.Load(db.GetCommand(drivers).ExecuteReader());
DisposeContext();
dtObj.TableName = "dt";
Stimulsoft.Report.StiReport report = new Stimulsoft.Report.StiReport();
report.Load(HttpContext.Current.Server.MapPath("~/App_Data/Report/mrt/drivers.mrt"));
report.RegData(dtObj);
report.Render();
Public.ExportInfo(3, report);
report.Dispose();
}
示例2: btnExcel_Click
//.........这里部分代码省略.........
}
if (!string.IsNullOrEmpty(this.txtBirthCertificateNo.Text))
{
query = from q in query
where q.BirthCertificateNo == this.txtBirthCertificateNo.Text.Trim()
select q;
}
if (!string.IsNullOrEmpty(this.txtCarPlateNumber_1.Text) && !string.IsNullOrEmpty(this.txtCarPlateNumber_2.Text) && !string.IsNullOrEmpty(this.txtCarPlateNumber_3.Text))
{
query = from q in query
where q.TwoDigits == this.txtCarPlateNumber_1.Text.Trim() &&
q.ThreeDigits == this.txtCarPlateNumber_2.Text.Trim() &&
q.RegionIdentifier == this.txtCarPlateNumber_3.Text.Trim() &&
q.Alphabet == this.drpCarPlateNumber.SelectedValue
select q;
}
if (this.txtDateFrom.HasDate && !this.txtDateTo.HasDate)
{
query = from q in query
where q.SubmitDate == this.txtDateFrom.GeorgianDate.Value
select q;
}
else if (this.txtDateFrom.HasDate && this.txtDateTo.HasDate)
{
query = from q in query
where q.SubmitDate >= this.txtDateFrom.GeorgianDate.Value && q.SubmitDate <= this.txtDateTo.GeorgianDate.Value
select q;
}
db.Connection.Open();
dtObj.Load(db.GetCommand(query).ExecuteReader());
db.Connection.Close();
db.Dispose();
break;
case 1: // Actives
var query1 = (from p in db.Persons
join dc in db.DriverCertifications on p.PersonID equals dc.PersonID
join dcc in db.DriverCertificationCars on dc.DriverCertificationID equals dcc.DriverCertificationID
join jd in db.AjancyDrivers on dcc.DriverCertificationCarID equals jd.DriverCertificationCarID
join cpn in db.CarPlateNumbers on dcc.CarPlateNumberID equals cpn.CarPlateNumberID
from pln in db.PlateNumbers.Where(number => number.PlateNumberID == cpn.PlateNumberID).DefaultIfEmpty()
from zpn in db.ZonePlateNumbers.Where(number => number.ZonePlateNumberID == cpn.ZonePlateNumberID).DefaultIfEmpty()
join c in db.Cars on cpn.CarID equals c.CarID
join crt in db.CarTypes on c.CarTypeID equals crt.CarTypeID
join fc in db.FuelCards on c.CarID equals fc.CarID
join j in db.Ajancies on jd.AjancyID equals j.AjancyID
join jp in db.AjancyPartners on j.AjancyID equals jp.AjancyID
join ct in db.Cities on j.CityID equals ct.CityID
join pv in db.Provinces on ct.ProvinceID equals pv.ProvinceID
join owp in db.Persons on cpn.OwnerPersonID equals owp.PersonID
where j.AjancyType == Public.ToByte(this.drpAjancyType.SelectedValue) &&
jd.LockOutDate == null &&
dcc.LockOutDate == null
orderby pv.Name, ct.Name
select new
{
OWNationalCode = owp.NationalCode,
OWFirstName = owp.FirstName,
OWLastName = owp.LastName,
p.PersonID,
p.FirstName,
p.LastName,