/// <summary>
        /// 初始化餐桌定位数据,主要在主页面显示
        /// status=0表示添加空闲的桌台,status=1表示添加正在使用的桌台,status=2添加待清的桌台
        /// </summary>
        ///  <param name="status">status=0表示初始化加载餐桌定位及桌台数据,status=1表示点击类型加载对应桌台数据</param>
        private void InitTableLocationItemData(int status)
        {
            Config config = _ConfigurationService.Find(TableLocationMapping.TableLocationName[TableLocation.NAME]);

            if (config != null)
            {
                //餐桌定位的拼接类型是编码或者id直接使用下划线分割"_"
                if (config.Disabled == 1)   //餐桌类型
                {
                    if (status == 0)
                    {
                        TypeItems.Add(new BaseTableModel("所有餐桌"));
                    }
                    //
                    string[]         values = config.Value.Split(new char[] { '_' });
                    List <TableType> types  = _TableStatusService.GetTypesByIds(values);
                    LoaderTableType(types, status);
                }
                else if (config.Disabled == 2)   //区域
                {
                    if (status == 0)
                    {
                        TypeItems.Add(new BaseTableModel("所有区域"));
                    }
                    string[]        values    = config.Value.Split(new char[] { '_' });
                    List <Location> locations = _TableStatusService.GetLocationByAllId(values);
                    LoaderLocation(locations, status);
                }
            }
        }
        /// <summary>
        /// 初始化餐桌数据
        /// </summary>
        private void InitTableData()
        {
            TypeItems.Clear();

            InitTableLocationItemData(0);
            //List<TableType> types = _TableService.GetAllTypes();
            //List<Location> locations = _TableService.GetAllLocation();
        }
Esempio n. 3
0
        public void SetTypeItems()
        {
            TypeItems.Add(new SelectListItem
            {
                Value = "true",
                Text  = "true",
            });

            TypeItems.Add(new SelectListItem
            {
                Value = "false",
                Text  = "false"
            });
        }
 public override void NavOnLoadr(params object[] parsObjects)
 {
     if (_isViewVisual)
     {
         return;
     }
     _isViewVisual = true;
     UserItems.Clear();
     TypeItems.Clear();
     Items.Clear();
     IsAdvanceQueryChecked = false;
     BeginDate             = DateTime.Now.AddDays(-1);
     EndDate = DateTime.Now;
     RequestAllUserInfomation();
     RequestAllOperatorTypeHttp();
     Remind = "请设置好查询日期[最多一个月]以及高级查询条件进行查询...";
 }
 /// <summary>
 /// 加载区域
 /// </summary>
 /// <param name="locations"></param>
 private void LoaderLocation(List <Location> locations, int status)
 {
     TableItems.Clear();
     if (locations != null && locations.Count > 0)
     {
         foreach (var location in locations)
         {
             if (status == 0)
             {
                 BaseTableModel ttms = new BaseTableModel(location.LocationId, location.Code, location.Name);
                 TypeItems.Add(ttms);
             }
             ICollection <Table> tables = location.Table;
             LoaderTableItem(tables);
         }
     }
 }
 /// <summary>
 /// 加载餐桌类型
 /// </summary>
 /// <param name="types"></param>
 /// /// <param name="status">status=0表示初始化加载,status=1表示点击类型加载对应桌台</param>
 private void LoaderTableType(List <TableType> types, int status)
 {
     TableItems.Clear();
     if (types != null && types.Count > 0)
     {
         foreach (var type in types)
         {
             if (status == 0)
             {
                 BaseTableModel ttms = new BaseTableModel(type.TableTypeId, type.Code, type.Name);
                 TypeItems.Add(ttms);
             }
             ICollection <Table> tables = type.Table;
             LoaderTableItem(tables);
         }
     }
 }
Esempio n. 7
0
 TypeItems GetTypeItems(XmlSchemaType type) {
     TypeItems items = new TypeItems();
     if (type is XmlSchemaComplexType) {
         XmlSchemaParticle particle = null;
         XmlSchemaComplexType ct = (XmlSchemaComplexType)type;
         if (ct.ContentModel != null) {
             XmlSchemaContent content = ct.ContentModel.Content;
             if (content is XmlSchemaComplexContentExtension) {
                 XmlSchemaComplexContentExtension extension = (XmlSchemaComplexContentExtension)content;
                 items.Attributes = extension.Attributes;
                 items.AnyAttribute = extension.AnyAttribute;
                 particle = extension.Particle;
             }
             else if (content is XmlSchemaSimpleContentExtension) {
                 XmlSchemaSimpleContentExtension extension = (XmlSchemaSimpleContentExtension)content;
                 items.Attributes = extension.Attributes;
                 items.AnyAttribute = extension.AnyAttribute;
                 items.baseSimpleType = extension.BaseTypeName;
             }
         }
         else {
             items.Attributes = ct.Attributes;
             items.AnyAttribute = ct.AnyAttribute;
             particle = ct.Particle;
         }
         if (particle is XmlSchemaGroupRef) {
             XmlSchemaGroupRef refGroup = (XmlSchemaGroupRef)particle;
             items.Particle = FindGroup(refGroup.RefName).Particle;
         }
         else if (particle is XmlSchemaGroupBase) {
             items.Particle = (XmlSchemaGroupBase)particle;
         }
     }
     return items;
 }
 private TypeItems GetTypeItems(XmlSchemaType type)
 {
     TypeItems items = new TypeItems();
     if (type is XmlSchemaComplexType)
     {
         XmlSchemaParticle particle = null;
         XmlSchemaComplexType type2 = (XmlSchemaComplexType) type;
         if (type2.ContentModel != null)
         {
             XmlSchemaContent content = type2.ContentModel.Content;
             if (content is XmlSchemaComplexContentExtension)
             {
                 XmlSchemaComplexContentExtension extension = (XmlSchemaComplexContentExtension) content;
                 items.Attributes = extension.Attributes;
                 items.AnyAttribute = extension.AnyAttribute;
                 particle = extension.Particle;
             }
             else if (content is XmlSchemaSimpleContentExtension)
             {
                 XmlSchemaSimpleContentExtension extension2 = (XmlSchemaSimpleContentExtension) content;
                 items.Attributes = extension2.Attributes;
                 items.AnyAttribute = extension2.AnyAttribute;
                 items.baseSimpleType = extension2.BaseTypeName;
             }
         }
         else
         {
             items.Attributes = type2.Attributes;
             items.AnyAttribute = type2.AnyAttribute;
             particle = type2.Particle;
         }
         if (particle is XmlSchemaGroupRef)
         {
             XmlSchemaGroupRef ref2 = (XmlSchemaGroupRef) particle;
             items.Particle = this.FindGroup(ref2.RefName).Particle;
             items.IsUnbounded = particle.IsMultipleOccurrence;
             return items;
         }
         if (particle is XmlSchemaGroupBase)
         {
             items.Particle = (XmlSchemaGroupBase) particle;
             items.IsUnbounded = particle.IsMultipleOccurrence;
         }
     }
     return items;
 }