Ejemplo n.º 1
0
        public static string QueryEmploeeTel(string ename)
        {
            string              r    = "";
            Sys_EmployeeDpt     sed  = new Sys_EmployeeDpt();
            Sys_EmployeeBll     seb  = new Sys_EmployeeBll();
            Sys_EmployeeDptBll  sedb = new Sys_EmployeeDptBll();
            SessionUserValidate iv   = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                sed = sedb.Query(" and eno=(select eno from Sys_Employee where ename='" + ename + "') ");
                if (sed != null)
                {
                    r = sed.etelephone;
                }
                else
                {
                    r = "";
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Ejemplo n.º 2
0
        public static ArrayList AllQueryEmploee()
        {
            ArrayList           r   = new ArrayList();
            Sys_EmployeeBll     seb = new Sys_EmployeeBll();
            SessionUserValidate iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                r.Add(iv.badstr);
                DataTable dt = seb.QueryEmploy("");
                if (dt != null)
                {
                    foreach (DataRow dr in dt.Rows)
                    {
                        ArrayList al = new ArrayList();
                        al.Add(dr["ename"].ToString());
                        al.Add(dr["dname"].ToString());
                        r.Add(al);
                    }
                }
            }
            else
            {
                r.Add(iv.badstr);
            }
            return(r);
        }
Ejemplo n.º 3
0
        public static ArrayList QueryList(string dcode)
        {
            ArrayList           r   = new ArrayList();
            Sys_EmployeeBll     seb = new Sys_EmployeeBll();
            Sys_DepmentBll      sdb = new Sys_DepmentBll();
            Sys_RoleBll         srb = new Sys_RoleBll();
            SessionUserValidate iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                r.Add(iv.badstr);
                List <Sys_Employee> ls = seb.QueryList(" and dcode='" + dcode + "' and estate='true'");
                if (ls != null)
                {
                    foreach (Sys_Employee s in ls)
                    {
                        Sys_Depment dep = sdb.Query(" and dcode='" + s.dcode + "'");
                        Sys_Role    sr  = srb.Query(" and rcode='" + s.rcode + "'");
                        ArrayList   al  = new ArrayList();
                        al.Add(s.eno);
                        al.Add(s.ename);
                        al.Add(dep == null?"":dep.dname);
                        al.Add(sr == null ? "" :sr.rname);
                        al.Add(s.estate == true ? "是" : "否");
                        al.Add(s.elogin == true?"是":"否");
                        r.Add(al);
                    }
                }
            }
            else
            {
                r.Add(iv.badstr);
            }
            return(r);
        }
Ejemplo n.º 4
0
        public static ArrayList QueryList()
        {
            ArrayList           r   = new ArrayList();
            Sys_UserBll         sub = new Sys_UserBll();
            SqlCondtion         sc  = new SqlCondtion();
            Sys_EmployeeBll     seb = new Sys_EmployeeBll();
            Sys_RoleBll         srb = new Sys_RoleBll();
            SessionUserValidate iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                r.Add(iv.badstr);
                StringBuilder where = new StringBuilder();
                //where.Append(sc.GetSqlWhere(" ulogin ", "true", "", ""));
                if (iv.u.rcode == "xtgl")
                {
                }
                else
                {
                    where.Append(" and eno in (select eno from  Sys_Employee where dcode like '" + iv.u.dcode.Substring(0, 8) + "%')");
                }
                List <Sys_User> ls = sub.QueryList(where.ToString());
                if (ls != null)
                {
                    foreach (Sys_User s in ls)
                    {
                        Sys_Employee sr = seb.Query(" and eno='" + s.eno + "'");
                        ArrayList    al = new ArrayList();
                        if (sr != null)
                        {
                            Sys_Role srs = srb.Query(" and rcode='" + sr.rcode + "'");
                            al.Add(sr.eno);
                            al.Add(s.uname);
                            al.Add(sr.ename);
                            al.Add(sr.dname);
                            al.Add(srs == null ? "" : srs.rname);
                            al.Add(s.ulogin == true ? "<span style='color:green'>正常</span>" : "<span style='color:red'>停用</span>");
                            r.Add(al);
                        }
                    }
                }
            }
            else
            {
                r.Add(iv.badstr);
            }
            return(r);
        }
