示例#1
0
        public static string GetRefInv(string invcode, string mname)
        {
            string                 r     = "";
            string                 rcode = "";
            Sys_AssortBll          srb   = new Sys_AssortBll();
            Sys_InventoryDetailBll sidb  = new Sys_InventoryDetailBll();
            SessionUserValidate    iv    = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                rcode = srb.GetAssort(invcode.Substring(0, invcode.Length - 3));
                if (rcode != "")
                {
                    string[]            rv  = rcode.Split(';');
                    Sys_InventoryDetail si  = new Sys_InventoryDetail();
                    Sys_InventoryDetail sid = sidb.Query(" and  icode like '" + rv[0] + "%' and mname='" + mname + "'");
                    if (sid == null)
                    {
                        si.icname = "";
                        si.iccode = "";
                    }
                    else
                    {
                        si = sid;
                    }
                    r = js.Serialize(si);
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
示例#2
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);
        }
示例#3
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);
        }
示例#4
0
        public static string GetMsBl(string mcode, string blcode)
        {
            string              r   = "";
            Sys_AssortBll       srb = new Sys_AssortBll();
            SessionUserValidate iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                r = srb.GetMsBl(mcode, blcode);
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
示例#5
0
        public static string GetAssort(string pcode)
        {
            string                   r    = "";
            Sys_AssortBll            srb  = new Sys_AssortBll();
            Sys_InventoryCategoryBll sicb = new Sys_InventoryCategoryBll();
            SessionUserValidate      iv   = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                r = srb.GetAssort(pcode);
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
示例#6
0
        public static string SetAssort(string pcode, string ptpcode)
        {
            string                   r    = "";
            Sys_AssortBll            srb  = new Sys_AssortBll();
            Sys_InventoryCategoryBll sicb = new Sys_InventoryCategoryBll();
            SessionUserValidate      iv   = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                srb.DelAssort(pcode);
                string[] arr = ptpcode.Split(';');
                try
                {
                    foreach (string pv in arr)
                    {
                        ArrayList ls = new ArrayList();
                        List <Sys_InventoryCategory> lsic = sicb.QueryList(" and iccode like '" + pv + "%' order by id asc");
                        if (lsic != null)
                        {
                            foreach (Sys_InventoryCategory sic in lsic)
                            {
                                ls.Add(sic.iccode);
                            }
                        }
                        srb.SetAssort(pcode, pv, ls);
                    }
                    r = "S";
                }
                catch
                {
                    r = "F";
                    srb.DelAssort(pcode);
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
示例#7
0
        public static string ReSetAssort(string pcode)
        {
            string              r   = "";
            Sys_AssortBll       srb = new Sys_AssortBll();
            SessionUserValidate iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                if (srb.ReSetAssort(pcode) > 0)
                {
                    r = "S";
                }
                else
                {
                    r = "F";
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
示例#8
0
        public static string SetMsBl(string mcode, string blcode, string bcode)
        {
            string              r   = "";
            Sys_AssortBll       srb = new Sys_AssortBll();
            SessionUserValidate iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                string[] barr = bcode.Split(';');
                if (srb.SetMsBl(mcode, blcode, barr) > 0)
                {
                    r = "S";
                }
                else
                {
                    r = "F";
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }