Exemple #1
0
        public ActionResult List(WarehouseFilter filter)
        {
            var data = WarehouseInfo.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));
        }
Exemple #2
0
 public WarehouseList(string message = "", WarehouseFilter filter = null)
 {
     Data    = new List <WarehouseInfo>();
     Filter  = filter != null ? filter : new WarehouseFilter();
     Message = message;
 }
Exemple #3
0
        public static WarehouseList Find(int userID, int employeeID, int bussinessID, string message = "", WarehouseFilter 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 WarehouseList(message, filter);

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