Exemplo n.º 1
0
        public static ArrayList QueryListMsInventoryCategory(string mscode, string ipcode)
        {
            ArrayList r = new ArrayList();
            Sys_InventoryCategoryBll     sub = new Sys_InventoryCategoryBll();
            Sys_AssortBll                sab = new Sys_AssortBll();
            List <Sys_InventoryCategory> lsr = new List <Sys_InventoryCategory>();
            SessionUserValidate          iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                r.Add(iv.badstr);
                if (sab.ExistMsBl(mscode, ipcode + "___"))
                {
                    lsr = sub.QueryList(" and icpcode='" + ipcode + "' and iccode in ( select blcode from Sys_RMsBl where mcode='" + mscode.Substring(0, mscode.Length - 3) + "' and blcode like '" + ipcode + "___') order by isort");
                    if (lsr != null)
                    {
                        foreach (Sys_InventoryCategory s in lsr)
                        {
                            ArrayList al = new ArrayList();
                            al.Add(s.iccode);
                            al.Add(s.icname);
                            al.Add(s.icstate);
                            r.Add(al);
                        }
                    }
                }
                else
                {
                    lsr = sub.QueryList(" and icpcode='" + ipcode + "' order by isort");
                    if (lsr != null)
                    {
                        foreach (Sys_InventoryCategory s in lsr)
                        {
                            ArrayList al = new ArrayList();
                            al.Add(s.iccode);
                            al.Add(s.icname);
                            al.Add(s.icstate);
                            r.Add(al);
                        }
                    }
                }
            }
            else
            {
                r.Add(iv.badstr);
            }
            return(r);
        }
Exemplo n.º 2
0
        public static ArrayList QueryMsRefBlCate(string mscode, string blcode)
        {
            ArrayList r = new ArrayList();
            Sys_InventoryDetailBll       sib  = new Sys_InventoryDetailBll();
            Sys_InventoryCategoryBll     sub  = new Sys_InventoryCategoryBll();
            List <Sys_InventoryCategory> plsr = new List <Sys_InventoryCategory>();
            List <Sys_InventoryCategory> lsr  = new List <Sys_InventoryCategory>();
            List <Sys_InventoryCategory> lr   = new List <Sys_InventoryCategory>();
            Sys_AssortBll       sab           = new Sys_AssortBll();
            SessionUserValidate iv            = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                r.Add(iv.badstr);
                lsr  = sub.QueryList(" and iccode='" + blcode + "' order by isort");
                plsr = sub.QueryList(" and icpcode='" + blcode + "'  order by isort");
                if (plsr != null)
                {
                    lr = plsr;
                }
                else
                {
                    lr = lsr;
                }
                if (lr != null)
                {
                    foreach (Sys_InventoryCategory s in lr)
                    {
                        ArrayList al = new ArrayList();
                        al.Add(s.iccode);
                        al.Add(s.icname);
                        al.Add(s.icstate);
                        if (sib.Exists(" and icode like '" + s.iccode + "%'"))
                        {
                            if (sab.ExistMsBl(" and bcode like '" + s.iccode + "%' and mcode='" + mscode.Substring(0, mscode.Length - 3) + "'"))
                            {
                                r.Add(al);
                            }
                        }
                    }
                }
            }
            else
            {
                r.Add(iv.badstr);
            }
            return(r);
        }