Example #1
0
    public static List <Item> GetUserUnEquipmentItems(Common.OrderByType orderByType = Common.OrderByType.NONE)
    {
        List <Item> itemList = new List <Item>();

        foreach (var item in userItems.FindAll(item => item.count > 0 && item.itemtype == 0 && item.equipCharacterId == 0))
        {
            itemList.Add(item);
        }
        if (orderByType != Common.OrderByType.NONE)
        {
            itemList = SetOrderByItemList(itemList, orderByType);
        }

        return(itemList);
    }
Example #2
0
        /// <summary>
        /// 获取独生子女统计列表
        /// </summary>
        /// <param name="totalCount">记录总数</param>
        /// <param name="pageSize">页大小(一次取出的记录数)</param>
        /// <param name="pageIndex">页码(1开始)</param>
        /// <param name="obType">排续类型</param>
        /// <param name="subfilter">筛选条件对象</param>
        /// <returns>结果集</returns>
        public DataTable GetCWOneChildList(out int totalCount, int pageSize, int pageIndex,
                                           Common.OrderByType obType, BusinessFilter subfilter)
        {
            Wicresoft.Session.Session session = new Wicresoft.Session.Session();
            BusinessObjectCollection  boc     = new BusinessObjectCollection("CWOneChild");

            boc.SessionInstance = session;
            BusinessFilter filter = new BusinessFilter("CWOneChild");

            filter.AddFilterItem("IsValid", "1", Operation.Equal, FilterType.NumberType, AndOr.AND);
            if (subfilter != null)
            {
                filter.AddFilter(subfilter, AndOr.AND);
            }
            boc.AddFilter(filter);
            DataSet ds = boc.GetPagedRecords(pageIndex, pageSize, "PKID", (obType == Common.OrderByType.DESC)?true:false);

            totalCount = Convert.ToInt32(ds.Tables[0].Rows[0][0]);
            return(ds.Tables[1]);
        }
    public void RefreshUI(Common.OrderByType orderByType = Common.OrderByType.VALUE)
    {
        items = ItemSystem.GetUserItems(orderByType);
        inventoryCountText.text = string.Format("{0} / {1}", items.Count, User.inventoryCount);

        if (items != null)
        {
            for (int i = 0; i < itemSlots.Length; i++)
            {
                itemSlots[i].Item = null;
                itemSlots[i].GetComponent <Button>().enabled = false;

                itemSlots[i].transform.GetChild(0).GetChild(0).GetChild(1).GetComponent <Image>().color = ItemColor.C;
                isEquipPanel = itemSlots[i].transform.GetChild(0).GetChild(0).GetChild(2).gameObject;
                isEquipPanel.SetActive(false);
                itemSlots[i].transform.GetChild(3).gameObject.SetActive(false);
                itemSlots[i].transform.GetChild(4).gameObject.SetActive(false);
                if (i < items.Count && i < itemSlots.Length)
                {
                    itemSlots[i].Item = items[i];
                    itemSlots[i].transform.GetChild(0).GetChild(0).GetChild(1).GetComponent <Image>().color = ItemColor.GetItemColor(items[i].itemClass);
                    itemSlots[i].transform.GetComponentInChildren <Text>().color = ItemColor.GetItemColor(items[i].itemClass);
                    itemSlots[i].GetComponent <Button>().enabled = true;
                    if (items[i].equipCharacterId > 0)
                    {
                        isEquipPanel.SetActive(true);
                    }
                    int index = i;
                    if (index < items.Count && index < itemSlots.Length)
                    {
                        itemSlots[i].GetComponent <Button>().onClick.RemoveAllListeners();
                        itemSlots[i].GetComponent <Button>().onClick.AddListener(delegate
                        {
                            OnItemSlotClick(index);
                        });
                    }
                }
            }
        }
        Debugging.Log(items.Count + " 개의 아이템 로드됨");
    }
