protected void Page_Load(object sender, EventArgs e)
    {
        string         result         = "";
        string         username       = HttpUtil.GetReqStrValue("username");
        string         password       = HttpUtil.GetReqStrValue("password");
        string         imgVerify      = HttpUtil.GetReqStrValue("imgVerify");
        string         num            = Convert.ToString(Request["num"]);
        string         num2           = HttpUtil.GetReqStrValue("num");
        string         serverFilePath = @"E:\AppInOne_Solution\Site\UploadFiles\WecHeader";
        WEC_PUBLICLIST wec1           = new WEC_PUBLICLIST();

        try
        {
            TestCase.IServiceChannel iService = ChannelFactory <TestCase.IServiceChannel> .CreateChannel(new NetTcpBinding(SecurityMode.None), new EndpointAddress("net.tcp://localhost:8081/TestCase.WecService"));

            iService.OperationTimeout = new TimeSpan(1, 0, 5);
            iService.Open(new TimeSpan(0, 0, 10));

            if ("1".Equals(num))
            {
                result = iService.wecAddUser(username, password, imgVerify, serverFilePath);
            }
            else
            {
                result = iService.getStatus(username, password, ref wec1);
                //
                if (wec1._PLC_SOURCEID != null)
                {
                    WEC_PUBLICLIST cond1 = new WEC_PUBLICLIST();
                    cond1._PLC_SOURCEID = wec1._PLC_SOURCEID;
                    if (wec1.APPID != null)
                    {
                        cond1.APPID = wec1.APPID;
                    }
                    if (wec1.APPSESECRET != null)
                    {
                        cond1.APPSESECRET = wec1.APPSESECRET;
                    }
                    if (wec1.IsNotNull() && cond1.IsNotNull())
                    {
                        if (BLLTable <WEC_PUBLICLIST> .Factory(conn).Exists(cond1))
                        {
                            //BLLTable<WEC_PUBLICLIST>.Factory(conn).Update(wec1, cond1);
                        }
                        else
                        {
                            BLLTable <WEC_PUBLICLIST> .Factory(conn).Insert(wec1, WEC_PUBLICLIST.Attribute.AID);
                        }
                    }
                }
            }
            Response.Write("{\"result\":\"" + result + "\"}");
        }catch (Exception ee) {
            Response.Write("{\"result\":\"绑定出错\"}");
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        string result = "";
        string username = HttpUtil.GetReqStrValue("username");
        string password = HttpUtil.GetReqStrValue("password");
        string imgVerify = HttpUtil.GetReqStrValue("imgVerify");
        string num = Convert.ToString(Request["num"]);
        string num2 = HttpUtil.GetReqStrValue("num");
        string serverFilePath = @"E:\AppInOne_Solution\Site\UploadFiles\WecHeader";
        WEC_PUBLICLIST wec1 = new WEC_PUBLICLIST();
        try
        {
            TestCase.IServiceChannel iService = ChannelFactory<TestCase.IServiceChannel>.CreateChannel(new NetTcpBinding(SecurityMode.None), new EndpointAddress("net.tcp://localhost:8081/TestCase.WecService"));

            iService.OperationTimeout = new TimeSpan(1, 0, 5);
            iService.Open(new TimeSpan(0, 0, 10));

            if ("1".Equals(num))
            {
                result = iService.wecAddUser(username, password, imgVerify, serverFilePath);
            }
            else
            {
                result = iService.getStatus(username, password, ref wec1);
                //
                if(wec1._PLC_SOURCEID!=null)
                {
                    WEC_PUBLICLIST cond1 = new WEC_PUBLICLIST();
                    cond1._PLC_SOURCEID = wec1._PLC_SOURCEID;
                    if (wec1.APPID != null)
                        cond1.APPID = wec1.APPID;
                    if (wec1.APPSESECRET != null)
                        cond1.APPSESECRET = wec1.APPSESECRET;
                    if (wec1.IsNotNull() && cond1.IsNotNull())
                    {
                        if (BLLTable<WEC_PUBLICLIST>.Factory(conn).Exists(cond1))
                        {
                            //BLLTable<WEC_PUBLICLIST>.Factory(conn).Update(wec1, cond1);
                        }
                        else
                        {
                            BLLTable<WEC_PUBLICLIST>.Factory(conn).Insert(wec1, WEC_PUBLICLIST.Attribute.AID);
                        }
                    }
                }
            }
             Response.Write("{\"result\":\"" + result + "\"}");
         }catch(Exception ee){
             Response.Write("{\"result\":\"绑定出错\"}");
         }
    }
Exemple #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        String aid = HttpUtil.GetReqStrValue("aid");

        if (string.IsNullOrEmpty(aid))
        {
            //从数据库获取第一个aid
            WEC_PUBLICLIST val  = new WEC_PUBLICLIST();
            WEC_PUBLICLIST conf = new WEC_PUBLICLIST();
            conf.USER_ID = userBase.UserID;
            WEC_PUBLICLIST data1 = BLLTable <WEC_PUBLICLIST> .GetRowData(val, conf);

            if (data1 != null && data1.IsNotNull())
            {
                aid = data1.AID.ToString();
            }
        }
        if (string.IsNullOrEmpty(aid))
        {
            aid = "1";
        }
        this.Server.Transfer("Index.aspx?appid=2&aid=" + aid, true);
        return;
    }