Beispiel #1
0
        public static ArrayList QueryListLastCategory(string ipcode)
        {
            ArrayList r = new ArrayList();
            Sys_InventoryCategoryBll     sicb = new Sys_InventoryCategoryBll();
            List <Sys_InventoryCategory> lsr  = new List <Sys_InventoryCategory>();
            SessionUserValidate          iv   = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                r.Add(iv.badstr);
                if (iv.u.dcode == "")
                {
                    lsr = sicb.QueryList(" and icstate='true' and iccode like '00010001" + ipcode + "%'");
                }
                else
                {
                    lsr = sicb.QueryList(" and icstate='true' and iccode like '" + iv.u.dcode.Substring(0, 8) + ipcode + "%'");
                }
                if (lsr != null)
                {
                    foreach (Sys_InventoryCategory s in lsr)
                    {
                        ArrayList al = new ArrayList();
                        al.Add(s.iccode);
                        al.Add(s.icname);
                        r.Add(al);
                    }
                }
            }
            else
            {
                r.Add(iv.badstr);
            }
            return(r);
        }
Beispiel #2
0
        public static ArrayList QueryList(string ptcode)
        {
            ArrayList                r    = new ArrayList();
            Sys_AgentFeeBll          srb  = new Sys_AgentFeeBll();
            List <Sys_AgentFee>      lsf  = new List <Sys_AgentFee>();
            Sys_InventoryCategoryBll sicb = new Sys_InventoryCategoryBll();
            Sys_DepmentBll           sdb  = new Sys_DepmentBll();
            SessionUserValidate      iv   = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                r.Add(iv.badstr);
                lsf = srb.QueryList(" and acode='" + ptcode + "'");
                if (lsf != null)
                {
                    foreach (Sys_AgentFee s in lsf)
                    {
                        ArrayList             al  = new ArrayList();
                        Sys_InventoryCategory sic = sicb.Query(" and iccode='" + s.icode + "'");
                        Sys_Depment           dt  = sdb.Query(" and dcode='" + s.acode + "'");
                        al.Add(s.id);
                        al.Add(dt == null?"":dt.dname);
                        al.Add(sic == null?"":sic.icname);
                        al.Add(s.fmoney);
                        al.Add(s.tfmoney);
                        r.Add(al);
                    }
                }
            }
            else
            {
                r.Add(iv.badstr);
            }
            return(r);
        }
Beispiel #3
0
        public static string SaveInventoryCategory(string drange, string lcode, string lid, string lname, string lpcode, string lpname)
        {
            string r = "";
            Sys_InventoryCategoryBll sicb = new Sys_InventoryCategoryBll();
            Sys_InventoryCategory    sic  = new Sys_InventoryCategory();
            SessionUserValidate      iv   = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                sic.iccode  = lcode;
                sic.icpcode = lpcode;
                sic.icname  = lname;
                sic.icpname = lpname;
                sic.maker   = iv.u.ename;
                sic.cdate   = DateTime.Now.ToString();
                sic.icsend  = true;
                sic.icstate = true;
                sic.icms    = "";
                sic.drange  = drange;
                if (lid == "0")
                {
                    if (sicb.Add(sic) > 0)
                    {
                        r = "S";
                    }
                    else
                    {
                        r = "F";
                    }
                }
                else
                {
                    if (sicb.Update(sic))
                    {
                        r = "S";
                    }
                    else
                    {
                        r = "F";
                    }
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Beispiel #4
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);
        }
Beispiel #5
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);
        }
Beispiel #6
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);
        }
