Exemplo n.º 1
0
        public ItemList IndexItems(QueryEnergyIterm qery)
        {
            var pAction = new ExecuteProcess();
            try
            {
                Itemcode itcode = new NTS.WEB.BLL.Itemcode();

                List<Model.Itemcode> itemList = new List<Model.Itemcode>();
                if (qery.ItemCode != "00000")
                {
                    var itemParent = itcode.GetItemcodeList(
                      string.Format(" and  ItemCodeNumber='{0}'", qery.ItemCode),
                      " order by ItemcodeID");
                    if (itemParent.Count > 0)
                    {
                        itemList = itcode.GetItemcodeList(
                            string.Format("and  PARENTID= {0} ", itemParent[0].ItemcodeID.ToString()),
                            " order by ItemcodeID");

                    }
                }
                else
                {

                    itemList = itcode.GetItemcodeList(
                           string.Format("and  PARENTID= {0} ", 0),
                           " order by ItemcodeID");

                }
                ItemList result = new ItemList();
                result.ItemLst = new List<ItemSet>();
                foreach (Model.Itemcode ic in itemList)
                {
                    ItemSet its = new ItemSet();
                    its.ItemCode = ic.ItemCodeNumber;
                    its.ItemName = ic.ItemCodeName;
                    result.ItemLst.Add(its);

                }
                pAction.Success = true;
                result.ActionInfo = pAction;

                return result;
            }
            catch (Exception ex)
            {
                pAction.Success = false;
                pAction.ExceptionMsg = ex.Message;
                return new ItemList() { ActionInfo = pAction };
            }
        }
Exemplo n.º 2
0
 public ItemList IndexItems(QueryEnergyIterm query)
 {
     return new NTS.WEB.BLL.Charts().IndexItems(query);
 }