Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //用户编码
            var codeUser = Request.Params["CodeUser"];

            Dictionary <string, string> info = new Dictionary <string, string>();

            try
            {
                if (codeUser == null)
                {
                    info.Add("IsInfo", "No");
                    info.Add("参数Account不能为空!举例", "http://218.92.115.55/M_Sph/UserInfo/InfoForConsignor.aspx?CodeUser=1DBAB54785BDB214E053A864016AB214");
                    Json = JsonConvert.SerializeObject(info);
                    return;
                }

                string sql =
                    string.Format("select * from TB_SPH_USER_AUTH where code_user='******' and roletype='{1}'", codeUser, "2");
                //验证此会员是否已认证
                var dt = new Leo.Oracle.DataAccess(Leo.RegistryKey.KeyPathWlxgx).ExecuteTable(sql);
                if (dt.Rows.Count == 0)
                {
                    info.Add("IsInfo", "No");
                    info.Add("Message", "用户未认证!");
                    Json = JsonConvert.SerializeObject(info);
                    return;
                }

                //查询货主信息
                sql =
                    string.Format(@"select username,identity_card,auditmark_identity,auditmark_postcard
                                    from tb_sph_user_auth 
                                    where code_user='******' and roletype='{1}'"
                                  , codeUser, "2");
                dt = new Leo.Oracle.DataAccess(Leo.RegistryKey.KeyPathWlxgx).ExecuteTable(sql);
                if (dt.Rows.Count == 0)
                {
                    info.Add("IsInfo", "No");
                    info.Add("Message", "网络错误,请稍后再试!");
                }
                else
                {
                    info.Add("IsInfo", "Yes");
                    info.Add("UserName", dt.Rows[0]["username"].ToString());
                    info.Add("IdentityCard", TokenTool.HideIDCard(dt.Rows[0]["identity_card"].ToString()));
                    info.Add("AuditMarkIdentity", dt.Rows[0]["auditmark_identity"].ToString());
                    info.Add("AuditMarkPostcard", dt.Rows[0]["auditmark_postcard"].ToString());
                    info.Add("Mobile", string.Empty);
                    info.Add("Logogram", string.Empty);
                }

                Json = JsonConvert.SerializeObject(info);
            }
            catch (Exception ex)
            {
                info.Add("IsInfo", "No");
                info.Add("Message", string.Format("{0}:获取数据发生异常。{1}", ex.Source, ex.Message));
                Json = JsonConvert.SerializeObject(info);
            }
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //用户编码
            var codeUser = Request.Params["CodeUser"];

            Dictionary <string, string> info = new Dictionary <string, string>();

            try
            {
                if (codeUser == null)
                {
                    info.Add("IsInfo", "No");
                    info.Add("参数CodeUser不能为null!", "举例:http://218.92.115.55/M_Sph/UserInfo/InfoForDriver.aspx?CodeUser=1DBAB54785BDB214E053A864016AB214");
                    Json = JsonConvert.SerializeObject(info);
                    return;
                }

                string sql =
                    string.Format("select * from TB_SPH_USER_AUTH where code_user='******' and roletype='{1}'", codeUser, "1");
                //验证此会员是否已认证
                var dt = new Leo.Oracle.DataAccess(Leo.RegistryKey.KeyPathWlxgx).ExecuteTable(sql);
                if (dt.Rows.Count == 0)
                {
                    info.Add("IsInfo", "No");
                    info.Add("Message", "用户未认证!");
                    Json = JsonConvert.SerializeObject(info);
                    return;
                }

                //查询司机信息
//                sql =
//                    string.Format(@"select b.username,b.identity_card,b.vehiclenum,b.vehiclelen,b.vehicletype,b.tons,b.auditmark_identity,b.auditmark_driving,b.auditmark_vehicle,a.account,a.logogram
//                                    from tb_sph_user a, tb_sph_user_auth b
//                                    where a.code_user=b.code_user and a.code_user='******' and b.roletype='{1}'"
//                                    , codeUser, "1");
                sql =
                    string.Format(@"select b.username,b.identity_card,b.vehiclenum,b.vehiclelen,b.vehicletype,b.tons,b.auditmark_identity,b.auditmark_driving,b.auditmark_vehicle
                                       from tb_sph_user_auth b 
                                       where code_user='******' and roletype='{1}'"
                                  , codeUser, "1");
                dt = new Leo.Oracle.DataAccess(Leo.RegistryKey.KeyPathWlxgx).ExecuteTable(sql);
                if (dt.Rows.Count == 0)
                {
                    info.Add("IsInfo", "No");
                    info.Add("Message", "网络错误,请稍后再试!");
                }
                else
                {
                    info.Add("IsInfo", "Yes");
                    info.Add("UserName", dt.Rows[0]["username"].ToString());
                    info.Add("IdentityCard", TokenTool.HideIDCard(dt.Rows[0]["identity_card"].ToString()));
                    info.Add("VehicleNum", dt.Rows[0]["vehiclenum"].ToString());
                    info.Add("VehicleLen", dt.Rows[0]["vehiclelen"].ToString());
                    info.Add("VehicleType", dt.Rows[0]["vehicletype"].ToString());
                    info.Add("Tons", dt.Rows[0]["tons"].ToString());
                    info.Add("AuditMarkIdentity", dt.Rows[0]["auditmark_identity"].ToString());
                    info.Add("AuditMarkDriving", dt.Rows[0]["auditmark_driving"].ToString());
                    info.Add("AuditMarkVehicle", dt.Rows[0]["auditmark_vehicle"].ToString());
                    info.Add("Mobile", string.Empty);
                    info.Add("Logogram", string.Empty);
                }

                Json = JsonConvert.SerializeObject(info);
            }
            catch (Exception ex)
            {
                info.Add("IsInfo", "No");
                info.Add("Message", string.Format("{0}:获取数据发生异常。{1}", ex.Source, ex.Message));
                Json = JsonConvert.SerializeObject(info);
            }
        }