Beispiel #7
0
        public static ArrayList QueryListInventoryCategoryRange(string ipcode, string drange)
        {
            ArrayList r = new ArrayList();
            Sys_InventoryCategoryBll     sub = new Sys_InventoryCategoryBll();
            List <Sys_InventoryCategory> lsr = new List <Sys_InventoryCategory>();
            SessionUserValidate          iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                r.Add(iv.badstr);
                string where = "";
                if (iv.u.rcode == "xtgl")
                {
                    where = " and icpcode='" + ipcode + "' and drange='" + drange + "' order by isort";
                }
                else
                {
                    if (ipcode == "")
                    {
                        where = " and icpcode='" + iv.u.dcode.Substring(0, 8) + "' and drange='" + drange + "' order by isort";
                    }
                    else
                    {
                        where = " and icpcode='" + ipcode + "' and drange='" + drange + "' order by isort";
                    }
                }
                lsr = sub.QueryList(where);
                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);
        }
Beispiel #8
0
        public static ArrayList CzQueryListInventoryCategory(string ipcode, string mname)
        {
            ArrayList r = new ArrayList();
            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_InventoryDetailBll       sidb = new Sys_InventoryDetailBll();
            SessionUserValidate          iv   = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                r.Add(iv.badstr);
                lsr  = sub.QueryList(" and iccode='" + ipcode + "' order by isort");
                plsr = sub.QueryList(" and icpcode='" + ipcode + "'  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 (sidb.Exists(" and icode like '" + s.iccode + "%' and mname='" + mname + "'"))
                        {
                            r.Add(al);
                        }
                    }
                }
            }
            else
            {
                r.Add(iv.badstr);
            }
            return(r);
        }
