Exemple #1
0
        public static string QueryYyApi(string dcode)
        {
            string              r   = "";
            API_yyBll           ayb = new API_yyBll();
            Sys_DepmentBll      sdb = new Sys_DepmentBll();
            SessionUserValidate iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                API_yy ay = new API_yy();
                if (ayb.Exists(" and dcode='" + dcode + "'"))
                {
                    ay = ayb.Query(" and dcode='" + dcode + "'");
                }
                else
                {
                    Sys_Depment sd = sdb.Query(" and dcode='" + dcode + "'");
                    if (sd != null)
                    {
                        ay.dname  = sd.dname;
                        ay.dcode  = sd.dcode;
                        ay.yycode = "";
                    }
                }
                r = js.Serialize(ay);
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Exemple #2
0
        public static string SetYyApi(string dcode, string dname, string yycode)
        {
            string              r   = "";
            API_yyBll           ayb = new API_yyBll();
            SessionUserValidate iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                API_yy ay = new API_yy();
                ay.dcode  = dcode;
                ay.dname  = dname;
                ay.yycode = yycode;
                if (ayb.Exists(" and dcode='" + dcode + "'"))
                {
                    if (ayb.Update(ay))
                    {
                        r = "S";
                    }
                    else
                    {
                        r = "F";
                    }
                }
                else
                {
                    if (ayb.Add(ay) > 0)
                    {
                        r = "S";
                    }
                    else
                    {
                        r = "F";
                    }
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }