예제 #1
0
        public JsonResult InitTemp(string ptcode, string tcode)
        {
            JsonData            d  = new JsonData();
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                Sys_ProductionTemp sal = new Sys_ProductionTemp();
                if (tcode != "")
                {
                    sal = sptb.Query(" and  tcode='" + tcode + "'");
                }
                else
                {
                    Sys_ProductionTempCate psal = new Sys_ProductionTempCate();
                    psal = sptcb.Query(" and  ptcode='" + ptcode + "'");
                    if (psal != null)
                    {
                        sal.ptcode = psal.ptcode;
                        sal.ptname = psal.ptname;
                    }
                    sal.tcode = sptb.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 SaveTemp(string tblyt, string tcode, string tdmx, string tdz, string tfrist, string thlx,
                                   string tht, string tist, string tid, string tlt, string tmdx, string tmtb, string tname, string tpcode,
                                   string tpname, string tsl, string tslhl, string tslsl, string tslx, string ttemp, string ttlh, string tytb
                                   )
        {
            JsonData            d  = new JsonData();
            Sys_ProductionTemp  sb = new Sys_ProductionTemp();
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                sb.tcode  = tcode;
                sb.tname  = tname;
                sb.ptcode = tpcode;
                sb.ptname = tpname;
                sb.tist   = Convert.ToInt32(tist);
                sb.tfrist = Convert.ToInt32(tfrist);
                sb.tht    = Convert.ToInt32(tht);
                sb.tlt    = Convert.ToInt32(tlt);
                sb.thlx   = Convert.ToInt32(thlx);
                sb.tslx   = Convert.ToInt32(tslx);
                sb.tdz    = Convert.ToInt32(tdz);
                sb.tmdx   = Convert.ToInt32(tmdx);
                sb.tmtb   = Convert.ToInt32(tmtb);
                sb.tytb   = Convert.ToInt32(tytb);
                sb.ttlh   = Convert.ToInt32(ttlh);
                sb.tdmx   = Convert.ToInt32(tdmx);
                sb.tsl    = Convert.ToInt32(tsl);
                sb.tblyt  = Convert.ToInt32(tblyt);
                sb.tslhl  = Convert.ToInt32(tslhl);
                sb.tslsl  = Convert.ToInt32(tslsl);
                sb.ttemp  = ttemp;
                sb.maker  = iv.u.ename;
                sb.cdate  = DateTime.Now.ToString();
                if (tid == "0")
                {
                    if (sptb.Add(sb) > 0)
                    {
                        d.d = "S";
                    }
                    else
                    {
                        d.d = "F";
                    }
                }
                else
                {
                    if (sptb.Update(sb))
                    {
                        d.d = "S";
                    }
                    else
                    {
                        d.d = "F";
                    }
                }
            }
            else
            {
                d.d = iv.badstr;
            }
            return(Json(d));
        }