public DataSet Select()
        {
            Command = CommandBuilder(@"select L.id, L.name, L.contact, L.contactPerson, L.email, L.password, h.name  as head,
            L.description, L.address, ct.name as city, cn.name as country, l2.name as employee, L.createDate
            from Ledger as L
            left join Head as h on L.headId = h.id
            left join ledger as l2 on l.employeeId = l2.id
            left join City as ct on L.cityid = ct.id 
            left join country as cn on ct.countryId = cn.id where l.id>0");

            if (!string.IsNullOrEmpty(Search))
            {
                Command.CommandText += " and (l.name like @search or l.contact like @search or l.contactPerson like @search or l.email like @search or l.description like @search or l.address like @search)";
                Command.Parameters.AddWithValue("@search", "%" + Search + "%");
            }
            if (HeadId > 0)
            {
                Command.CommandText += " and (h.id like @head)";
                Command.Parameters.AddWithValue("@head", "%" + HeadId + "%");
            }

            if (DateSearch)
            {
                Command.CommandText += " and l.createDate between @date1 and @Date2";
                Command.Parameters.AddWithValue("@date1", DateFrom.ToShortDateString());
                Command.Parameters.AddWithValue("@date2", DateTo.ToShortDateString());
            }

            return(ExecuteDS(Command));
        }
예제 #2
0
        public DataSet Select()
        {
            Command = CommandBuilder(@"select pi.id, pi.title, pi.datetime, pi.image,
                             p.name as product from ProductImage as pi
                             left join Product as p on pi.productId=p.id where pi.id>0");

            if (!string.IsNullOrEmpty(Title))
            {
                Command.CommandText += " and pi.title like @title";
                Command.Parameters.AddWithValue("@title", "%" + Title + "%");
            }

            if (ProductId > 0)
            {
                Command.CommandText += " and p.id like @product";
                Command.Parameters.AddWithValue("@product", ProductId);
            }

            if (DateSearch)
            {
                Command.CommandText += " and pi.datetime between @date1 and @Date2";
                Command.Parameters.AddWithValue("@date1", DateFrom.ToShortDateString());
                Command.Parameters.AddWithValue("@date2", DateTo.ToShortDateString());
            }

            return(ExecuteDS(Command));
        }
예제 #3
0
 public override string ToString() => $"{Car.Display} // {Customer.Display} // {DateFrom.ToShortDateString()} - {DateTo.ToShortDateString()} // Cena: {Price.ToString()}";
예제 #4
0
 public override string ToString()
 {
     return(SeriesNumber + "; " + DateFrom.ToShortDateString() + "-" + DateTo.ToShortDateString());
 }
예제 #5
0
 public override string ToString()
 {
     return(ReservationId + ", " + User + ", " + Car.Model + ", " + Controller.HelpMethods.GetEnumDescription(Status) + ", " + DateFrom.ToShortDateString() + " -- " + DateTo.ToShortDateString());
 }
예제 #6
0
파일: Post.cs 프로젝트: stipanovs/Cargo
 public override string ToString()
 {
     return($"{LocationFrom} - {LocationTo}, {DateFrom.ToShortDateString()}-{DateTo.ToShortDateString()}, {Price}");
 }
예제 #7
0
        private string GetFilterSummary(string rangeString = null)
        {
            var range = rangeString == null ? $"{DateFrom.ToShortDateString()} - {DateTo.ToShortDateString()}" : rangeString;

            return($"{HunterName}, {range}");
        }
예제 #8
0
 public override string ToString()
 {
     return($"{Car.ToString()} | {DateFrom.ToShortDateString()} - {DateTo.ToShortDateString()}");
 }