Exemplo n.º 1
0
        public static string Insert_Login(LOGIN_INPUT model)
        {
            ResponseModel rs = new ResponseModel();

            if (string.IsNullOrEmpty(model.userName))
            {
                rs.Returncode    = ResponseCodeEnum.Failed.GetHashCode();
                rs.ReturnMessage = "Tên tài khoản không được để trống";
            }
            else
            if (string.IsNullOrEmpty(model.userPassword))
            {
                rs.Returncode    = ResponseCodeEnum.Failed.GetHashCode();
                rs.ReturnMessage = "Mật khẩu không được để trống";
            }
            else
            {
                var dto = new LOGIN
                {
                    userName     = model.userName,
                    userPassword = model.userPassword,
                    statusLG     = model.statusLG,
                    typeLogin    = model.typeLogin
                };
                var res = IData.InsertLogGin(dto);
                if (res.ResponseCode == 1)
                {
                    rs.Returncode    = ResponseCodeEnum.Success.GetHashCode();
                    rs.ReturnMessage = "thêm tài khoản thành công";
                    rs.Data          = dto;
                }
                else
                {
                    rs.Returncode    = ResponseCodeEnum.Failed.GetHashCode();
                    rs.ReturnMessage = "thêm tài khoản thất bại";
                }
            }
            string js = CONVERJS.convert(rs);

            return(js);
        }
        public Stream InsertLogGin(LOGIN_INPUT model)
        {
            var isl = Services.Insert_Login(model);

            return(CONVERJS.ReturnResult(isl));
        }