Exemplo n.º 1
0
        public ActionResult List(DeliveryFilter filter)
        {
            var data = DeliveryInfo.Find(UserID, Employee.ID, Employee.BussinessID, "", filter, true);

            if (Request.IsAjaxRequest())
            {
                return(Json(new
                {
                    result = true,
                    html = RenderPartialViewToString(Views.ListPartial, data)
                }, JsonRequestBehavior.AllowGet));
            }
            return(View(Views.List, data));
        }
Exemplo n.º 2
0
 public DeliveryList(string message = "", DeliveryFilter filter = null)
 {
     Data    = new List <DeliveryInfo>();
     Filter  = filter != null ? filter : new DeliveryFilter();
     Message = message;
 }
Exemplo n.º 3
0
        public static DeliveryList Find(int userID, int employeeID, int bussinessID, string message = "", DeliveryFilter filter = null, bool log = false)
        {
            QueryOutput queryResult;
            var         conditions = new List <string>();

            if (filter != null)
            {
                if (!String.IsNullOrEmpty(filter.Address))
                {
                    conditions.Add(String.Format("and Address like N'%{0}%'", filter.Address));
                }
                if (!String.IsNullOrEmpty(filter.Name))
                {
                    conditions.Add(String.Format("and Name like N'%{0}%'", filter.Name));
                }
                if (!String.IsNullOrEmpty(filter.Phone))
                {
                    conditions.Add(String.Format("and Phone like N'%{0}%'", filter.Phone));
                }
            }
            var result = new DeliveryList(message, filter);

            result.Data = Query <DeliveryInfo>(new DbQuery(userID, employeeID, DbAction.Delivery.View,
                                                           String.Format("select * from Delivery where Status = 'active' and BussinessID = {0} {1} order by Name", bussinessID, String.Join(" ", conditions)), log), out queryResult);
            return(result);
        }