Example #4
0
    private static List <Item> SetOrderByItemList(List <Item> itemList, Common.OrderByType orderByType)
    {
        if (itemList != null)
        {
            switch (orderByType)
            {
            case Common.OrderByType.NAME:
                itemList.Sort((i1, i2) => GetItemName(i1.id).CompareTo(GetItemName(i2.id)));
                break;

            case Common.OrderByType.VALUE:
                itemList.Sort((i1, i2) => i2.itemClass.CompareTo(i1.itemClass));
                break;
            }
            return(itemList);
        }
        else
        {
            Debugging.Log("정렬할 아이템 리스트가 null 입니다.");
            return(null);
        }
    }
Example #5
0
        /// <summary>
        /// 获取行政区列表
        /// </summary>
        /// <param name="totalCount">记录总数</param>
        /// <param name="pageSize">页大小(一次取出的记录数)</param>
        /// <param name="pageIndex">页码(1开始)</param>
        /// <param name="obType">排续类型</param>
        /// <param name="subfilter">筛选条件对象</param>
        /// <returns>结果集</returns>
        public DataTable GetDistrictList(out int totalCount, int pageSize, int pageIndex,
                                         Common.OrderByType obType, BusinessFilter subfilter)
        {
            BusinessRule.BaseData.Region rule = new Region();

            Wicresoft.Session.Session session = new Wicresoft.Session.Session();
            BusinessObjectCollection  boc     = new BusinessObjectCollection("District");

            boc.SessionInstance = session;
            BusinessFilter filter = new BusinessFilter("District");

            filter.AddFilterItem("IsValid", "1", Operation.Equal, FilterType.NumberType, AndOr.AND);
            filter.AddCustomerFilter("District.FK_Dictionary IN (" + rule.GetAuthorizedCitiesPKID(GlobalFacade.SystemContext.GetContext().UserID) + ")", AndOr.AND);

            if (subfilter != null)
            {
                filter.AddFilter(subfilter, AndOr.AND);
            }
            boc.AddFilter(filter);
            DataSet ds = boc.GetPagedRecords(pageIndex, pageSize, "PKID", (obType == Common.OrderByType.ASC)?true:false);

            totalCount = Convert.ToInt32(ds.Tables[0].Rows[0][0]);
            return(ds.Tables[1]);
        }
Example #6
0
    public static List <Item> GetUserItems(Common.OrderByType orderByType = Common.OrderByType.NONE)
    {
        List <Item> itemList = new List <Item>();

        foreach (var item in userItems.FindAll(item => item.count > 0 && item.itemtype == 0))
        {
            if (item.itemtype == 0)
            {
                for (int i = 0; i < item.count; i++)
                {
                    itemList.Add(item);
                }
            }
            else
            {
                itemList.Add(item);
            }
        }
        if (orderByType != Common.OrderByType.NONE)
        {
            itemList = SetOrderByItemList(itemList, orderByType);
        }
        return(itemList);
    }
