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

            if (iv.f)
            {
                Sys_ConsumeMaterial sal = new Sys_ConsumeMaterial();
                if (mcode != "")
                {
                    sal = scmb.Query(" and mcode='" + mcode + "'");
                }
                else
                {
                    if (pmcode != "")
                    {
                        Sys_ConsumeMaterialCate smc = scmcb.Query(" and ccode='" + pmcode + "'");
                        if (smc != null)
                        {
                            sal.pmcode = smc.ccode;
                            sal.pmname = smc.cname;
                        }
                    }
                    sal.mcode = pmcode + scmb.CreateCode(pmcode).ToString().PadLeft(3, '0');
                    sal.id    = 0;
                }
                d.d = js.Serialize(sal);
            }
            else
            {
                d.d = iv.badstr;
            }
            return(Json(d));
        }
コード例 #2
0
        public JsonResult SaveMaterial(string mc, string mcode, string mh, string mid, string mk, string mname, string pmcode, string pmname, string munit)
        {
            JsonData            d   = new JsonData();
            Sys_ConsumeMaterial spp = new Sys_ConsumeMaterial();
            SessionUserValidate iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                spp.mname   = mname;
                spp.mcode   = mcode;
                spp.pmname  = pmname;
                spp.pmcode  = pmcode;
                spp.mlength = Convert.ToInt32(mc);
                spp.mwidth  = Convert.ToInt32(mk);
                spp.mdeep   = Convert.ToInt32(mh);
                spp.munit   = munit;
                spp.maker   = iv.u.ename;
                spp.cdate   = DateTime.Now.ToString();
                if (mid == "0")
                {
                    if (scmb.Add(spp) > 0)
                    {
                        d.d = "S";
                    }
                    else
                    {
                        d.d = "F";
                    }
                }
                else
                {
                    if (scmb.Update(spp))
                    {
                        d.d = "S";
                    }
                    else
                    {
                        d.d = "F";
                    }
                }
            }
            else
            {
                d.d = iv.badstr;
            }
            return(Json(d));
        }
コード例 #3
0
        public JsonResult SaveProcessCost(string bjtype, string uc, string ucode, string ugcode, string ugname, string uh, string umid, string uk, string ulg, string ulh, string ulk, string umname, string uname, string unum, string utg, string uth, string utj, string utk, string utype)
        {
            JsonData d = new JsonData();
            Sys_ProductionProcessCost spp = new Sys_ProductionProcessCost();
            SessionUserValidate       iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                Sys_ConsumeMaterial scm = scmb.Query(" and mcode='" + umname + "'");
                if (scm != null)
                {
                    spp.mname = scm.mname;
                    spp.mcode = scm.mcode;
                }
                spp.gcode = ugcode;
                spp.gname = ugname;
                spp.ucode = ucode;
                spp.uname = uname;
                spp.unum  = Convert.ToDecimal(unum);
                spp.mc    = uc;
                spp.mk    = uk;
                spp.mh    = uh;
                spp.utj   = Convert.ToInt32(utj);
                spp.ulg   = Convert.ToInt32(ulg);
                spp.ulk   = Convert.ToInt32(ulk);
                spp.ulh   = Convert.ToInt32(ulh);
                spp.utg   = Convert.ToInt32(utg);
                spp.utk   = Convert.ToInt32(utk);
                spp.uth   = Convert.ToInt32(uth);
                spp.utype = utype;
                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 (umid == "0")
                {
                    if (sppcb.Add(spp) > 0)
                    {
                        d.d = "S";
                    }
                    else
                    {
                        d.d = "F";
                    }
                }
                else
                {
                    if (sppcb.Update(spp))
                    {
                        d.d = "S";
                    }
                    else
                    {
                        d.d = "F";
                    }
                }
                string [] arr = bjtype.Split(';');
                sppcpb.AddList(uname, ucode, arr);
            }
            else
            {
                d.d = iv.badstr;
            }
            return(Json(d));
        }