コード例 #1
0
        public JsonResult InitProcessCost(string gcode, string ucode)
        {
            JsonData            d  = new JsonData();
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                Sys_ProductionProcessCost sal = new Sys_ProductionProcessCost();
                if (ucode != "")
                {
                    sal = sppcb.Query(" and  ucode='" + ucode + "'");
                }
                else
                {
                    Sys_ProductionProcess spp = new Sys_ProductionProcess();
                    spp = asppb.Query(" and gcode='" + gcode + "'");
                    if (spp != null)
                    {
                        sal.gcode = spp.gcode;
                        sal.gname = spp.gname;
                    }
                    sal.ucode = sppcb.CreateCode().ToString().PadLeft(4, '0');
                    sal.id    = 0;
                }
                d.d = js.Serialize(sal);
            }
            else
            {
                d.d = iv.badstr;
            }
            return(Json(d));
        }
コード例 #2
0
        public JsonResult SaveGy(string gccode, string gcname, string gcode, string gid, string gname)
        {
            JsonData d = new JsonData();
            Sys_ProductionProcess spp = new Sys_ProductionProcess();
            SessionUserValidate   iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                spp.gcode  = gcode;
                spp.gname  = gname;
                spp.pcname = gcname;
                spp.pccode = gccode;
                spp.maker  = iv.u.ename;
                spp.cdate  = DateTime.Now.ToString();
                if (iv.u.rcode != "xtgl")
                {
                    spp.dcode = iv.u.dcode.Substring(0, 8);
                }
                else
                {
                    spp.dcode = "";
                }
                if (gid == "0")
                {
                    if (sppb.Add(spp) > 0)
                    {
                        d.d = "S";
                    }
                    else
                    {
                        d.d = "F";
                    }
                }
                else
                {
                    if (sppb.Update(spp))
                    {
                        d.d = "S";
                    }
                    else
                    {
                        d.d = "F";
                    }
                }
            }
            else
            {
                d.d = iv.badstr;
            }
            return(Json(d));
        }