Ejemplo n.º 5
0
        public static ArrayList QueryCdyList(string rcode)
        {
            ArrayList           r   = new ArrayList();
            Sys_EmployeeBll     seb = new Sys_EmployeeBll();
            SessionUserValidate iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                r.Add(iv.badstr);
                StringBuilder where = new StringBuilder();
                string[] rarr = rcode.Split(',');
                if (rarr.Length > 0)
                {
                    int k = 1;
                    foreach (string s in rarr)
                    {
                        if (k == 1)
                        {
                            where.AppendFormat(" rcode='{0}'", s);
                        }
                        else
                        {
                            where.AppendFormat(" or rcode='{0}'", s);
                        }
                        k++;
                    }
                }
                List <Sys_Employee> lse = seb.QueryList(" and dcode='" + iv.u.dcode + "' and (" + where.ToString() + ")");
                if (lse != null)
                {
                    foreach (Sys_Employee se in lse)
                    {
                        ArrayList al = new ArrayList();
                        al.Add(se.eno);
                        al.Add(se.ename);
                        r.Add(al);
                    }
                }
            }
            else
            {
                r.Add(iv.badstr);
            }
            return(r);
        }
Ejemplo n.º 6
0
        public static string LoginSystem(string iuname, string iupwd)
        {
            string       r   = "";
            SysExpireBll seb = new SysExpireBll();
            //if (seb.SysExpire())
            //{
            string jmsz = DES.EncryptDES(iupwd);

            if (!string.IsNullOrEmpty(iuname) && !string.IsNullOrEmpty(iupwd))
            {
                Sys_User        model = new Sys_User();
                Sys_Employee    ee    = new Sys_Employee();
                Sys_EmployeeDpt eed   = new Sys_EmployeeDpt();
                Sys_UserBll     sub   = new Sys_UserBll();
                Sys_EmployeeBll eb    = new Sys_EmployeeBll();
                model = sub.Query(" and uname='" + iuname + "' and upass='******' and ulogin='******'");
                if (model == null)
                {
                    r = "F";
                }
                else
                {
                    r  = "S";
                    ee = eb.Query(" and eno='" + model.eno + "'");
                    if (ee.dcode != "")
                    {
                        Sys_Depment sd = sdb.Query(" and dcode='" + ee.dcode + "'");
                        ee.dname = sd != null ? sd.dname : "";
                    }
                    eed = sedb.Query(" and eno='" + ee.eno + "'");
                    if (eed != null)
                    {
                        ee.etelephone = eed.etelephone;
                    }
                    ee.elname = iuname;
                    HttpContext.Current.Session["LUser"] = ee;
                    Guid       uniqueID = Guid.NewGuid();
                    OnLineUser olu      = new OnLineUser();
                    olu.Gid      = uniqueID;
                    olu.Zt       = 0;
                    olu.Username = model.uname;
                    UserCacheImp uci = new UserCacheImp();
                    if (HttpContext.Current.Request.Cookies["Cuser"] != null)
                    {
                        HttpCookie c*k = HttpContext.Current.Request.Cookies["Cuser"];
                        c*k.Values["cuser"] = System.Web.HttpUtility.UrlEncode(model.uname);
                        HttpContext.Current.Response.AppendCookie(c*k);
                    }
                    else
                    {
                        HttpCookie cookie = new HttpCookie("Cuser");
                        cookie.Values.Add("cuser", System.Web.HttpUtility.UrlEncode(model.uname));
                        HttpContext.Current.Response.AppendCookie(cookie);
                    }
                    uci.Add(olu, "U");
                }
            }
            else
            {
                HttpContext.Current.Session["LUser"] = null;
                r = "F";
            }
            // }
            //else
            //{
            //    r = "F";
            //}
            return(r);
        }