Example #7
0
        //Qick新加方法
        public DataTable GetCityListAD(out int totalCount, int pageSize, int pageIndex, Common.OrderByType obType, BusinessFilter filter)
        {
            //获取没有中心的城市
            string sql = "select pkid from dictionaryAd where pkid in (select pkid from dictionaryAd where [name] not in (select [name] from dictionary where isvalid =1 and ([level]=1 or [level]=0)) and isvalid = 1 and ([level]=1 or [level]=0)) and ([level]=1 or [level]=0)";

            Wicresoft.Session.Session session = new Wicresoft.Session.Session();
            DataTable dt      = session.SqlHelper.ExcuteDataTable(null, sql, CommandType.Text);
            string    NOPKIDs = "";

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                NOPKIDs += "," + dt.Rows[i][0];
            }
            //获取登陆用户拥有权限的城市
            /* Andy Modify 2009-12-17 用DictionaryAD表的PKID和FK_Dictionary过滤不同值 */
            BusinessRule.BaseData.Region regionRule = new BusinessRule.BaseData.Region();
            string cityPKIDs = regionRule.GetAuthorizedCitiesPKID(GlobalFacade.SystemContext.GetContext().UserID).ToString();

            if (cityPKIDs.IndexOf("2,") != -1)
            {
                cityPKIDs += ",1";
            }
            if (NOPKIDs != string.Empty)
            {
                NOPKIDs = NOPKIDs.Substring(1, NOPKIDs.Length - 1);
            }
            //			string cityPKIDs = ","+regionRule.GetAuthorizedCitiesPKID(GlobalFacade.SystemContext.GetContext().UserID).ToString()+",";
            //			if(cityPKIDs.IndexOf(",2,")!=-1)
            //			{
            //				cityPKIDs=cityPKIDs.Substring(1,cityPKIDs.Length-2);
            //				cityPKIDs+=",1";
            //				if(NOPKIDs!=null&&NOPKIDs!=""&&NOPKIDs!=string.Empty)
            //				{
            //					cityPKIDs+=NOPKIDs;
            //				}
            //			}
            //			else
            //			{
            //				cityPKIDs=cityPKIDs.Substring(1,cityPKIDs.Length-2);
            //			}

            Common commonRule = new Common();

            BusinessFilter flt = new BusinessFilter("DictionaryAD");

            flt.AddCustomerFilter("(DictionaryAD.PKID IN(" + NOPKIDs + ") OR DictionaryAD.FK_Dictionary IN (" + cityPKIDs + "))", AndOr.AND);
            //			flt.AddCustomerFilter("(DictionaryAD.PKID IN(" + cityPKIDs + ") OR DictionaryAD.PKID IN (" + cityPKIDs + "))", AndOr.AND);
            flt.AddFilterItem("IsValid", "1", Operation.Equal, FilterType.NumberType, AndOr.AND);
            flt.AddFilter(filter, AndOr.AND);

            // Add Data Permission
            //			flt.AddFilter(GetAuthorizedCityFilter(GlobalFacade.SystemContext.GetContext().UserID), AndOr.AND);

            BusinessObjectCollection boc = new BusinessObjectCollection("DictionaryAD");

            boc.SessionInstance = new Session();
            boc.AddFilter(flt);

            DataSet ds = boc.GetPagedRecords(pageIndex, pageSize, "PKID", (obType == Common.OrderByType.ASC) ? true : false);

            totalCount = Convert.ToInt32(ds.Tables[0].Rows[0][0]);
            return(ds.Tables[1]);
        }
Example #8
0
        public DataTable GetRegionList(out int totalCount, int pageSize, int pageIndex, Common.OrderByType obType, BusinessFilter subfilter, string Parent)
        {
            Wicresoft.Session.Session session = new Wicresoft.Session.Session();
            BusinessObjectCollection  boc     = new BusinessObjectCollection("Dictionary");
            BusinessFilter            filter  = new BusinessFilter("Dictionary");

            filter.AddFilterItem("IsValid", "1", Operation.Equal, FilterType.NumberType, AndOr.AND);
            filter.AddFilterItem("Type", ((int)SystemManage.DictionaryType.Region).ToString(), Operation.Equal, FilterType.NumberType, AndOr.AND);

            if (Parent == SystemManage.Level.Top)
            {
                BusinessMapping.Dictionary TopParent = new BusinessMapping.Dictionary();
                TopParent.SessionInstance = session;
                BusinessFilter searchparent = new BusinessFilter("Dictionary");
                searchparent.AddFilterItem("IsValid", "1", Operation.Equal, FilterType.NumberType, AndOr.AND);
                searchparent.AddFilterItem("Type", ((int)SystemManage.DictionaryType.Region).ToString(), Operation.Equal, FilterType.NumberType, AndOr.AND);
                searchparent.AddFilterItem("Parent", SystemManage.Level.Top, Operation.Equal, FilterType.NumberType, AndOr.AND);
                TopParent.AddFilter(searchparent);
                TopParent.Load();
                if (TopParent.HaveRecord)
                {
                    Parent = TopParent.PKID.Value.ToString();
                }
            }

            if (!(Parent == null || Parent.Equals(string.Empty)))
            {
                filter.AddFilterItem("Parent", Parent.ToString(), Operation.Equal, FilterType.NumberType, AndOr.AND);
            }

            if (subfilter != null)
            {
                filter.AddFilter(subfilter, AndOr.AND);
            }
            boc.SessionInstance = session;
            boc.AddFilter(filter);
            DataSet ds = boc.GetPagedRecords(pageIndex, pageSize, "PKID", (obType == Common.OrderByType.ASC) ? true : false);

            totalCount = Convert.ToInt32(ds.Tables[0].Rows[0][0]);
            return(ds.Tables[1]);
        }
