Example #1
0
        public JsonResult InitTabMenu(string tmcode)
        {
            JsonData            d  = new JsonData();
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                Sys_TabMenu sal = new Sys_TabMenu();
                if (tmcode != "")
                {
                    sal = stmb.Query(" and  tmcode='" + tmcode + "'");
                }
                else
                {
                    sal.id     = 0;
                    sal.tmcode = stmb.CreateCode().ToString().PadLeft(4, '0');
                }
                d.d = js.Serialize(sal);
            }
            else
            {
                d.d = iv.badstr;
            }
            return(Json(d));
        }
Example #2
0
        public JsonResult SaveTabMenu(string isflow, string pid, string pcode, string pname)
        {
            JsonData            d  = new JsonData();
            Sys_TabMenu         sa = new Sys_TabMenu();
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                sa.tmcode = pcode;
                sa.tmname = pname;
                sa.maker  = iv.u.ename;
                sa.cdate  = DateTime.Now.ToString();
                sa.dcode  = "";
                sa.tread  = true;
                sa.isflow = isflow == "1" ? true : false;
                if (pid == "0")
                {
                    if (stmb.Add(sa) > 0)
                    {
                        d.d = "S";
                    }
                    else
                    {
                        d.d = "F";
                    }
                }
                else
                {
                    sa.id = Convert.ToInt32(pid);
                    if (stmb.Update(sa))
                    {
                        d.d = "S";
                    }
                    else
                    {
                        d.d = "F";
                    }
                }
            }
            else
            {
                d.d = iv.badstr;
            }
            return(Json(d));
        }