Ejemplo n.º 7
0
        public static string SaveEmploee(string account, string depcode, string depname, string duty,
                                         string eaddress, string eage, string eemail, string egradute, string eid, string elogin, string ename, string eno,
                                         string epwd, string esex, string esfz, string estate, string etelephone, string eworkdate, string role)
        {
            string              r    = "";
            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_DepmentBll      sdb  = new Sys_DepmentBll();
            Sys_EmployeeDptBll  sedb = new Sys_EmployeeDptBll();
            SessionUserValidate iv   = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                Sys_Depment sd = sdb.Query(" and dcode='" + depcode.Substring(0, 8) + "'");
                se.dname  = depname;
                se.dcode  = depcode;
                se.eno    = eno;
                se.ename  = ename;
                se.estate = estate == "1"?true:false;
                se.dtcode = "";
                se.elogin = elogin == "1" ? true : false;
                se.ecdate = DateTime.Now.ToString();
                se.emaker = iv.u.ename;
                se.rcode  = role;

                sed.eaddress     = eaddress;
                sed.eage         = Convert.ToInt32(eage);
                sed.eeducation   = egradute;
                sed.eemail       = eemail;
                sed.eheadimage   = "";
                sed.eidentity    = esfz;
                sed.enativeplace = "";
                sed.eno          = eno;
                sed.esex         = esex == "1" ? true : false;
                sed.etelephone   = etelephone;
                sed.eworkdate    = eworkdate;

                su.eno   = eno;
                su.upass = DES.EncryptDES(epwd);
                if (sd.dabc != "")
                {
                    su.uname = sd.dabc + "_" + account;
                }
                else
                {
                    su.uname = account;
                }
                su.ulogin     = elogin == "1"?true:false;
                su.uip        = "";
                su.ulogintime = "";
                if (eid == "0")
                {
                    if (!seb.Exists(" and eno='" + eno + "'"))
                    {
                        if (!sub.Exists(" and uname='" + su.uname + "'"))
                        {
                            if (seb.AddList(se, sed, su) > 0)
                            {
                                r = "S";
                            }
                            else
                            {
                                r = "F";
                            }
                        }
                        else
                        {
                            r = "TA";
                        }
                    }
                    else
                    {
                        r = "T";
                    }
                }
                else
                {
                    if (!seb.Exists(" and eno='" + eno + "' and id<>" + eid + ""))
                    {
                        if (!sub.Exists(" and uname='" + su.uname + "' and eno<>'" + eno + "'"))
                        {
                            cse = seb.Query(" and id=" + eid + "");
                            if (cse != null)
                            {
                                if (seb.UpdateList(cse.eno, se, sed, su) > 0)
                                {
                                    r = "S";
                                }
                                else
                                {
                                    r = "F";
                                }
                            }
                            else
                            {
                                r = "F";
                            }
                        }
                        else
                        {
                            r = "TA";
                        }
                    }
                    else
                    {
                        r = "T";
                    }
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Ejemplo n.º 8
0
        public static string QueryEmploee(string eno)
        {
            string              r    = "";
            VEmploee            ve   = new VEmploee();
            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_EmployeeDptBll  sedb = new Sys_EmployeeDptBll();
            SessionUserValidate iv   = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                if (eno == "")
                {
                    ve.eno          = "E" + seb.GetEno().ToString().PadLeft(8, '0');
                    ve.eaddress     = "";
                    ve.eage         = "0";
                    ve.eeducation   = "";
                    ve.eemail       = "";
                    ve.eheadimage   = "";
                    ve.eidentity    = "";
                    ve.enativeplace = "";
                    ve.esex         = "0";
                    ve.etelephone   = "";
                    ve.eworkdate    = "";
                    ve.estate       = "1";
                    ve.elogin       = "******";
                    ve.id           = 0;
                }
                else
                {
                    se        = seb.Query(" and eno='" + eno + "'");
                    sed       = sedb.Query(" and eno='" + eno + "'");
                    su        = sub.Query(" and eno='" + eno + "'");
                    ve.dname  = se.dname;
                    ve.dcode  = se.dcode;
                    ve.eno    = se.eno;
                    ve.ename  = se.ename;
                    ve.estate = se.estate == true ? "1" : "0";
                    ve.dtcode = "";
                    ve.elogin = se.elogin == true ? "1" : "0";
                    ve.rcode  = se.rcode;
                    if (sed != null)
                    {
                        ve.eaddress     = sed.eaddress;
                        ve.eage         = sed.eage.ToString();
                        ve.eeducation   = sed.eeducation;
                        ve.eemail       = sed.eemail;
                        ve.eheadimage   = sed.eheadimage;
                        ve.eidentity    = sed.eidentity;
                        ve.enativeplace = sed.enativeplace;
                        ve.esex         = sed.esex == true ? "1" : "0";
                        ve.etelephone   = sed.etelephone;
                        ve.eworkdate    = sed.eworkdate;
                    }
                    else
                    {
                        ve.eaddress     = "";
                        ve.eage         = "";
                        ve.eeducation   = "";
                        ve.eemail       = "";
                        ve.eheadimage   = "";
                        ve.eidentity    = "";
                        ve.enativeplace = "";
                        ve.esex         = "0";
                        ve.etelephone   = "";
                        ve.eworkdate    = "";
                    }
                    if (su != null)
                    {
                        ve.upass = DES.DecryptDES(su.upass);
                        ve.uname = su.uname;
                    }

                    ve.id = se.id;
                }

                r = js.Serialize(ve);
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Ejemplo n.º 9
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);
        }