Example #9
0
        /// <summary>
        /// 选出所有城市
        /// </summary>
        /// <param name="totalCount"></param>
        /// <param name="pageSize"></param>
        /// <param name="pageIndex"></param>
        /// <param name="obType"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public DataTable GetCityList(out int totalCount, int pageSize, int pageIndex, Common.OrderByType obType, BusinessFilter filter)
        {
            Common commonRule = new Common();

            BusinessFilter flt = new BusinessFilter("Dictionary");

            flt.AddFilterItem("IsValid", "1", Operation.Equal, FilterType.NumberType, AndOr.AND);
            flt.AddFilterItem("Type", ((int)SystemManage.DictionaryType.Region).ToString(), Operation.Equal, FilterType.NumberType, AndOr.AND);
            flt.AddFilterItem("Level", SystemManage.Level.City, Operation.Equal, FilterType.NumberType, AndOr.AND);

            flt.AddFilter(filter, AndOr.AND);

            // Add Data Permission
            //			flt.AddFilter(GetAuthorizedCityFilter(GlobalFacade.SystemContext.GetContext().UserID), AndOr.AND);

            BusinessObjectCollection boc = new BusinessObjectCollection("Dictionary");

            boc.SessionInstance = new Session();
            boc.AddFilter(flt);

            DataSet ds = boc.GetPagedRecords(pageIndex, pageSize, "PKID", (obType == Common.OrderByType.ASC) ? true : false);

            totalCount = Convert.ToInt32(ds.Tables[0].Rows[0][0]);
            return(ds.Tables[1]);
        }
Example #10
0
        //Qick 获取城市列表 2009-02-06
        public DataTable GetCityListNew(out int totalCount, int pageSize, int pageIndex, Common.OrderByType obType, BusinessFilter filter)
        {
            Common commonRule = new Common();

            BusinessFilter flt = new BusinessFilter("DictionaryAD");

            flt.AddFilterItem("IsValid", "1", Operation.Equal, FilterType.NumberType, AndOr.AND);

            flt.AddCustomerFilter("(DictionaryAD.Level =1 OR DictionaryAD.Level =0)", AndOr.AND);
            flt.AddFilter(filter, AndOr.AND);

            BusinessObjectCollection boc = new BusinessObjectCollection("DictionaryAD");

            boc.SessionInstance = new Session();
            boc.AddFilter(flt);

            DataSet ds = boc.GetPagedRecords(pageIndex, pageSize, "PKID", (obType == Common.OrderByType.ASC) ? true : false);

            totalCount = Convert.ToInt32(ds.Tables[0].Rows[0][0]);
            return(ds.Tables[1]);
        }
