Example #1
0
        public void Index()
        {
            var    context      = HttpContext;
            string ApplyNo      = context.Request["ApplyNo"];
            string CustomerName = context.Request["CustomerName"];
            string Saletor      = context.Request["Saletor"];
            string CarType      = context.Request["CarType"];
            string FkState      = context.Request["FkState"];
            string DyState      = context.Request["DyState"];
            string GdTime       = context.Request["GdTime"];
            string StartTime    = context.Request["StartTime"];
            string EndTime      = context.Request["EndTime"];
            string Page         = context.Request["Page"];
            string Size         = context.Request["Size"];

            OThinker.H3.Controllers.UserValidator User = context.Session[OThinker.H3.Controllers.Sessions.GetUserValidator()] as OThinker.H3.Controllers.UserValidator;
            string userCode = User.UserCode;
            string ObjectID = context.Request["ObjectID"] + string.Empty;

            Newtonsoft.Json.Linq.JObject ret = new Newtonsoft.Json.Linq.JObject();
            int total = 0;

            ret.Add("Data", new ReturnData()
            {
                ApplyNo = ApplyNo, GdTime = GdTime, FkTime = StartTime, DyTime = EndTime, CustomerName = CustomerName, Saletor = Saletor, CarType = CarType, FkState = FkState, DyState = DyState, userCode = userCode
            }.GetJson(Page, Size, out total));
            ret.Add("Total", total);

            context.Response.Write(ret);
        }
 /// <summary>
 /// 用户验证
 /// </summary>
 /// <param name="userCode"></param>
 /// <param name="password"></param>
 /// <returns></returns>
 public static string ValidateUser(string userCode, string password)
 {
     OThinker.H3.Controllers.UserValidator user = OThinker.H3.Controllers.UserValidatorFactory.Validate(userCode, password);
     if (user != null)
     {
         return("{ \"errcode\": \"0\", \"errmsg\": \"验证成功\", \"data\":[]}");
     }
     else
     {
         return("{ \"errcode\": \"1\", \"errmsg\": \"帐号或密码不正确\", \"data\":[]}");
     }
 }
Example #3
0
 /// <summary>
 /// 验证当前用户是否正确
 /// </summary>
 /// <returns></returns>
 public void ValidateSoapHeader()
 {
     if (authentication == null)
     {
         throw new Exception("请输入身份认证信息!");
     }
     UserValidator = OThinker.H3.Controllers.UserValidatorFactory.Validate(authentication.UserCode, authentication.Password);
     if (UserValidator == null)
     {
         throw new Exception("帐号或密码不正确!");
     }
     Engine = UserValidator.Engine;
 }