Exemple #1
0
        public JsonResult InitFpro(string apcode)
        {
            JsonData            d  = new JsonData();
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                Sys_FixProduction sa = new Sys_FixProduction();
                if (apcode != "")
                {
                    sa = sfpb.Query(" and  apcode='" + apcode + "'");
                }
                else
                {
                    sa.id     = 0;
                    sa.apcode = sfpb.CreateCode().ToString().PadLeft(4, '0');
                }
                d.d = js.Serialize(sa);
            }
            else
            {
                d.d = iv.badstr;
            }
            return(Json(d));
        }
Exemple #2
0
        public JsonResult SaveFixProduction(string sid, List <String[]> prow)
        {
            JsonData            d  = new JsonData();
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                List <B_FixProduction> lb = new List <B_FixProduction>();
                if (prow != null)
                {
                    foreach (String[] s in prow)
                    {
                        B_FixProduction b = new B_FixProduction();
                        if (Convert.ToDecimal(s[2]) > 0)
                        {
                            Sys_FixProduction bf = sfpb.Query(" and apcode='" + s[1].ToString() + "'");
                            if (bf != null)
                            {
                                b.sid    = sid;
                                b.psid   = CommonBll.GetSid();
                                b.pname  = bf.apname;
                                b.pcode  = bf.apcode;
                                b.pmoney = bf.apprice;
                                b.pnum   = Convert.ToDecimal(s[2]);
                                b.maker  = iv.u.ename;
                                b.cdate  = DateTime.Now.ToString();
                                lb.Add(b);
                            }
                        }
                    }
                }
                if (lb.Count > 0)
                {
                    if (bfpb.SaveFixProductionList(sid, lb))
                    {
                        d.d = "S";
                    }
                    else
                    {
                        d.d = "F";
                    }
                }
                else
                {
                    d.d = "F";
                }
            }
            else
            {
                d.d = iv.badstr;
            }
            return(Json(d));
        }
Exemple #3
0
        public JsonResult SaveFpro(string apcode, string apname, string apprice, string aptype, string apunit, string id)
        {
            JsonData            d  = new JsonData();
            Sys_FixProduction   sa = new Sys_FixProduction();
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                sa.apcode  = apcode;
                sa.apname  = apname;
                sa.aptype  = aptype;
                sa.apunit  = apunit;
                sa.apprice = Convert.ToDecimal(apprice);
                if (id == "0")
                {
                    if (sfpb.Add(sa) > 0)
                    {
                        d.d = "S";
                    }
                    else
                    {
                        d.d = "F";
                    }
                }
                else
                {
                    if (sfpb.Update(sa))
                    {
                        d.d = "S";
                    }
                    else
                    {
                        d.d = "F";
                    }
                }
            }
            else
            {
                d.d = iv.badstr;
            }
            return(Json(d));
        }