Esempio n. 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //手机号码
            var mobile = Request.Params["Mobile"];

            Dictionary <string, string> info = new Dictionary <string, string>();

            try
            {
                if (mobile == null)
                {
                    info.Add("IsAuth", "No");
                    info.Add("参数Mobile不能为null!", "举例:http://218.92.115.55/M_Sph/Auth/IdentityAuthForDriver.aspx?Mobile=18000000000");
                    Json = JsonConvert.SerializeObject(info);
                    return;
                }

                //手机号码验证
                string message = TokenTool.VerifyMobile(mobile);
                if (message != "ture")
                {
                    info.Add("IsAuth", "No");
                    info.Add("Message", message);
                    Json = JsonConvert.SerializeObject(info);
                    return;
                }

                string sql =
                    string.Format(@"select b.username,b.identity_card,b.vehiclenum,b.vehiclelen,b.vehicletype,b.tons,b.auditmark_identity,b.auditmark_driving,b.auditmark_vehicle,a.code_user 
                                    from IPORT.TB_SYS_USERINFO a, TB_SPH_USER_AUTH b  
                                    where a.code_user=b.code_user and b.roletype='1' and a.mobile='{0}' "
                                  , mobile);
                //验证此会员是否已认证
                var dt = new Leo.Oracle.DataAccess(Leo.RegistryKey.KeyPathWlxgx).ExecuteTable(sql);
                if (dt.Rows.Count == 0)
                {
                    info.Add("IsInfo", "No");
                    info.Add("Message", "用户未认证!");
                    Json = JsonConvert.SerializeObject(info);
                    return;
                }



                info.Add("IsAuth", "Yes");
                info.Add("UserName", dt.Rows[0]["username"].ToString());
                info.Add("IdentityCard", TokenTool.HideIDCard(dt.Rows[0]["identity_card"].ToString()));
                info.Add("VehicleNum", dt.Rows[0]["vehiclenum"].ToString());
                info.Add("VehicleLen", dt.Rows[0]["vehiclelen"].ToString());
                info.Add("VehicleType", dt.Rows[0]["vehicletype"].ToString());
                info.Add("Tons", dt.Rows[0]["tons"].ToString());
                info.Add("AuditMarkIdentity", dt.Rows[0]["auditmark_identity"].ToString());
                info.Add("AuditMarkDriving", dt.Rows[0]["auditmark_driving"].ToString());
                info.Add("AuditMarkVehicle", dt.Rows[0]["auditmark_vehicle"].ToString());
                info.Add("CodeUser", dt.Rows[0]["code_user"].ToString());

                Json = JsonConvert.SerializeObject(info);
            }
            catch (Exception ex)
            {
                info.Add("IsInfo", "No");
                info.Add("Message", string.Format("{0}:获取数据发生异常。{1}", ex.Source, ex.Message));
                Json = JsonConvert.SerializeObject(info);
            }
        }