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

            if (iv.f)
            {
                Sys_TabMenuAbc sal = new Sys_TabMenuAbc();
                if (id != "")
                {
                    sal = stmab.Query(" and  id=" + id + "");
                }
                else
                {
                    Sys_EventMenu stm = semb.Query(" and  emcode='" + tmcode + "'");
                    sal.id     = 0;
                    sal.tmcode = stm.emcode;
                    sal.tmname = stm.emname;
                }
                d.d = js.Serialize(sal);
            }
            else
            {
                d.d = iv.badstr;
            }
            return(Json(d));
        }
Example #2
0
        public JsonResult SaveTabMenuAbc(string emcode, string emname, string ptype, string rcode, string tabc, string tid, string tname, string tsql)
        {
            JsonData            d   = new JsonData();
            Sys_TabMenuAbc      sta = new Sys_TabMenuAbc();
            SessionUserValidate iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                sta.tmcode = emcode;
                sta.tmname = emname;
                sta.rcode  = rcode;
                sta.tcode  = tabc;
                sta.tname  = tname;
                sta.tsql   = tsql;
                sta.cdate  = DateTime.Now.ToString();
                sta.ptype  = ptype;
                if (tid == "0")
                {
                    if (stmab.Add(sta) > 0)
                    {
                        d.d = "S";
                    }
                    else
                    {
                        d.d = "F";
                    }
                }
                else
                {
                    sta.id = Convert.ToInt32(tid);
                    if (stmab.Update(sta))
                    {
                        d.d = "S";
                    }
                    else
                    {
                        d.d = "F";
                    }
                }
            }
            else
            {
                d.d = iv.badstr;
            }
            return(Json(d));
        }