Example #11
0
        public DataTable GetDictionaryList(out int totalCount, int pageSize, int pageIndex,
                                           Common.OrderByType obType, BusinessFilter subfilter)
        {
//			//找出没有中心的城市PKID
//			string sql="select pkid from dictionaryAd where pkid in (select pkid from dictionaryAd where [name] not in (select [name] from dictionary where isvalid =1 and ([level]=1 or [level]=0)) and isvalid = 1 and ([level]=1 or [level]=0)) and ([level]=1 or [level]=0)";
//			Wicresoft.Session.Session session = new Wicresoft.Session.Session();
//			DataTable dt = session.SqlHelper.ExcuteDataTable(null,sql,CommandType.Text);
//			string NOPKIDs="";
//			for(int i=0;i<dt.Rows.Count;i++)
//			{
//				NOPKIDs+=","+dt.Rows[i][0];
//			}
//
//			//找出当前用户所拥有权限的城市PKID
//			BusinessRule.BaseData.Region regionRule = new BusinessRule.BaseData.Region();
//
//			string cityPKIDs = ","+regionRule.GetAuthorizedCitiesPKID(GlobalFacade.SystemContext.GetContext().UserID).ToString()+",";
//
//			BusinessObjectCollection boc = new BusinessObjectCollection("ADClient");
//			boc.SessionInstance = session;
//			BusinessFilter filter = new BusinessFilter("ADClient");
//
//			//找出是总部发布的PKID
//			string sqlADInfomation="select PKID from ADInfomation where FK_Center =1 and isvalid=1";
//			Wicresoft.Session.Session sessionADInfomation = new Wicresoft.Session.Session();
//			DataTable dtADInfomation=sessionADInfomation.SqlHelper.ExcuteDataTable(null,sqlADInfomation,CommandType.Text);
//			string ADInfomationPKID =  string.Empty;
//			if(dtADInfomation.Rows.Count>0)
//			{
//				for(int j=0;j<dtADInfomation.Rows.Count;j++)
//				{
//					ADInfomationPKID+=dtADInfomation.Rows[j][0]+",";
//				}
//				ADInfomationPKID=ADInfomationPKID.Substring(0,ADInfomationPKID.Length-1);
//			}
//			//防止ADInfomationPKID为空
//			if(ADInfomationPKID ==  string.Empty)
//			{
//				ADInfomationPKID = "0";
//			}
//			//有总部权限的
//			if(cityPKIDs.IndexOf(",2,")!=-1)
//			{
//				cityPKIDs=cityPKIDs.Substring(1,cityPKIDs.Length-2);
//				cityPKIDs+=",1";
//				if(NOPKIDs!=null&&NOPKIDs!=""&&NOPKIDs!=string.Empty)
//				{
//					cityPKIDs+=NOPKIDs;
//				}
//				//如果该用户是总部的 就能看到
//							/* Andy Modify 2009-03-08 */
//				filter.AddCustomerFilter("(ADClient.FK_City IN(" + cityPKIDs + ") OR ADClient.FK_ADInfomation IN (" + ADInfomationPKID + ")) AND ADClient.FK_ADInfomation IN (" + regionRule.GetAuthorizedADInfomationPKID(GlobalFacade.SystemContext.GetContext().UserID) + ")", AndOr.AND);
//			}
//			else
//			{
//				cityPKIDs=cityPKIDs.Substring(1,cityPKIDs.Length-2);
//				//如果该用户不是总部的 无法看到
//				/* Andy Modify 2009-03-08 */
//				filter.AddCustomerFilter("(ADClient.FK_City IN(" + cityPKIDs + ") AND ADClient.FK_ADInfomation not IN (" + ADInfomationPKID + ")) AND ADClient.FK_ADInfomation IN (" + regionRule.GetAuthorizedADInfomationPKID(GlobalFacade.SystemContext.GetContext().UserID) + ")", AndOr.AND);
//			}
//						//过滤城市
//			//filter.AddCustomerFilter("(ADClient.FK_City IN(" + cityPKIDs + ") OR ADClient.FK_City IN (" + cityPKIDs + "))", AndOr.AND);
//			filter.AddFilterItem("IsValid","1",Operation.Equal,FilterType.NumberType,AndOr.AND);
//
//			if (subfilter != null)
//				filter.AddFilter(subfilter,AndOr.AND);
//			boc.AddFilter(filter);
//			DataSet ds = boc.GetPagedRecords(pageIndex, pageSize, "PKID", (obType == Common.OrderByType.ASC)?true:false);
//
//			totalCount = Convert.ToInt32(ds.Tables[0].Rows[0][0]);
//			return ds.Tables[1];
            Wicresoft.Session.Session session = new Wicresoft.Session.Session();
            BusinessObjectCollection  boc     = new BusinessObjectCollection("Dictionary");

            boc.SessionInstance = session;
            BusinessFilter filter = new BusinessFilter("Dictionary");

            filter.AddFilterItem("IsValid", "1", Operation.Equal, FilterType.NumberType, AndOr.AND);
            filter.AddFilterItem("Level", "1", Operation.Equal, FilterType.NumberType, AndOr.AND);
            if (subfilter != null)
            {
                filter.AddFilter(subfilter, AndOr.AND);
            }
            boc.AddFilter(filter);
            DataSet ds = boc.GetPagedRecords(pageIndex, pageSize, "PKID", (obType == Common.OrderByType.ASC)?true:false);

            totalCount = Convert.ToInt32(ds.Tables[0].Rows[0][0]);
            return(ds.Tables[1]);
        }