Exemplo n.º 1
0
        public JsonResult InitTPriceCate(string lpcode)
        {
            JsonData            d  = new JsonData();
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                Sys_TPriceCate s = new Sys_TPriceCate();
                if (lpcode != "")
                {
                    s = stpcb.Query(" and  lpcode='" + lpcode + "'");
                }
                else
                {
                    s.lpcode = stpcb.CreateCode().ToString().PadLeft(6, '0');
                    s.id     = 0;
                }
                d.d = js.Serialize(s);
            }
            else
            {
                d.d = iv.badstr;
            }
            return(Json(d));
        }
Exemplo n.º 2
0
        public JsonResult SaveTPriceCate(string sptype, string tcode, string tid, string tname)
        {
            JsonData            d  = new JsonData();
            Sys_TPriceCate      sb = new Sys_TPriceCate();
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                sb.lpcode = tcode;
                sb.lpname = tname;
                sb.ptype  = sptype;
                sb.maker  = iv.u.ename;
                sb.cdate  = DateTime.Now.ToString();
                if (tid == "0")
                {
                    if (stpcb.Add(sb) > 0)
                    {
                        d.d = "S";
                    }
                    else
                    {
                        d.d = "F";
                    }
                }
                else
                {
                    if (stpcb.Update(sb))
                    {
                        d.d = "S";
                    }
                    else
                    {
                        d.d = "F";
                    }
                }
            }
            else
            {
                d.d = iv.badstr;
            }
            return(Json(d));
        }