Ejemplo n.º 1
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));
        }
        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));
        }
Ejemplo n.º 3
0
 protected Jakt CreateHuntDto()
 {
     return(new Jakt
     {
         ID = string.IsNullOrEmpty(ID) ? Guid.NewGuid().ToString() : ID,
         Sted = string.IsNullOrWhiteSpace(Location) ? $"Jakt {DateFrom.ToShortDateString()}" : Location,
         DatoFra = DateFrom,
         DatoTil = DateTo,
         JegerIds = Hunters.Where(x => x.Selected).Select(h => h.ID).ToList <string>(),
         DogIds = Dogs.Where(x => x.Selected).Select(h => h.ID).ToList <string>(),
         Latitude = Position.Latitude.ToString(),
         Longitude = Position.Longitude.ToString(),
         Notes = Notes
     });
 }
Ejemplo n.º 4
0
 public override string ToString() => $"{Car.Display} // {Customer.Display} // {DateFrom.ToShortDateString()} - {DateTo.ToShortDateString()} // Cena: {Price.ToString()}";
Ejemplo n.º 5
0
 public override string ToString()
 {
     return(SeriesNumber + "; " + DateFrom.ToShortDateString() + "-" + DateTo.ToShortDateString());
 }
Ejemplo n.º 6
0
 public override string ToString()
 {
     return(ReservationId + ", " + User + ", " + Car.Model + ", " + Controller.HelpMethods.GetEnumDescription(Status) + ", " + DateFrom.ToShortDateString() + " -- " + DateTo.ToShortDateString());
 }
Ejemplo n.º 7
0
 public override string ToString()
 {
     return($"{LocationFrom} - {LocationTo}, {DateFrom.ToShortDateString()}-{DateTo.ToShortDateString()}, {Price}");
 }
Ejemplo n.º 8
0
        private string GetFilterSummary(string rangeString = null)
        {
            var range = rangeString == null ? $"{DateFrom.ToShortDateString()} - {DateTo.ToShortDateString()}" : rangeString;

            return($"{HunterName}, {range}");
        }
Ejemplo n.º 9
0
 public override string ToString()
 {
     return($"{Car.ToString()} | {DateFrom.ToShortDateString()} - {DateTo.ToShortDateString()}");
 }