示例#1
0
        public static string InitCom(string cccode, string ccode)
        {
            string              r   = "";
            Sys_Component       sc  = new Sys_Component();
            Sys_ComponentCate   scc = new Sys_ComponentCate();
            SessionUserValidate iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                if (cccode != "")
                {
                    scc       = sccb.Query(" and cccode='" + cccode + "'");
                    sc.cccode = scc.cccode;
                    sc.ccname = scc.ccname;
                    sc.ccode  = scb.CreateCode("").ToString().PadLeft(4, '0');
                    sc.id     = 0;
                }
                else
                {
                    sc = scb.Query(" and ccode='" + ccode + "'");
                }
                r = js.Serialize(sc);
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
示例#2
0
        public static string SaveCom(string isshow, string zjcgp, string zjcode, string zjgg, string zjghp, string zjid, string zjlbcode, string zjlbname, string zjmname, string zjname, string zjsize, string zjxsp)
        {
            string r = "";

            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                if (zjmname != "")
                {
                    string[]             arrm = zjmname.Split(';');
                    List <Sys_Component> lsc  = new List <Sys_Component>();
                    for (int i = 0; i < arrm.Length; i++)
                    {
                        Sys_Component sr = new Sys_Component();
                        sr.cccode  = zjlbcode;
                        sr.ccname  = zjlbname;
                        sr.ccode   = zjcode;
                        sr.cname   = zjname;
                        sr.cggtype = zjgg;
                        sr.cisshow = isshow == "1" ? true : false;
                        sr.xsprice = Convert.ToDecimal(zjxsp);
                        sr.mname   = arrm[i];
                        sr.ghprice = Convert.ToDecimal(zjghp);
                        sr.cgprice = Convert.ToDecimal(zjcgp);
                        sr.csize   = zjsize;
                        sr.cdate   = DateTime.Now.ToString();
                        sr.maker   = iv.u.ename;
                        lsc.Add(sr);
                    }
                    if (scb.AddList(lsc) > 0)
                    {
                        r = "S";
                    }
                    else
                    {
                        r = "F";
                    }
                }
                else
                {
                    Sys_Component sr = new Sys_Component();
                    sr.cccode  = zjlbcode;
                    sr.ccname  = zjlbname;
                    sr.ccode   = zjcode;
                    sr.cname   = zjname;
                    sr.cggtype = zjgg;
                    sr.cisshow = isshow == "1" ? true : false;
                    sr.xsprice = Convert.ToDecimal(zjxsp);
                    sr.mname   = zjmname;
                    sr.ghprice = Convert.ToDecimal(zjghp);
                    sr.cgprice = Convert.ToDecimal(zjcgp);
                    sr.csize   = zjsize;
                    sr.cdate   = DateTime.Now.ToString();
                    sr.maker   = iv.u.ename;
                    if (zjid == "0")
                    {
                        if (scb.Add(sr) > 0)
                        {
                            r = "S";
                        }
                        else
                        {
                            r = "F";
                        }
                    }
                    else
                    {
                        if (scb.Update(sr))
                        {
                            r = "S";
                        }
                        else
                        {
                            r = "F";
                        }
                    }
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }