Ejemplo n.º 1
0
        public JsonResult InitGlassPeriod(string fcode, string gqcode)
        {
            JsonData            d  = new JsonData();
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                Sys_GlassProductionPeriod sal = new Sys_GlassProductionPeriod();
                if (gqcode != "")
                {
                    sal = sltb.Query(" and  gqcode='" + gqcode + "'");
                }
                else
                {
                    sal.fcode  = fcode;
                    sal.gqcode = sltb.CreateCode().ToString().PadLeft(4, '0');
                    sal.id     = 0;
                }
                d.d = js.Serialize(sal);
            }
            else
            {
                d.d = iv.badstr;
            }
            return(Json(d));
        }
Ejemplo n.º 2
0
        public JsonResult SaveGlassPeriod(string fcode, string gqcode, string gqid, string gqname, string gqnum)
        {
            JsonData d = new JsonData();
            Sys_GlassProductionPeriod sb = new Sys_GlassProductionPeriod();
            SessionUserValidate       iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                Sys_Depment sd = sdb.Query("and dcode='" + fcode + "'");
                if (sd != null)
                {
                    sb.fcode = sd.dcode;
                    sb.fname = sd.dname;
                }
                sb.gqname = gqname;
                sb.gqcode = gqcode;
                sb.gqnum  = Convert.ToInt32(gqnum);
                sb.maker  = iv.u.ename;
                sb.cdate  = DateTime.Now.ToString();
                if (gqid == "0")
                {
                    if (sltb.Add(sb) > 0)
                    {
                        d.d = "S";
                    }
                    else
                    {
                        d.d = "F";
                    }
                }
                else
                {
                    if (sltb.Update(sb))
                    {
                        d.d = "S";
                    }
                    else
                    {
                        d.d = "F";
                    }
                }
            }
            else
            {
                d.d = iv.badstr;
            }
            return(Json(d));
        }