Beispiel #9
0
        public static string InitInventory(string iccode, string icode)
        {
            string r = "";
            Sys_InventoryDetail      sid  = new Sys_InventoryDetail();
            Sys_InventoryDetailBll   sidb = new Sys_InventoryDetailBll();
            Sys_InventoryCategory    sic  = new Sys_InventoryCategory();
            Sys_InventoryCategoryBll sicb = new Sys_InventoryCategoryBll();
            SessionUserValidate      iv   = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                sic = sicb.Query(" and iccode='" + iccode + "'");
                if (icode == "")
                {
                    if (sic != null)
                    {
                        sid.iccode = sic.iccode;
                        sid.icname = sic.icname;
                        sid.iname  = sic.icname;
                    }
                    else
                    {
                        sid.iccode = "";
                        sid.icname = "";
                        sid.iname  = "";
                    }
                    sid.icode  = iccode + sidb.CreateCode(iccode).ToString().PadLeft(3, '0');
                    sid.istate = true;
                    sid.id     = 0;
                }
                else
                {
                    sid = sidb.Query(" and icode='" + icode + "'");
                }
                r = js.Serialize(sid);
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Beispiel #10
0
        public static string BatchSaveInventoryCategory(string pname, string pcode)
        {
            string r = "";
            Sys_InventoryCategoryBll sicb = new Sys_InventoryCategoryBll();

            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                string[] parr = pcode.Split(';');
                for (int i = 0; i < parr.Length; i++)
                {
                    Sys_InventoryCategory sic = new Sys_InventoryCategory();
                    Sys_InventoryCategory p   = sicb.Query("  and iccode='" + parr[i] + "' ");
                    sic.iccode  = parr[i] + sicb.CreateCode(parr[i]).ToString().PadLeft(3, '0');
                    sic.icpcode = parr[i];
                    sic.icname  = pname;
                    sic.icpname = p != null? p.icname:"";
                    sic.maker   = iv.u.ename;
                    sic.cdate   = DateTime.Now.ToString();
                    sic.icsend  = true;
                    sic.icstate = true;
                    sic.icms    = "";
                    sic.drange  = p != null?p.drange:"";
                    if (sicb.Add(sic) > 0)
                    {
                        r = "S";
                    }
                    else
                    {
                        r = "F";
                    }
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Beispiel #11
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);
        }
Beispiel #12
0
        public static string InitFee(string ptcode, string pcode, string id)
        {
            string                   r    = "";
            Sys_AgentFee             sr   = new Sys_AgentFee();
            Sys_AgentFeeBll          srb  = new Sys_AgentFeeBll();
            Sys_InventoryCategoryBll sicb = new Sys_InventoryCategoryBll();
            Sys_DepmentBll           sdb  = new Sys_DepmentBll();
            SessionUserValidate      iv   = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                Sys_InventoryCategory ic = new Sys_InventoryCategory();
                Sys_Depment           dt = new Sys_Depment();
                if (id == "0" || id == "")
                {
                    ic       = sicb.Query(" and iccode='" + pcode + "'");
                    dt       = sdb.Query(" and dcode='" + ptcode + "'");
                    sr.acode = ptcode;
                    sr.aname = dt.dname;
                    sr.iname = ic.icname;
                    sr.icode = pcode;
                    sr.id    = 0;
                    r        = js.Serialize(sr);
                }
                else
                {
                    sr       = srb.Query(" and id=" + id + "");
                    sr.iname = sicb.Query(" and iccode='" + sr.icode + "'").icname;
                    sr.aname = sdb.Query(" and dcode='" + sr.acode + "'").dname;
                    r        = js.Serialize(sr);
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Beispiel #13
0
        public static string DelInventoryCategory(string iccode)
        {
            string r = "";
            Sys_InventoryCategoryBll sdb = new Sys_InventoryCategoryBll();
            SessionUserValidate      iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                if (sdb.Delete(iccode))
                {
                    r = "S";
                }
                else
                {
                    r = "F";
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Beispiel #14
0
        public static string QueryProductions(string icode)
        {
            string r = "";
            Sys_InventoryCategoryBll sicb = new Sys_InventoryCategoryBll();
            SessionUserValidate      iv   = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                string[] arr = icode.Split(';');
                foreach (string s in arr)
                {
                    Sys_InventoryCategory sic = sicb.Query(" and iccode='" + s + "'");
                    if (sic != null)
                    {
                        r = r + sic.icname + ";";
                    }
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Beispiel #15
0
        public static ArrayList BatchSaveInventory(string iccode, string plmname, string plsize, string pltype, string plunit)
        {
            ArrayList r = new ArrayList();
            Sys_InventoryDetailBll   sidb = new Sys_InventoryDetailBll();
            Sys_MaterialBll          sub  = new Sys_MaterialBll();
            List <Sys_Material>      lsr  = new List <Sys_Material>();
            Sys_InventoryCategoryBll sicb = new Sys_InventoryCategoryBll();
            SessionUserValidate      iv   = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                List <Sys_InventoryCategory> als  = new List <Sys_InventoryCategory>();
                List <Sys_InventoryDetail>   lsid = new List <Sys_InventoryDetail>();
                string[] iarr = iccode.Split(';');
                if (iarr.Length > 0)
                {
                    foreach (string icv in iarr)
                    {
                        List <Sys_InventoryCategory> lic = sicb.QueryList(" and iccode like '" + icv + "%' and icstate='true'");
                        if (lic != null)
                        {
                            foreach (Sys_InventoryCategory sic in lic)
                            {
                                if (!als.Contains(sic))
                                {
                                    als.Add(sic);
                                }
                            }
                        }
                    }
                }
                if (als.Count > 0)
                {
                    r.Add("S");
                    foreach (Sys_InventoryCategory sic in als)
                    {
                        string[] arr   = plmname.Split(';');
                        int      pcnum = sidb.CreateCode(sic.iccode);
                        foreach (string cz in arr)
                        {
                            if (!sidb.Exists(" and iname='" + sic.icname + "' and mname='" + cz + "'"))
                            {
                                Sys_InventoryDetail sid = new Sys_InventoryDetail();
                                sid.icname         = sic.icname;
                                sid.iccode         = sic.iccode;
                                sid.iname          = sic.icname;
                                sid.icode          = sic.iccode + pcnum.ToString().PadLeft(3, '0');
                                sid.mname          = cz;
                                sid.iunit          = plunit;
                                sid.maker          = iv.u.ename;
                                sid.isaleprice     = 0;
                                sid.isupplyprice   = 0;
                                sid.ipurchaseprice = 0;
                                sid.iimage         = "";
                                sid.istate         = true;
                                sid.mcode          = "";
                                sid.idef1          = "";
                                sid.idef2          = true;
                                sid.idef3          = 0;
                                sid.psize          = plsize;
                                sid.cdate          = DateTime.Now.ToString();
                                sid.tcprice        = 0;
                                sid.ptype          = pltype;
                                if (sidb.Add(sid) < 0)
                                {
                                    lsid.Add(sid);
                                }
                                pcnum++;
                            }
                            else
                            {
                                Sys_InventoryDetail fsid = new Sys_InventoryDetail();
                                fsid.mname = cz;
                                fsid.iname = sic.icname;
                                lsid.Add(fsid);
                            }
                        }
                    }
                    if (lsid.Count > 0)
                    {
                        foreach (Sys_InventoryDetail sd in lsid)
                        {
                            ArrayList al = new ArrayList();
                            al.Add(sd.iname);
                            al.Add(sd.mname);
                            r.Add(al);
                        }
                    }
                }
                else
                {
                    r.Add("F");
                }
            }
            else
            {
                r.Add(iv.badstr);
            }
            return(r);
        }
Beispiel #16
0
        public static string AddCompany(string aid, string dabc, string daddress, string dcode, string dname, string dtype, string iadmin, string idep, string iproduction, string manager, string telephone)
        {
            string              r    = "";
            Sys_Depment         sd   = new Sys_Depment();
            Sys_DepmentDpt      sdd  = new Sys_DepmentDpt();
            Sys_DepmentBll      sdb  = new Sys_DepmentBll();
            Sys_DepmentDptBll   sddb = new Sys_DepmentDptBll();
            SessionUserValidate iv   = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                sd.dname        = dname;
                sd.dcode        = dcode;
                sd.disend       = true;
                sd.disused      = true;
                sd.dattr        = dtype;
                sd.dcdate       = DateTime.Now.ToString();
                sd.dmaker       = iv.u.ename;
                sd.dpcode       = "0001";
                sd.dpname       = "北京联汇软件";
                sd.dcdep        = idep;
                sd.dread        = true;
                sd.dabc         = dabc;
                sdd.dcode       = dcode;
                sdd.daddress    = daddress;
                sdd.dcontact    = telephone;
                sdd.ddetail     = "";
                sdd.dfitment    = DateTime.Now.ToString();
                sdd.dmaker      = iv.u.ename;
                sdd.dmanager    = manager;
                sdd.dno         = "";
                sdd.iadmin      = iadmin == "1" ? true : false;
                sdd.idepment    = idep;
                sdd.logo        = "";
                sdd.iproduction = iproduction == "1" ? true : false;
                sdd.dperson     = 0;
                if (aid == "0")
                {
                    if (sdb.AddDepWithChildDep(sd) > 0)
                    {
                        if (sdd.iadmin)
                        {
                            #region
                            Sys_Employee       se   = new Sys_Employee();
                            Sys_User           su   = new Sys_User();
                            Sys_EmployeeDpt    sed  = new Sys_EmployeeDpt();
                            Sys_EmployeeBll    seb  = new Sys_EmployeeBll();
                            Sys_UserBll        sub  = new Sys_UserBll();
                            Sys_Employee       cse  = new Sys_Employee();
                            Sys_EmployeeDptBll sedb = new Sys_EmployeeDptBll();

                            se.dname  = sd.dname;
                            se.dcode  = sd.dcode;
                            se.eno    = "E" + seb.GetEno().ToString().PadLeft(8, '0');
                            se.ename  = sd.dname + "管理员";
                            se.estate = true;
                            se.dtcode = "";
                            se.elogin = true;
                            se.ecdate = DateTime.Now.ToString();
                            se.emaker = iv.u.ename;
                            se.rcode  = "0001";

                            sed.eaddress     = "";
                            sed.eage         = 0;
                            sed.eeducation   = "";
                            sed.eemail       = "";
                            sed.eheadimage   = "";
                            sed.eidentity    = "";
                            sed.enativeplace = "";
                            sed.eno          = se.eno;
                            sed.esex         = true;
                            sed.etelephone   = "";
                            sed.eworkdate    = DateTime.Now.ToString();

                            su.eno        = se.eno;
                            su.upass      = DES.EncryptDES("123456");
                            su.uname      = sd.dabc + "_admin";
                            su.ulogin     = true;
                            su.uip        = "";
                            su.ulogintime = "";
                            seb.AddList(se, sed, su);
                            #endregion
                        }
                        if (sdd.iproduction)
                        {
                            #region
                            Sys_InventoryCategoryBll sicb = new Sys_InventoryCategoryBll();
                            Sys_InventoryCategory    zcp  = new Sys_InventoryCategory();
                            zcp.iccode  = sd.dcode;
                            zcp.icpcode = "";
                            zcp.icname  = sd.dname + "产品";
                            zcp.icpname = "";
                            zcp.maker   = iv.u.ename;
                            zcp.cdate   = DateTime.Now.ToString();
                            zcp.icsend  = true;
                            zcp.icstate = false;
                            zcp.icms    = "";
                            sicb.Add(zcp);
                            Sys_InventoryCategory ztm = new Sys_InventoryCategory();
                            ztm.iccode  = sd.dcode + "10";
                            ztm.icpcode = sd.dcode;
                            ztm.icname  = "整套门";
                            ztm.icpname = "";
                            ztm.maker   = iv.u.ename;
                            ztm.cdate   = DateTime.Now.ToString();
                            ztm.icsend  = true;
                            ztm.icstate = true;
                            ztm.icms    = "";
                            ztm.isort   = 1;
                            sicb.Add(ztm);
                            Sys_InventoryCategory ms = new Sys_InventoryCategory();
                            ms.iccode  = sd.dcode + "01";
                            ms.icpcode = sd.dcode;
                            ms.icname  = "门扇";
                            ms.icpname = "";
                            ms.maker   = iv.u.ename;
                            ms.cdate   = DateTime.Now.ToString();
                            ms.icsend  = true;
                            ms.icstate = false;
                            ms.icms    = "";
                            ms.isort   = 2;
                            sicb.Add(ms);
                            Sys_InventoryCategory dms = new Sys_InventoryCategory();
                            dms.iccode  = ms.iccode + "01";
                            dms.icpcode = ms.iccode;
                            dms.icname  = "单开门";
                            dms.icpname = "门扇";
                            dms.maker   = iv.u.ename;
                            dms.cdate   = DateTime.Now.ToString();
                            dms.icsend  = true;
                            dms.icstate = true;
                            dms.icms    = "";
                            dms.isort   = 21;
                            sicb.Add(dms);
                            Sys_InventoryCategory sms = new Sys_InventoryCategory();
                            sms.iccode  = ms.iccode + "02";
                            sms.icpcode = ms.iccode;
                            sms.icname  = "对开门";
                            sms.icpname = "门扇";
                            sms.maker   = iv.u.ename;
                            sms.cdate   = DateTime.Now.ToString();
                            sms.icsend  = true;
                            sms.icstate = true;
                            sms.icms    = "";
                            sms.isort   = 22;
                            sicb.Add(sms);
                            Sys_InventoryCategory zms = new Sys_InventoryCategory();
                            zms.iccode  = ms.iccode + "03";
                            zms.icpcode = ms.iccode;
                            zms.icname  = "子母门";
                            zms.icpname = "门扇";
                            zms.maker   = iv.u.ename;
                            zms.cdate   = DateTime.Now.ToString();
                            zms.icsend  = true;
                            zms.icstate = true;
                            zms.icms    = "";
                            zms.isort   = 23;
                            sicb.Add(zms);
                            Sys_InventoryCategory tlm = new Sys_InventoryCategory();
                            tlm.iccode  = ms.iccode + "04";
                            tlm.icpcode = ms.iccode;
                            tlm.icname  = "推拉门";
                            tlm.icpname = "门扇";
                            tlm.maker   = iv.u.ename;
                            tlm.cdate   = DateTime.Now.ToString();
                            tlm.icsend  = true;
                            tlm.icstate = false;
                            tlm.icms    = "";
                            tlm.isort   = 24;
                            sicb.Add(tlm);
                            Sys_InventoryCategory stlm = new Sys_InventoryCategory();
                            stlm.iccode  = tlm.iccode + "01";
                            stlm.icpcode = tlm.iccode;
                            stlm.icname  = "两扇推拉门";
                            stlm.icpname = "推拉门";
                            stlm.maker   = iv.u.ename;
                            stlm.cdate   = DateTime.Now.ToString();
                            stlm.icsend  = true;
                            stlm.icstate = true;
                            stlm.icms    = "";
                            stlm.isort   = 241;
                            sicb.Add(stlm);
                            Sys_InventoryCategory ftlm = new Sys_InventoryCategory();
                            ftlm.iccode  = tlm.iccode + "02";
                            ftlm.icpcode = tlm.iccode;
                            ftlm.icname  = "四扇推拉门";
                            ftlm.icpname = "推拉门";
                            ftlm.maker   = iv.u.ename;
                            ftlm.cdate   = DateTime.Now.ToString();
                            ftlm.icsend  = true;
                            ftlm.icstate = true;
                            ftlm.icms    = "";
                            ftlm.isort   = 242;
                            sicb.Add(ftlm);
                            Sys_InventoryCategory mt = new Sys_InventoryCategory();
                            mt.iccode  = sd.dcode + "02";
                            mt.icpcode = sd.dcode;
                            mt.icname  = "门套";
                            mt.icpname = "";
                            mt.maker   = iv.u.ename;
                            mt.cdate   = DateTime.Now.ToString();
                            mt.icsend  = true;
                            mt.icstate = false;
                            mt.icms    = "";
                            mt.isort   = 3;
                            sicb.Add(mt);
                            Sys_InventoryCategory dmt = new Sys_InventoryCategory();
                            dmt.iccode  = mt.iccode + "01";
                            dmt.icpcode = mt.iccode;
                            dmt.icname  = "单开门套";
                            dmt.icpname = "门套";
                            dmt.maker   = iv.u.ename;
                            dmt.cdate   = DateTime.Now.ToString();
                            dmt.icsend  = true;
                            dmt.icstate = true;
                            dmt.icms    = "";
                            dmt.isort   = 31;
                            sicb.Add(dmt);
                            Sys_InventoryCategory smt = new Sys_InventoryCategory();
                            smt.iccode  = mt.iccode + "02";
                            smt.icpcode = mt.iccode;
                            smt.icname  = "对开门套";
                            smt.icpname = "门套";
                            smt.maker   = iv.u.ename;
                            smt.cdate   = DateTime.Now.ToString();
                            smt.icsend  = true;
                            smt.icstate = true;
                            smt.icms    = "";
                            smt.isort   = 32;
                            sicb.Add(smt);
                            Sys_InventoryCategory zmt = new Sys_InventoryCategory();
                            zmt.iccode  = mt.iccode + "03";
                            zmt.icpcode = mt.iccode;
                            zmt.icname  = "子母门套";
                            zmt.icpname = "门套";
                            zmt.maker   = iv.u.ename;
                            zmt.cdate   = DateTime.Now.ToString();
                            zmt.icsend  = true;
                            zmt.icstate = true;
                            zmt.icms    = "";
                            zmt.isort   = 33;
                            sicb.Add(zmt);
                            Sys_InventoryCategory tmt = new Sys_InventoryCategory();
                            tmt.iccode  = mt.iccode + "04";
                            tmt.icpcode = mt.iccode;
                            tmt.icname  = "推拉门套";
                            tmt.icpname = "门套";
                            tmt.maker   = iv.u.ename;
                            tmt.cdate   = DateTime.Now.ToString();
                            tmt.icsend  = true;
                            tmt.icstate = true;
                            tmt.icms    = "";
                            tmt.isort   = 34;
                            sicb.Add(tmt);
                            Sys_InventoryCategory wj = new Sys_InventoryCategory();
                            wj.iccode  = sd.dcode + "04";
                            wj.icpcode = sd.dcode;
                            wj.icname  = "五金";
                            wj.icpname = "";
                            wj.maker   = iv.u.ename;
                            wj.cdate   = DateTime.Now.ToString();
                            wj.icsend  = true;
                            wj.icstate = true;
                            wj.icms    = "";
                            wj.isort   = 4;
                            sicb.Add(wj);
                            Sys_InventoryCategory bl = new Sys_InventoryCategory();
                            bl.iccode  = sd.dcode + "05";
                            bl.icpcode = sd.dcode;
                            bl.icname  = "玻璃";
                            bl.icpname = "";
                            bl.maker   = iv.u.ename;
                            bl.cdate   = DateTime.Now.ToString();
                            bl.icsend  = true;
                            bl.icstate = true;
                            bl.icms    = "";
                            bl.isort   = 5;
                            sicb.Add(bl);
                            Sys_InventoryCategory ct = new Sys_InventoryCategory();
                            ct.iccode  = sd.dcode + "06";
                            ct.icpcode = sd.dcode;
                            ct.icname  = "窗套";
                            ct.icpname = "";
                            ct.maker   = iv.u.ename;
                            ct.cdate   = DateTime.Now.ToString();
                            ct.icsend  = true;
                            ct.icstate = true;
                            ct.icms    = "";
                            ct.isort   = 6;
                            sicb.Add(ct);
                            Sys_InventoryCategory yk = new Sys_InventoryCategory();
                            yk.iccode  = sd.dcode + "07";
                            yk.icpcode = sd.dcode;
                            yk.icname  = "垭口";
                            yk.icpname = "";
                            yk.maker   = iv.u.ename;
                            yk.cdate   = DateTime.Now.ToString();
                            yk.icsend  = true;
                            yk.icstate = true;
                            yk.icms    = "";
                            yk.isort   = 7;
                            sicb.Add(yk);
                            Sys_InventoryCategory hj = new Sys_InventoryCategory();
                            hj.iccode  = sd.dcode + "08";
                            hj.icpcode = sd.dcode;
                            hj.icname  = "护角";
                            hj.icpname = "";
                            hj.maker   = iv.u.ename;
                            hj.cdate   = DateTime.Now.ToString();
                            hj.icsend  = true;
                            hj.icstate = true;
                            hj.icms    = "";
                            hj.isort   = 8;
                            sicb.Add(hj);
                            Sys_InventoryCategory qt = new Sys_InventoryCategory();
                            qt.iccode  = sd.dcode + "09";
                            qt.icpcode = sd.dcode;
                            qt.icname  = "其他";
                            qt.icpname = "";
                            qt.maker   = iv.u.ename;
                            qt.cdate   = DateTime.Now.ToString();
                            qt.icsend  = true;
                            qt.icstate = true;
                            qt.icms    = "";
                            qt.isort   = 9;
                            sicb.Add(qt);
                            #endregion
                        }
                        sddb.Add(sdd);
                        r = "S";
                    }
                    else
                    {
                        r = "F";
                    }
                }
                else
                {
                    if (sdb.Update(sd))
                    {
                        sddb.Update(sdd);
                        r = "S";
                    }
                    else
                    {
                        r = "F";
                    }
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }